mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
safely preserving the arguments object through generated closure wrappers.
This commit is contained in:
@@ -92,3 +92,10 @@ store: (obj) -> result: obj
|
||||
store (x * 2 for x in [3, 2, 1])
|
||||
|
||||
ok result.join(' ') is '6 4 2'
|
||||
|
||||
|
||||
# Closure-wrapped comprehensions that refer to the "arguments" object.
|
||||
expr: ->
|
||||
result: item * item for item in arguments
|
||||
|
||||
ok expr(2, 4, 8).join(' ') is '4 16 64'
|
||||
|
||||
Reference in New Issue
Block a user