summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/console/01_console.js5
-rw-r--r--ext/node/polyfills/internal/util/inspect.mjs1
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/console/01_console.js b/ext/console/01_console.js
index dbbc549ca..11b6c549c 100644
--- a/ext/console/01_console.js
+++ b/ext/console/01_console.js
@@ -2427,6 +2427,7 @@ const denoInspectDefaultOptions = {
colors: false,
showProxy: false,
breakLength: 80,
+ escapeSequences: true,
compact: 3,
sorted: false,
getters: false,
@@ -2500,7 +2501,9 @@ function quoteString(string, ctx) {
ctx.quotes[0];
const escapePattern = new SafeRegExp(`(?=[${quote}\\\\])`, "g");
string = StringPrototypeReplace(string, escapePattern, "\\");
- string = replaceEscapeSequences(string);
+ if (ctx.escapeSequences) {
+ string = replaceEscapeSequences(string);
+ }
return `${quote}${string}${quote}`;
}
diff --git a/ext/node/polyfills/internal/util/inspect.mjs b/ext/node/polyfills/internal/util/inspect.mjs
index 671ab2acf..2d34db9c7 100644
--- a/ext/node/polyfills/internal/util/inspect.mjs
+++ b/ext/node/polyfills/internal/util/inspect.mjs
@@ -134,6 +134,7 @@ const inspectDefaultOptions = {
colors: false,
showProxy: false,
breakLength: 80,
+ escapeSequences: true,
compact: 3,
sorted: false,
getters: false,