From a26e9a8a57cdf84e8ecb3e39b186d73b39108457 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Thu, 7 Mar 2019 22:31:13 +0800 Subject: [PATCH] repl: remove redundant escape MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/26496 Reviewed-By: Ruben Bridgewater Reviewed-By: Michaël Zasso Reviewed-By: Anto Aravinth Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- lib/repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index a641843d2c7..ecf81a9ac3c 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -232,7 +232,7 @@ function REPLServer(prompt, let awaitPromise = false; 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 // statement rather than an object literal. So, we first try // to wrap it in parentheses, so that it will be interpreted as