summaryrefslogtreecommitdiff
path: root/ext/console/02_console.js
diff options
context:
space:
mode:
authorJason <m.jason.liu@outlook.com>2022-03-20 19:21:42 +0800
committerGitHub <noreply@github.com>2022-03-20 20:21:42 +0900
commit0bc286ab47d82496b90efb429e16efccc10e5f2d (patch)
treef755dc9422e1153a06548e63e31c1279f0b484ee /ext/console/02_console.js
parent5e82bcf0e422d657591328a0d6645b16ea45959c (diff)
fix(ext/console): fix error with a Proxy of a Map (#14032)
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r--ext/console/02_console.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index 4663ded73..a16095179 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -661,7 +661,8 @@
if (ctxHas(value)) {
return handleCircular(value, cyan);
}
- return inspectObject(value, level, inspectOptions);
+
+ return inspectObject(value, level, inspectOptions, proxyDetails);
default:
// Not implemented is red
return red("[Not Implemented]");
@@ -1200,6 +1201,7 @@
value,
level,
inspectOptions,
+ proxyDetails,
) {
if (customInspect in value && typeof value[customInspect] === "function") {
return String(value[customInspect](inspect));
@@ -1240,9 +1242,17 @@
} else if (ObjectPrototypeIsPrototypeOf(DatePrototype, value)) {
return inspectDate(value, inspectOptions);
} else if (ObjectPrototypeIsPrototypeOf(SetPrototype, value)) {
- return inspectSet(value, level, inspectOptions);
+ return inspectSet(
+ proxyDetails ? proxyDetails[0] : value,
+ level,
+ inspectOptions,
+ );
} else if (ObjectPrototypeIsPrototypeOf(MapPrototype, value)) {
- return inspectMap(value, level, inspectOptions);
+ return inspectMap(
+ proxyDetails ? proxyDetails[0] : value,
+ level,
+ inspectOptions,
+ );
} else if (ObjectPrototypeIsPrototypeOf(WeakSetPrototype, value)) {
return inspectWeakSet(inspectOptions);
} else if (ObjectPrototypeIsPrototypeOf(WeakMapPrototype, value)) {