mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
perf(webidl/DOMString): don't wrap string primitives (#12266)
This commit is contained in:
parent
cd913e51ef
commit
c896ba2e19
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