summaryrefslogtreecommitdiff
path: root/lib/repl.js
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2013-08-27 08:57:16 -0700
committerisaacs <i@izs.me>2013-09-04 11:13:41 -0700
commit54fbb1da96376688f2bffac28486c61f38bf6eaf (patch)
tree8c484772d2971a012fc82e14d27fd5a507388af2 /lib/repl.js
parent4631c503e35cd3bb75a10424dd47a73c12ec468e (diff)
downloadnodejs-54fbb1da96376688f2bffac28486c61f38bf6eaf.tar.gz
nodejs-54fbb1da96376688f2bffac28486c61f38bf6eaf.tar.bz2
nodejs-54fbb1da96376688f2bffac28486c61f38bf6eaf.zip
repl: treat "Assignment to const" as syntax error
Adding a new `repl-harmony` test file here because adding the `--use_strict --harmony` flags on the main repl test file was causing lots of unrelated failures, due to global variable assignments and things like that. This new test file is based off of the original repl.js test file, but has a lot of the tests stripped out. A test case for this commit is included though. Fixes #6132.
Diffstat (limited to 'lib/repl.js')
-rw-r--r--lib/repl.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/repl.js b/lib/repl.js
index c46db5ee9..e7c1ae9b3 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -949,5 +949,6 @@ function isSyntaxError(e) {
e = e && (e.stack || e.toString());
return e && e.match(/^SyntaxError/) &&
// "strict mode" syntax errors
- !e.match(/^SyntaxError: .*strict mode.*/i);
+ !e.match(/^SyntaxError: .*strict mode.*/i) &&
+ !e.match(/^SyntaxError: Assignment to constant variable/i);
}