Fixes #1714
This commit is contained in:
parent
65b3bf0d4c
commit
3d91b10927
|
@ -347,6 +347,7 @@
|
|||
}
|
||||
}
|
||||
if (value === ';') {
|
||||
this.seenFor = false;
|
||||
tag = 'TERMINATOR';
|
||||
} else if (__indexOf.call(MATH, value) >= 0) {
|
||||
tag = 'MATH';
|
||||
|
|
|
@ -329,7 +329,9 @@ exports.Lexer = class Lexer
|
|||
prev[0] = 'COMPOUND_ASSIGN'
|
||||
prev[1] += '='
|
||||
return value.length
|
||||
if value is ';' then tag = 'TERMINATOR'
|
||||
if value is ';'
|
||||
@seenFor = no
|
||||
tag = 'TERMINATOR'
|
||||
else if value in MATH then tag = 'MATH'
|
||||
else if value in COMPARE then tag = 'COMPARE'
|
||||
else if value in COMPOUND_ASSIGN then tag = 'COMPOUND_ASSIGN'
|
||||
|
|
|
@ -201,7 +201,12 @@ test "#1630: `in` should check `hasOwnProperty`", ->
|
|||
ok undefined not in length: 1
|
||||
|
||||
test "#1714: lexer bug with raw range `for` followed by `in`", ->
|
||||
0 for [1..10]
|
||||
0 for [1..2]
|
||||
ok not ('a' in ['b'])
|
||||
|
||||
0 for [1..2]; ok not ('a' in ['b'])
|
||||
|
||||
0 for [1..10] # comment ending
|
||||
ok not ('a' in ['b'])
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue