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 c4103c1 commit f4c13b3Copy full SHA for f4c13b3
lib/internal/debugger/inspect_repl.js
@@ -575,8 +575,16 @@ function createRepl(inspector) {
575
if (input === '\n') return lastCommand;
576
// Add parentheses: exec process.title => exec("process.title");
577
const match = RegExpPrototypeExec(/^\s*(?:exec|p)\s+([^\n]*)/, input);
578
+ input = match ? match[1] : input;
579
+
580
+ // Add parentheses to make sure input is parsed as expression
581
+ if (RegExpPrototypeExec(/^\s*{/, input) !== null &&
582
+ RegExpPrototypeExec(/;\s*$/, input) === null) {
583
+ input = `(${StringPrototypeTrim(input)})\n`;
584
+ }
585
586
if (match) {
- lastCommand = `exec(${JSONStringify(match[1])})`;
587
+ lastCommand = `exec(${JSONStringify(input)})`;
588
} else {
589
lastCommand = input;
590
}
0 commit comments