jashkenas--coffeescript/test/fixtures/execution/test_functions.coffee

22 lines
259 B
CoffeeScript
Raw Normal View History

2010-01-14 01:59:57 +00:00
x: 1
y: {}
y.x: => 3
print(x is 1)
print(typeof(y.x) is 'function')
print(y.x() is 3)
print(y.x.name is 'x')
obj: {
name: "Fred"
bound: =>
(==> print(this.name is "Fred"))()
unbound: =>
(=> print(!this.name?))()
}
obj.unbound()
obj.bound()