repl: remove redundant escape
PR-URL: https://github.com/nodejs/node/pull/26496 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
b7568e1b27
commit
a26e9a8a57
@ -232,7 +232,7 @@ function REPLServer(prompt,
|
|||||||
let awaitPromise = false;
|
let awaitPromise = false;
|
||||||
const input = code;
|
const input = code;
|
||||||
|
|
||||||
if (/^\s*\{/.test(code) && /\}\s*$/.test(code)) {
|
if (/^\s*{/.test(code) && /}\s*$/.test(code)) {
|
||||||
// It's confusing for `{ a : 1 }` to be interpreted as a block
|
// It's confusing for `{ a : 1 }` to be interpreted as a block
|
||||||
// statement rather than an object literal. So, we first try
|
// statement rather than an object literal. So, we first try
|
||||||
// to wrap it in parentheses, so that it will be interpreted as
|
// to wrap it in parentheses, so that it will be interpreted as
|
||||||
|
Loading…
x
Reference in New Issue
Block a user