diff --git a/lib/repl.js b/lib/repl.js index 3379477672..ffe2b77e46 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -184,8 +184,8 @@ function REPLServer(prompt, stream) { // It could also be an error from JSON.parse } else if (e && e.stack && - e.stack.match('Unexpected token ILLEGAL') && - e.stack.match(/Object.parse \(native\)/)) { + e.stack.match(/^SyntaxError: Unexpected token .*\n/) && + e.stack.match(/\n at Object.parse \(native\)\n/)) { throw e; } }