Issue #1714 ... broken 'in' after raw range 'for'
This commit is contained in:
parent
a2c593bc2c
commit
54110c98d9
|
@ -238,6 +238,7 @@
|
||||||
if (!(match = MULTI_DENT.exec(this.chunk))) return 0;
|
if (!(match = MULTI_DENT.exec(this.chunk))) return 0;
|
||||||
indent = match[0];
|
indent = match[0];
|
||||||
this.line += count(indent, '\n');
|
this.line += count(indent, '\n');
|
||||||
|
this.seenFor = false;
|
||||||
prev = last(this.tokens, 1);
|
prev = last(this.tokens, 1);
|
||||||
size = indent.length - 1 - indent.lastIndexOf('\n');
|
size = indent.length - 1 - indent.lastIndexOf('\n');
|
||||||
noNewlines = this.unfinished();
|
noNewlines = this.unfinished();
|
||||||
|
|
|
@ -241,6 +241,7 @@ exports.Lexer = class Lexer
|
||||||
return 0 unless match = MULTI_DENT.exec @chunk
|
return 0 unless match = MULTI_DENT.exec @chunk
|
||||||
indent = match[0]
|
indent = match[0]
|
||||||
@line += count indent, '\n'
|
@line += count indent, '\n'
|
||||||
|
@seenFor = no
|
||||||
prev = last @tokens, 1
|
prev = last @tokens, 1
|
||||||
size = indent.length - 1 - indent.lastIndexOf '\n'
|
size = indent.length - 1 - indent.lastIndexOf '\n'
|
||||||
noNewlines = @unfinished()
|
noNewlines = @unfinished()
|
||||||
|
|
|
@ -199,6 +199,10 @@ test "#1100: precedence in or-test compilation of `in`", ->
|
||||||
|
|
||||||
test "#1630: `in` should check `hasOwnProperty`", ->
|
test "#1630: `in` should check `hasOwnProperty`", ->
|
||||||
ok undefined not in length: 1
|
ok undefined not in length: 1
|
||||||
|
|
||||||
|
test "#1714: lexer bug with raw range `for` followed by `in`", ->
|
||||||
|
0 for [1..10]
|
||||||
|
ok not ('a' in ['b'])
|
||||||
|
|
||||||
|
|
||||||
# Chained Comparison
|
# Chained Comparison
|
||||||
|
|
Loading…
Reference in New Issue