repl: make 'Unexpected token' errors recoverable
authorJulien Gilli <julien.gilli@joyent.com>
Mon, 15 Dec 2014 20:21:54 +0000 (12:21 -0800)
committercjihrig <cjihrig@gmail.com>
Thu, 25 Jun 2015 16:17:51 +0000 (12:17 -0400)
commita198c68b5680307f20a1602c622b94f497f7b642
treeb1a77e6766b45b2323aef560f1719c35d70ef1f5
parentd735b2c6ef9dc710a2e8c58bf56dc6d28f5a4bd3
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: https://github.com/joyent/node/issues/8874
PR-URL: https://github.com/joyent/node/pull/8875
PR-URL: https://github.com/nodejs/io.js/pull/2052
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/repl.js
test/parallel/test-repl-unexpected-token-recoverable.js [new file with mode: 0644]