diff options
author | Rich Trott <rtrott@gmail.com> | 2016-06-01 23:13:45 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-06-04 14:25:25 -0700 |
commit | de0aa23ad71e63c90be947f79b547f7c303ce7b8 (patch) | |
tree | 5034e4e09cf1785b0da4921d58ef0060a57db782 /test/parallel/test-repl.js | |
parent | ac0665c908e31787c2b5ea5e84d1a05cb4cc6c97 (diff) | |
download | android-node-v8-de0aa23ad71e63c90be947f79b547f7c303ce7b8.tar.gz android-node-v8-de0aa23ad71e63c90be947f79b547f7c303ce7b8.tar.bz2 android-node-v8-de0aa23ad71e63c90be947f79b547f7c303ce7b8.zip |
repl: refine handling of illegal tokens
Illegal tokens are only recoverable in string literals, RegExp literals,
and block comments. If not in one of these constructs, immediately
return an error rather than giving the user false hope by giving them a
chance to try to recover.
PR-URL: https://github.com/nodejs/node/pull/7104
Fixes: https://github.com/nodejs/node/issues/3611
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/parallel/test-repl.js')
-rw-r--r-- | test/parallel/test-repl.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 2ec996897a..fe4bcd32de 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -324,6 +324,10 @@ function error_test() { 'undefined\n' + prompt_unix }, { client: client_unix, send: '{ var x = 4; }', expect: 'undefined\n' + prompt_unix }, + // Illegal token is not recoverable outside string literal, RegExp literal, + // or block comment. https://github.com/nodejs/node/issues/3611 + { client: client_unix, send: 'a = 3.5e', + expect: /^SyntaxError: Unexpected token ILLEGAL/ }, ]); } |