summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2013-05-26 12:26:39 -0400
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-30 14:41:00 +0200
commit774b28fde7035b076f5d80ade2ea293b18f2084b (patch)
tree7b79b7ccbcc1668a17d4b8dad7737905fc5b694d /test
parent9ee86b718c8079474b2647385404042fd94fd116 (diff)
downloadandroid-node-v8-774b28fde7035b076f5d80ade2ea293b18f2084b.tar.gz
android-node-v8-774b28fde7035b076f5d80ade2ea293b18f2084b.tar.bz2
android-node-v8-774b28fde7035b076f5d80ade2ea293b18f2084b.zip
repl: fix JSON.parse error check
Before this, entering something like: > JSON.parse('066'); resulted in the "..." prompt instead of displaying the expected "SyntaxError: Unexpected number"
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-repl.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/simple/test-repl.js b/test/simple/test-repl.js
index 27c2058b01..2c04e2c1bd 100644
--- a/test/simple/test-repl.js
+++ b/test/simple/test-repl.js
@@ -134,6 +134,9 @@ function error_test() {
expect: /^SyntaxError: Unexpected token i/ },
// end of input to JSON.parse error is special case of syntax error,
// should throw
+ { client: client_unix, send: 'JSON.parse(\'066\');',
+ expect: /^SyntaxError: Unexpected number/ },
+ // should throw
{ client: client_unix, send: 'JSON.parse(\'{\');',
expect: /^SyntaxError: Unexpected end of input/ },
// invalid RegExps are a special case of syntax error,