1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

perf(webidl/DOMString): don't wrap string primitives (#12266)

This commit is contained in:
Aaron O'Mullan 2021-09-29 18:06:29 +02:00 committed by Ryan Dahl
parent 09efe92957
commit 37a2377d08

View file

@ -359,11 +359,11 @@
};
converters.DOMString = function (V, opts = {}) {
if (opts.treatNullAsEmptyString && V === null) {
if (typeof V === "string") {
return V;
} else if (V === null && opts.treatNullAsEmptyString) {
return "";
}
if (typeof V === "symbol") {
} else if (typeof V === "symbol") {
throw makeException(
TypeError,
"is a symbol, which cannot be converted to a string",