Merge pull request #3491 from forty/master

Add tests to check that the FOR variable is defined after the loop
This commit is contained in:
Jeremy Ashkenas
2014-05-20 17:48:26 -04:00

View File

@@ -33,6 +33,14 @@ test "catch statements should introduce their argument to scope", ->
do -> e = 5
eq 5, e
test "loop variable should be accessible after for-of loop", ->
d = (x for x of {1:'a',2:'b'})
eq x, '2'
test "loop variable should be accessible after for-in loop", ->
d = (x for x in [1,2])
eq x, 2
class Array then slice: fail # needs to be global
class Object then hasOwnProperty: fail
test "#1973: redefining Array/Object constructors shouldn't confuse __X helpers", ->
@@ -113,4 +121,4 @@ test "#3259: leak with @-params within destructured parameters", ->
eq 'undefined', typeof foo
eq 'undefined', typeof bar
eq 'undefined', typeof baz
eq 'undefined', typeof baz