Skip to content

Commit

Permalink
lib: update Symbol.toStringTag by SymbolToStringTag primordial
Browse files Browse the repository at this point in the history
PR-URL: #30908
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
Sebastien-Ahkrin authored and targos committed Jan 14, 2020
1 parent d4ea392 commit d1702f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/internal/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors,
Symbol,
SymbolToStringTag,
} = primordials;

const {
Expand Down Expand Up @@ -358,7 +359,7 @@ ObjectDefineProperties(
'encode': { enumerable: true },
'encodeInto': { enumerable: true },
'encoding': { enumerable: true },
[Symbol.toStringTag]: {
[SymbolToStringTag]: {
configurable: true,
value: 'TextEncoder'
} });
Expand Down Expand Up @@ -554,7 +555,7 @@ function makeTextDecoderJS() {
ObjectDefineProperties(TextDecoder.prototype, {
decode: { enumerable: true },
[inspect]: { enumerable: false },
[Symbol.toStringTag]: {
[SymbolToStringTag]: {
configurable: true,
value: 'TextDecoder'
}
Expand Down
7 changes: 4 additions & 3 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
ReflectOwnKeys,
Symbol,
SymbolIterator,
SymbolToStringTag,
} = primordials;

const { inspect } = require('internal/util/inspect');
Expand Down Expand Up @@ -431,7 +432,7 @@ ObjectDefineProperties(URL.prototype, {
return ret;
}
},
[Symbol.toStringTag]: {
[SymbolToStringTag]: {
configurable: true,
value: 'URL'
},
Expand Down Expand Up @@ -859,7 +860,7 @@ function serializeParams(array) {
// Mainly to mitigate func-name-matching ESLint rule
function defineIDLClass(proto, classStr, obj) {
// https://heycam.github.io/webidl/#dfn-class-string
ObjectDefineProperty(proto, Symbol.toStringTag, {
ObjectDefineProperty(proto, SymbolToStringTag, {
writable: false,
enumerable: false,
configurable: true,
Expand Down Expand Up @@ -1244,7 +1245,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', {
} else {
outputStr = ` ${outputStrs.join(', ')}`;
}
return `${this[Symbol.toStringTag]} {${outputStr} }`;
return `${this[SymbolToStringTag]} {${outputStr} }`;
}
});

Expand Down

0 comments on commit d1702f5

Please sign in to comment.