mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
fixing closurenode wrapping of bodies with bound function declarations inside -- this doesn't have to be mentioned explicitly.
This commit is contained in:
@@ -1381,8 +1381,11 @@ ClosureNode: exports.ClosureNode: {
|
||||
return expressions if expressions.containsPureStatement()
|
||||
func: new ParentheticalNode(new CodeNode([], Expressions.wrap([expressions])))
|
||||
args: []
|
||||
mentionsArgs: expressions.contains (n) -> (n instanceof LiteralNode) and (n.value is 'arguments')
|
||||
mentionsThis: expressions.contains (n) -> (n instanceof LiteralNode) and (n.value is 'this')
|
||||
mentionsArgs: expressions.contains (n) ->
|
||||
n instanceof LiteralNode and (n.value is 'arguments')
|
||||
mentionsThis: expressions.contains (n) ->
|
||||
(n instanceof LiteralNode and (n.value is 'this')) or
|
||||
(n instanceof CodeNode and n.bound)
|
||||
if mentionsArgs or mentionsThis
|
||||
meth: literal(if mentionsArgs then 'apply' else 'call')
|
||||
args: [literal('this')]
|
||||
|
||||
Reference in New Issue
Block a user