mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
This commit is contained in:
@@ -487,16 +487,22 @@ test "implicit call against control structures", ->
|
||||
eq result, 'caught2'
|
||||
|
||||
|
||||
test "#1420: things like `(fn() ->)`; there are no words for this one",
|
||||
test "#1420: things like `(fn() ->)`; there are no words for this one", ->
|
||||
fn = -> (f) -> f()
|
||||
nonce = {}
|
||||
eq nonce, (fn() -> nonce)
|
||||
|
||||
test "#1416: don't omit one 'new' when compiling 'new new'", ->
|
||||
obj = new new Function "this.foo = 3"
|
||||
eq obj.foo, 3
|
||||
nonce = {}
|
||||
obj = new new -> -> {prop: nonce}
|
||||
eq obj.prop, nonce
|
||||
|
||||
test "#1416: don't omit one 'new' when compiling 'new new fn()()'", ->
|
||||
fn = -> -> @a = 2
|
||||
{a} = new new fn()()
|
||||
eq a, 2
|
||||
nonce = {}
|
||||
argNonceA = {}
|
||||
argNonceB = {}
|
||||
fn = (a) -> (b) -> {a, b, prop: nonce}
|
||||
obj = new new fn(argNonceA)(argNonceB)
|
||||
eq obj.prop, nonce
|
||||
eq obj.a, argNonceA
|
||||
eq obj.b, argNonceB
|
||||
|
||||
Reference in New Issue
Block a user