diff --git a/lib/coffee_script/grammar.y b/lib/coffee_script/grammar.y index aa0a7caa..885e7562 100644 --- a/lib/coffee_script/grammar.y +++ b/lib/coffee_script/grammar.y @@ -183,6 +183,7 @@ rule | Expression '&&=' Expression { result = OpNode.new(val[1], val[0], val[2]) } | Expression INSTANCEOF Expression { result = OpNode.new(val[1], val[0], val[2]) } + | Expression IN Expression { result = OpNode.new(val[1], val[0], val[2]) } ; Existence: diff --git a/test/fixtures/execution/test_array_comprehension.coffee b/test/fixtures/execution/test_array_comprehension.coffee index 27d04871..5fdfe1df 100644 --- a/test/fixtures/execution/test_array_comprehension.coffee +++ b/test/fixtures/execution/test_array_comprehension.coffee @@ -19,3 +19,7 @@ evens: for num in [1, 2, 3, 4, 5, 6] when num % 2 is 0 print(evens.join(', ') is '4, 6, 8') +# Make sure that the "in" operator still works. + +print(2 in evens) +