Skip to content

Instantly share code, notes, and snippets.

@mynyml
Created January 22, 2011 21:06
Show Gist options
  • Save mynyml/791477 to your computer and use it in GitHub Desktop.
Save mynyml/791477 to your computer and use it in GitHub Desktop.
execution scope of _ref in array comprehensions is non-intuitive
bar = ->
foo()
foo = ->
v for k,v of arguments.callee.caller.arguments
console.log bar('x','y') #=> ['x','y']
foo = ->
args = (v for k,v of arguments.callee.caller.arguments)
console.log bar('x','y') #=> []
@satyr
Copy link

satyr commented Jan 23, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment