mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Issue #1714 ... broken 'in' after raw range 'for'
This commit is contained in:
parent
a2c593bc2c
commit
54110c98d9
3 changed files with 6 additions and 0 deletions
|
@ -238,6 +238,7 @@
|
|||
if (!(match = MULTI_DENT.exec(this.chunk))) return 0;
|
||||
indent = match[0];
|
||||
this.line += count(indent, '\n');
|
||||
this.seenFor = false;
|
||||
prev = last(this.tokens, 1);
|
||||
size = indent.length - 1 - indent.lastIndexOf('\n');
|
||||
noNewlines = this.unfinished();
|
||||
|
|
|
@ -241,6 +241,7 @@ exports.Lexer = class Lexer
|
|||
return 0 unless match = MULTI_DENT.exec @chunk
|
||||
indent = match[0]
|
||||
@line += count indent, '\n'
|
||||
@seenFor = no
|
||||
prev = last @tokens, 1
|
||||
size = indent.length - 1 - indent.lastIndexOf '\n'
|
||||
noNewlines = @unfinished()
|
||||
|
|
|
@ -199,6 +199,10 @@ test "#1100: precedence in or-test compilation of `in`", ->
|
|||
|
||||
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]
|
||||
ok not ('a' in ['b'])
|
||||
|
||||
|
||||
# Chained Comparison
|
||||
|
|
Loading…
Add table
Reference in a new issue