summaryrefslogtreecommitdiff
path: root/ext/console/01_console.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/console/01_console.js')
-rw-r--r--ext/console/01_console.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/console/01_console.js b/ext/console/01_console.js
index 90f09d4d1..cffa72d8c 100644
--- a/ext/console/01_console.js
+++ b/ext/console/01_console.js
@@ -1484,12 +1484,18 @@ function inspectError(value, ctx) {
finalMessage += `[${stack || ErrorPrototypeToString(value)}]`;
}
}
+ const doubleQuoteRegExp = new SafeRegExp('"', "g");
finalMessage += ArrayPrototypeJoin(
ArrayPrototypeMap(
causes,
(cause) =>
"\nCaused by " + (MapPrototypeGet(refMap, cause) ?? "") +
- (cause?.stack ?? cause),
+ (cause?.stack ??
+ StringPrototypeReplace(
+ inspect(cause),
+ doubleQuoteRegExp,
+ "",
+ )),
),
"",
);