From 607e7b5012b69c11a0bfa39874b772232f7f10ff Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Mon, 15 Dec 2014 12:21:54 -0800 Subject: [PATCH] repl: make 'Unexpected token' errors recoverable Fix the regexp used to detect 'Unexpected token' errors so that they can be considered as recoverable. This fixes the following use case: > var foo = 'bar \ ... baz'; undefined > foo 'bar baz' > Fixes #8874 --- lib/repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index a8fa060c5930..ef720a2f57ca 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -949,7 +949,7 @@ REPLServer.prototype.convertToContext = function(cmd) { function isRecoverableError(e) { return e && e.name === 'SyntaxError' && - /^(Unexpected end of input|Unexpected token :)/.test(e.message); + /^(Unexpected end of input|Unexpected token)/.test(e.message); } function Recoverable(err) {