mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
added children macro to Node, using it so that all nodes now have a 'children' method -- used for safe references to 'this' within closure wrappers
This commit is contained in:
20
test/fixtures/execution/test_functions.coffee
vendored
20
test/fixtures/execution/test_functions.coffee
vendored
@@ -19,4 +19,22 @@ obj: {
|
||||
}
|
||||
|
||||
obj.unbound()
|
||||
obj.bound()
|
||||
obj.bound()
|
||||
|
||||
|
||||
# When when a closure wrapper is generated for expression conversion, make sure
|
||||
# that references to "this" within the wrapper are safely converted as well.
|
||||
|
||||
obj: {
|
||||
num: 5
|
||||
func: =>
|
||||
this.result: if false
|
||||
10
|
||||
else
|
||||
"a"
|
||||
"b"
|
||||
this.num
|
||||
}
|
||||
|
||||
print(obj.num is obj.func())
|
||||
print(obj.num is obj.result)
|
||||
Reference in New Issue
Block a user