summaryrefslogtreecommitdiff
path: root/ext/console/02_console.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-04-03 02:41:41 +0900
committerGitHub <noreply@github.com>2023-04-02 19:41:41 +0200
commit03edd48edd004cec091541e6b71095cfbc4b4c87 (patch)
tree72aed1dae803334b73479ffebc7ca8c83d10addf /ext/console/02_console.js
parentad8d0c90d1887beb8a5f2c6d30f9dc71cc63e4fe (diff)
chore: Turn back on dlintPreferPrimordials (#17715)
Closes #17709
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r--ext/console/02_console.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index 5547dd230..85a0f784f 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -64,6 +64,7 @@ const {
SymbolPrototype,
SymbolPrototypeToString,
SymbolPrototypeValueOf,
+ SymbolPrototypeGetDescription,
SymbolToStringTag,
SymbolHasInstance,
SymbolFor,
@@ -662,7 +663,7 @@ function handleCircular(value, cyan) {
} else {
index = MapPrototypeGet(circular, value);
if (index === undefined) {
- index = circular.size + 1;
+ index = MapPrototypeGetSize(circular) + 1;
MapPrototypeSet(circular, value, index);
}
}
@@ -809,20 +810,17 @@ const QUOTE_SYMBOL_REG = new SafeRegExp(/^[a-zA-Z_][a-zA-Z_.0-9]*$/);
// Surround a symbol's description in quotes when it is required (e.g the description has non printable characters).
function maybeQuoteSymbol(symbol, inspectOptions) {
- if (symbol.description === undefined) {
+ const description = SymbolPrototypeGetDescription(symbol);
+
+ if (description === undefined) {
return SymbolPrototypeToString(symbol);
}
- if (
- RegExpPrototypeTest(
- QUOTE_SYMBOL_REG,
- symbol.description,
- )
- ) {
+ if (RegExpPrototypeTest(QUOTE_SYMBOL_REG, description)) {
return SymbolPrototypeToString(symbol);
}
- return `Symbol(${quoteString(symbol.description, inspectOptions)})`;
+ return `Symbol(${quoteString(description, inspectOptions)})`;
}
const CTX_STACK = [];
@@ -1191,8 +1189,8 @@ function inspectRawObject(
symbolKeys,
(s1, s2) =>
StringPrototypeLocaleCompare(
- s1.description ?? "",
- s2.description ?? "",
+ SymbolPrototypeGetDescription(s1) ?? "",
+ SymbolPrototypeGetDescription(s2) ?? "",
),
);
}