Merging in Stephank's fix for #692.

This commit is contained in:
Jeremy Ashkenas
2010-09-18 10:36:48 -04:00
parent 72d7fe2f7a
commit 4b2d40d3b5
3 changed files with 14 additions and 9 deletions

View File

@@ -126,7 +126,9 @@ ok duration is 0
# Function soaks.
plus1 = (x) -> x + 1
count = 0
obj = {
counter: -> count += 1; this
returnThis: -> this
}
@@ -135,6 +137,8 @@ ok (plus1? 41) is 42
ok plus2?(41) is undefined
ok (plus2? 41) is undefined
ok obj.returnThis?() is obj
ok obj.counter().counter().returnThis?() is obj
ok count is 2
maybe_close = (f, arg) -> if typeof f is 'function' then () -> f(arg) else -1