We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70e49e2 commit e2a3f35Copy full SHA for e2a3f35
lib/internal/debugger/inspect_repl.js
@@ -573,8 +573,16 @@ function createRepl(inspector) {
573
if (input === '\n') return lastCommand;
574
// Add parentheses: exec process.title => exec("process.title");
575
const match = RegExpPrototypeExec(/^\s*(?:exec|p)\s+([^\n]*)/, input);
576
+ input = match ? match[1] : input;
577
+
578
+ // Add parentheses to make sure input is parsed as expression
579
+ if (RegExpPrototypeExec(/^\s*{/, input) !== null &&
580
+ RegExpPrototypeExec(/;\s*$/, input) === null) {
581
+ input = `(${StringPrototypeTrim(input)})\n`;
582
+ }
583
584
if (match) {
- lastCommand = `exec(${JSONStringify(match[1])})`;
585
+ lastCommand = `exec(${JSONStringify(input)})`;
586
} else {
587
lastCommand = input;
588
}
0 commit comments