diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-04-15 05:23:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 22:23:28 +0200 |
commit | f086ec57b453fc0af763564eb80fea4b5b7f7296 (patch) | |
tree | 8c7800d918751893e4011eb86f23e8f687d4139b /ext/console/02_console.js | |
parent | 136dce67cec749dce5989ea29e88359ef79a0045 (diff) |
fix(core): Use safe primordials wrappers (#18687)
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r-- | ext/console/02_console.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js index 85a0f784f..3e55efb74 100644 --- a/ext/console/02_console.js +++ b/ext/console/02_console.js @@ -54,6 +54,7 @@ const { RegExpPrototypeTest, RegExpPrototypeToString, SafeArrayIterator, + SafeMap, SafeStringIterator, SafeSet, SafeRegExp, @@ -85,7 +86,6 @@ const { ArrayPrototypeFind, FunctionPrototypeBind, FunctionPrototypeToString, - Map, MapPrototype, MapPrototypeHas, MapPrototypeGet, @@ -658,7 +658,7 @@ let circular; function handleCircular(value, cyan) { let index = 1; if (circular === undefined) { - circular = new Map(); + circular = new SafeMap(); MapPrototypeSet(circular, value, index); } else { index = MapPrototypeGet(circular, value); @@ -1016,7 +1016,7 @@ function inspectError(value, cyan) { } } - const refMap = new Map(); + const refMap = new SafeMap(); for (let i = 0; i < causes.length; ++i) { const cause = causes[i]; if (circular !== undefined) { @@ -1405,7 +1405,7 @@ function inspectObject(value, inspectOptions, proxyDetails) { } } -const colorKeywords = new Map([ +const colorKeywords = new SafeMap([ ["black", "#000000"], ["silver", "#c0c0c0"], ["gray", "#808080"], @@ -1990,8 +1990,8 @@ function inspectArgs(args, inspectOptions = {}) { return string; } -const countMap = new Map(); -const timerMap = new Map(); +const countMap = new SafeMap(); +const timerMap = new SafeMap(); const isConsoleInstance = Symbol("isConsoleInstance"); function getConsoleInspectOptions() { |