diff --git a/lib/repl.js b/lib/repl.js index df4a555efe7..2d833c96958 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -1277,7 +1277,7 @@ var isIncompleteSyntaxErrorMessage = (function() { return true; } if (message === 'Invalid or unexpected token') { - return !bailOnIllegalToken(code); + return isCodeRecoverable(code); } return false; }; diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index dbe3b13bd4e..a5f7895e1cd 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -457,14 +457,13 @@ function error_test() { client: client_unix, send: '(function() {\nif (false) {} /bar"/;\n}())', expect: prompt_multiline + prompt_multiline + 'undefined\n' + prompt_unix }, - // Newline within template string maintains whitespace. { client: client_unix, send: '`foo \n`', expect: prompt_multiline + '\'foo \\n\'\n' + prompt_unix }, // Whitespace is not evaluated. { client: client_unix, send: ' \t \n', expect: prompt_unix } - ].filter((v) => !common.engineSpecificMessage(v))); + ].filter((v) => !common.engineSpecificMessage(v))); } function tcp_test() {