Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e0d625

Browse files
committed
test for jashkenas#1464 ... bound class methods now keep context
1 parent 638dbbe commit 0e0d625

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/classes.coffee

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,13 @@ test "#1380: `super` with reserved names", ->
490490
class B
491491
0: -> super
492492
ok B::[0]
493+
494+
test "#1464: bound class methods should keep context", ->
495+
nonce = {}
496+
nonce2 = {}
497+
class C
498+
constructor: (@id) ->
499+
@boundStaticColon: => new this(nonce)
500+
@boundStaticEqual= => new this(nonce2)
501+
eq nonce, C.boundStaticColon().id
502+
eq nonce2, C.boundStaticEqual().id

0 commit comments

Comments
 (0)