mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
perf(webidl/DOMString): don't wrap string primitives (#12266)
This commit is contained in:
parent
09efe92957
commit
37a2377d08
1 changed files with 4 additions and 4 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue