summaryrefslogtreecommitdiff
path: root/ext/console/02_console.js
diff options
context:
space:
mode:
author李瑞丰 <liruifeng1024@gmail.com>2022-09-26 22:55:58 +0800
committerGitHub <noreply@github.com>2022-09-26 23:55:58 +0900
commita2262c11d750c922e6cdea1cac5ff80f603d67e9 (patch)
treefb9957327c038f55d904931bab65610b076b817d /ext/console/02_console.js
parentb73cb7bf9cd8825acda0d378a9afa1c3b1062f51 (diff)
fix(ext/console): fix error when logging a proxied Date (#16018)
Diffstat (limited to 'ext/console/02_console.js')
-rw-r--r--ext/console/02_console.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/console/02_console.js b/ext/console/02_console.js
index 5b65774d9..efb7aeb50 100644
--- a/ext/console/02_console.js
+++ b/ext/console/02_console.js
@@ -701,7 +701,11 @@
return handleCircular(value, cyan);
}
- return inspectObject(value, inspectOptions, proxyDetails);
+ return inspectObject(
+ value,
+ inspectOptions,
+ proxyDetails,
+ );
default:
// Not implemented is red
return red("[Not Implemented]");
@@ -1283,11 +1287,7 @@
return [baseString, refIndex];
}
- function inspectObject(
- value,
- inspectOptions,
- proxyDetails,
- ) {
+ function inspectObject(value, inspectOptions, proxyDetails) {
if (
ReflectHas(value, customInspect) &&
typeof value[customInspect] === "function"
@@ -1330,7 +1330,10 @@
} else if (ObjectPrototypeIsPrototypeOf(RegExpPrototype, value)) {
return inspectRegExp(value, inspectOptions);
} else if (ObjectPrototypeIsPrototypeOf(DatePrototype, value)) {
- return inspectDate(value, inspectOptions);
+ return inspectDate(
+ proxyDetails ? proxyDetails[0] : value,
+ inspectOptions,
+ );
} else if (ObjectPrototypeIsPrototypeOf(SetPrototype, value)) {
return inspectSet(
proxyDetails ? proxyDetails[0] : value,