1
0
Fork 0
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:
Aaron O'Mullan 2021-09-29 18:06:29 +02:00 committed by GitHub
parent cd913e51ef
commit c896ba2e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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",