[loose parser] Don't tokenize ellipsis when ecmaVersion < 6

Issue marijnh/tern#493
This commit is contained in:
Marijn Haverbeke 2015-02-17 14:41:33 +01:00
parent 7264bc0178
commit 9a617a59e4

View File

@ -80,7 +80,7 @@
for (;;) {
try {
var tok = fetchToken();
if (tok.type === tt.dot && input.substr(tok.end, 1) === '.') {
if (tok.type === tt.dot && input.substr(tok.end, 1) === '.' && options.ecmaVersion >= 6) {
tok = fetchToken();
tok.start--;
tok.type = tt.ellipsis;