From a97ea4b6570d24f90ddf3fcaf1116140c3533b4a Mon Sep 17 00:00:00 2001 From: Tingan Ho Date: Wed, 13 May 2015 09:53:34 +0800 Subject: [PATCH] Corrects old tests. --- .../reference/callWithSpread.errors.txt | 59 ----- tests/baselines/reference/callWithSpread.js | 5 - .../reference/callWithSpread.symbols | 159 +++++++++++ .../baselines/reference/callWithSpread.types | 247 ++++++++++++++++++ .../baselines/reference/callWithSpreadES6.js | 5 - .../reference/callWithSpreadES6.symbols | 6 - .../reference/callWithSpreadES6.types | 10 - tests/baselines/reference/newWithSpreadES5.js | 49 ++-- .../functionCalls/callWithSpread.ts | 3 - .../functionCalls/callWithSpreadES6.ts | 3 - 10 files changed, 431 insertions(+), 115 deletions(-) delete mode 100644 tests/baselines/reference/callWithSpread.errors.txt create mode 100644 tests/baselines/reference/callWithSpread.symbols create mode 100644 tests/baselines/reference/callWithSpread.types diff --git a/tests/baselines/reference/callWithSpread.errors.txt b/tests/baselines/reference/callWithSpread.errors.txt deleted file mode 100644 index a28d4c8b1a1..00000000000 --- a/tests/baselines/reference/callWithSpread.errors.txt +++ /dev/null @@ -1,59 +0,0 @@ -tests/cases/conformance/expressions/functionCalls/callWithSpread.ts(52,21): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher. - - -==== tests/cases/conformance/expressions/functionCalls/callWithSpread.ts (1 errors) ==== - interface X { - foo(x: number, y: number, ...z: string[]); - } - - function foo(x: number, y: number, ...z: string[]) { - } - - var a: string[]; - var z: number[]; - var obj: X; - var xa: X[]; - - foo(1, 2, "abc"); - foo(1, 2, ...a); - foo(1, 2, ...a, "abc"); - - obj.foo(1, 2, "abc"); - obj.foo(1, 2, ...a); - obj.foo(1, 2, ...a, "abc"); - - (obj.foo)(1, 2, "abc"); - (obj.foo)(1, 2, ...a); - (obj.foo)(1, 2, ...a, "abc"); - - xa[1].foo(1, 2, "abc"); - xa[1].foo(1, 2, ...a); - xa[1].foo(1, 2, ...a, "abc"); - - (xa[1].foo)(...[1, 2, "abc"]); - - class C { - constructor(x: number, y: number, ...z: string[]) { - this.foo(x, y); - this.foo(x, y, ...z); - } - foo(x: number, y: number, ...z: string[]) { - } - } - - class D extends C { - constructor() { - super(1, 2); - super(1, 2, ...a); - } - foo() { - super.foo(1, 2); - super.foo(1, 2, ...a); - } - } - - // Only supported in when target is ES6 - var c = new C(1, 2, ...a); - ~~~~ -!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 6 and higher. - \ No newline at end of file diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index c9cd5d2adce..d21b4879daa 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -48,9 +48,6 @@ class D extends C { super.foo(1, 2, ...a); } } - -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); //// [callWithSpread.js] @@ -112,6 +109,4 @@ var D = (function (_super) { }; return D; })(C); -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); var _a, _b, _c; diff --git a/tests/baselines/reference/callWithSpread.symbols b/tests/baselines/reference/callWithSpread.symbols new file mode 100644 index 00000000000..c5ac7fe66b2 --- /dev/null +++ b/tests/baselines/reference/callWithSpread.symbols @@ -0,0 +1,159 @@ +=== tests/cases/conformance/expressions/functionCalls/callWithSpread.ts === +interface X { +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) + + foo(x: number, y: number, ...z: string[]); +>foo : Symbol(foo, Decl(callWithSpread.ts, 0, 13)) +>x : Symbol(x, Decl(callWithSpread.ts, 1, 8)) +>y : Symbol(y, Decl(callWithSpread.ts, 1, 18)) +>z : Symbol(z, Decl(callWithSpread.ts, 1, 29)) +} + +function foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) +>x : Symbol(x, Decl(callWithSpread.ts, 4, 13)) +>y : Symbol(y, Decl(callWithSpread.ts, 4, 23)) +>z : Symbol(z, Decl(callWithSpread.ts, 4, 34)) +} + +var a: string[]; +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +var z: number[]; +>z : Symbol(z, Decl(callWithSpread.ts, 8, 3)) + +var obj: X; +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) + +var xa: X[]; +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) +>X : Symbol(X, Decl(callWithSpread.ts, 0, 0)) + +foo(1, 2, "abc"); +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) + +foo(1, 2, ...a); +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +foo(1, 2, ...a, "abc"); +>foo : Symbol(foo, Decl(callWithSpread.ts, 2, 1)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +obj.foo(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) + +obj.foo(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +obj.foo(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +(obj.foo)(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) + +(obj.foo)(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +(obj.foo)(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>obj : Symbol(obj, Decl(callWithSpread.ts, 9, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +xa[1].foo(1, 2, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) + +xa[1].foo(1, 2, ...a); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +xa[1].foo(1, 2, ...a, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + +(xa[1].foo)(...[1, 2, "abc"]); +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>xa[1].foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) +>xa : Symbol(xa, Decl(callWithSpread.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13)) + +class C { +>C : Symbol(C, Decl(callWithSpread.ts, 28, 40)) + + constructor(x: number, y: number, ...z: string[]) { +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) +>z : Symbol(z, Decl(callWithSpread.ts, 31, 37)) + + this.foo(x, y); +>this.foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) +>this : Symbol(C, Decl(callWithSpread.ts, 28, 40)) +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) + + this.foo(x, y, ...z); +>this.foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) +>this : Symbol(C, Decl(callWithSpread.ts, 28, 40)) +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) +>x : Symbol(x, Decl(callWithSpread.ts, 31, 16)) +>y : Symbol(y, Decl(callWithSpread.ts, 31, 26)) +>z : Symbol(z, Decl(callWithSpread.ts, 31, 37)) + } + foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpread.ts, 34, 5)) +>x : Symbol(x, Decl(callWithSpread.ts, 35, 8)) +>y : Symbol(y, Decl(callWithSpread.ts, 35, 18)) +>z : Symbol(z, Decl(callWithSpread.ts, 35, 29)) + } +} + +class D extends C { +>D : Symbol(D, Decl(callWithSpread.ts, 37, 1)) +>C : Symbol(C, Decl(callWithSpread.ts, 28, 40)) + + constructor() { + super(1, 2); +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) + + super(1, 2, ...a); +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + } + foo() { +>foo : Symbol(foo, Decl(callWithSpread.ts, 43, 5)) + + super.foo(1, 2); +>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) +>foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) + + super.foo(1, 2, ...a); +>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) +>super : Symbol(C, Decl(callWithSpread.ts, 28, 40)) +>foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5)) +>a : Symbol(a, Decl(callWithSpread.ts, 7, 3)) + } +} + diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types new file mode 100644 index 00000000000..f7097727204 --- /dev/null +++ b/tests/baselines/reference/callWithSpread.types @@ -0,0 +1,247 @@ +=== tests/cases/conformance/expressions/functionCalls/callWithSpread.ts === +interface X { +>X : X + + foo(x: number, y: number, ...z: string[]); +>foo : (x: number, y: number, ...z: string[]) => any +>x : number +>y : number +>z : string[] +} + +function foo(x: number, y: number, ...z: string[]) { +>foo : (x: number, y: number, ...z: string[]) => void +>x : number +>y : number +>z : string[] +} + +var a: string[]; +>a : string[] + +var z: number[]; +>z : number[] + +var obj: X; +>obj : X +>X : X + +var xa: X[]; +>xa : X[] +>X : X + +foo(1, 2, "abc"); +>foo(1, 2, "abc") : void +>foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>"abc" : string + +foo(1, 2, ...a); +>foo(1, 2, ...a) : void +>foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>...a : string +>a : string[] + +foo(1, 2, ...a, "abc"); +>foo(1, 2, ...a, "abc") : void +>foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>...a : string +>a : string[] +>"abc" : string + +obj.foo(1, 2, "abc"); +>obj.foo(1, 2, "abc") : any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string + +obj.foo(1, 2, ...a); +>obj.foo(1, 2, ...a) : any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] + +obj.foo(1, 2, ...a, "abc"); +>obj.foo(1, 2, ...a, "abc") : any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] +>"abc" : string + +(obj.foo)(1, 2, "abc"); +>(obj.foo)(1, 2, "abc") : any +>(obj.foo) : (x: number, y: number, ...z: string[]) => any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string + +(obj.foo)(1, 2, ...a); +>(obj.foo)(1, 2, ...a) : any +>(obj.foo) : (x: number, y: number, ...z: string[]) => any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] + +(obj.foo)(1, 2, ...a, "abc"); +>(obj.foo)(1, 2, ...a, "abc") : any +>(obj.foo) : (x: number, y: number, ...z: string[]) => any +>obj.foo : (x: number, y: number, ...z: string[]) => any +>obj : X +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] +>"abc" : string + +xa[1].foo(1, 2, "abc"); +>xa[1].foo(1, 2, "abc") : any +>xa[1].foo : (x: number, y: number, ...z: string[]) => any +>xa[1] : X +>xa : X[] +>1 : number +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string + +xa[1].foo(1, 2, ...a); +>xa[1].foo(1, 2, ...a) : any +>xa[1].foo : (x: number, y: number, ...z: string[]) => any +>xa[1] : X +>xa : X[] +>1 : number +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] + +xa[1].foo(1, 2, ...a, "abc"); +>xa[1].foo(1, 2, ...a, "abc") : any +>xa[1].foo : (x: number, y: number, ...z: string[]) => any +>xa[1] : X +>xa : X[] +>1 : number +>foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>...a : string +>a : string[] +>"abc" : string + +(xa[1].foo)(...[1, 2, "abc"]); +>(xa[1].foo)(...[1, 2, "abc"]) : any +>(xa[1].foo) : Function +>xa[1].foo : Function +>Function : Function +>xa[1].foo : (x: number, y: number, ...z: string[]) => any +>xa[1] : X +>xa : X[] +>1 : number +>foo : (x: number, y: number, ...z: string[]) => any +>...[1, 2, "abc"] : string | number +>[1, 2, "abc"] : (string | number)[] +>1 : number +>2 : number +>"abc" : string + +class C { +>C : C + + constructor(x: number, y: number, ...z: string[]) { +>x : number +>y : number +>z : string[] + + this.foo(x, y); +>this.foo(x, y) : void +>this.foo : (x: number, y: number, ...z: string[]) => void +>this : C +>foo : (x: number, y: number, ...z: string[]) => void +>x : number +>y : number + + this.foo(x, y, ...z); +>this.foo(x, y, ...z) : void +>this.foo : (x: number, y: number, ...z: string[]) => void +>this : C +>foo : (x: number, y: number, ...z: string[]) => void +>x : number +>y : number +>...z : string +>z : string[] + } + foo(x: number, y: number, ...z: string[]) { +>foo : (x: number, y: number, ...z: string[]) => void +>x : number +>y : number +>z : string[] + } +} + +class D extends C { +>D : D +>C : C + + constructor() { + super(1, 2); +>super(1, 2) : void +>super : typeof C +>1 : number +>2 : number + + super(1, 2, ...a); +>super(1, 2, ...a) : void +>super : typeof C +>1 : number +>2 : number +>...a : string +>a : string[] + } + foo() { +>foo : () => void + + super.foo(1, 2); +>super.foo(1, 2) : void +>super.foo : (x: number, y: number, ...z: string[]) => void +>super : C +>foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number + + super.foo(1, 2, ...a); +>super.foo(1, 2, ...a) : void +>super.foo : (x: number, y: number, ...z: string[]) => void +>super : C +>foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>...a : string +>a : string[] + } +} + diff --git a/tests/baselines/reference/callWithSpreadES6.js b/tests/baselines/reference/callWithSpreadES6.js index d6a915f5f36..11fa8d6edcd 100644 --- a/tests/baselines/reference/callWithSpreadES6.js +++ b/tests/baselines/reference/callWithSpreadES6.js @@ -49,9 +49,6 @@ class D extends C { super.foo(1, 2, ...a); } } - -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); //// [callWithSpreadES6.js] @@ -92,5 +89,3 @@ class D extends C { super.foo(1, 2, ...a); } } -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); diff --git a/tests/baselines/reference/callWithSpreadES6.symbols b/tests/baselines/reference/callWithSpreadES6.symbols index 94e0b94b002..008488d0ce9 100644 --- a/tests/baselines/reference/callWithSpreadES6.symbols +++ b/tests/baselines/reference/callWithSpreadES6.symbols @@ -158,9 +158,3 @@ class D extends C { } } -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); ->c : Symbol(c, Decl(callWithSpreadES6.ts, 52, 3)) ->C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) ->a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) - diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 71d3cf9b2df..ba638207e8a 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -246,13 +246,3 @@ class D extends C { } } -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); ->c : C ->new C(1, 2, ...a) : C ->C : typeof C ->1 : number ->2 : number ->...a : string ->a : string[] - diff --git a/tests/baselines/reference/newWithSpreadES5.js b/tests/baselines/reference/newWithSpreadES5.js index e463f0aaeea..329861d6742 100644 --- a/tests/baselines/reference/newWithSpreadES5.js +++ b/tests/baselines/reference/newWithSpreadES5.js @@ -116,49 +116,50 @@ var h; var i; // Basic expression new f(1, 2, "string"); -new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"])))); +new (f.bind.apply(f, [void 0].concat([1, 2].concat(a)))); +new (f.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"])))); // Call expression new f(1, 2, "string")(); -new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a))))(); -new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"]))))(); +new (f.bind.apply(f, [void 0].concat([1, 2].concat(a))))()(); +new (f.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"]))))()(); // Property access expression new b.f(1, 2, "string"); -new (Function.bind.apply(b.f, [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(b.f, [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_a = b.f).bind.apply(_a, [void 0].concat([1, 2].concat(a)))); +new ((_b = b.f).bind.apply(_b, [void 0].concat([1, 2].concat(a, ["string"])))); // Parenthesised expression new (b.f)(1, 2, "string"); -new (Function.bind.apply((b.f), [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply((b.f), [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_c = (b.f)).bind.apply(_c, [void 0].concat([1, 2].concat(a)))); +new ((_d = (b.f)).bind.apply(_d, [void 0].concat([1, 2].concat(a, ["string"])))); // Element access expression new d[1].f(1, 2, "string"); -new (Function.bind.apply(d[1].f, [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(d[1].f, [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_e = d[1].f).bind.apply(_e, [void 0].concat([1, 2].concat(a)))); +new ((_f = d[1].f).bind.apply(_f, [void 0].concat([1, 2].concat(a, ["string"])))); // Element access expression with a punctuated key new e["a-b"].f(1, 2, "string"); -new (Function.bind.apply(e["a-b"].f, [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(e["a-b"].f, [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_g = e["a-b"].f).bind.apply(_g, [void 0].concat([1, 2].concat(a)))); +new ((_h = e["a-b"].f).bind.apply(_h, [void 0].concat([1, 2].concat(a, ["string"])))); // Basic expression new B(1, 2, "string"); -new (Function.bind.apply(B, [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(B, [void 0].concat([1, 2].concat(a, ["string"])))); +new (B.bind.apply(B, [void 0].concat([1, 2].concat(a)))); +new (B.bind.apply(B, [void 0].concat([1, 2].concat(a, ["string"])))); // Property access expression new c["a-b"](1, 2, "string"); -new (Function.bind.apply(c["a-b"], [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(c["a-b"], [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_j = c["a-b"]).bind.apply(_j, [void 0].concat([1, 2].concat(a)))); +new ((_k = c["a-b"]).bind.apply(_k, [void 0].concat([1, 2].concat(a, ["string"])))); // Parenthesised expression new (c["a-b"])(1, 2, "string"); -new (Function.bind.apply((c["a-b"]), [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply((c["a-b"]), [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_l = (c["a-b"])).bind.apply(_l, [void 0].concat([1, 2].concat(a)))); +new ((_m = (c["a-b"])).bind.apply(_m, [void 0].concat([1, 2].concat(a, ["string"])))); // Element access expression new g[1]["a-b"](1, 2, "string"); -new (Function.bind.apply(g[1]["a-b"], [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(g[1]["a-b"], [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_o = g[1]["a-b"]).bind.apply(_o, [void 0].concat([1, 2].concat(a)))); +new ((_p = g[1]["a-b"]).bind.apply(_p, [void 0].concat([1, 2].concat(a, ["string"])))); // Element access expression with a punctuated key new h["a-b"]["a-b"](1, 2, "string"); -new (Function.bind.apply(h["a-b"]["a-b"], [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(h["a-b"]["a-b"], [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_q = h["a-b"]["a-b"]).bind.apply(_q, [void 0].concat([1, 2].concat(a)))); +new ((_r = h["a-b"]["a-b"]).bind.apply(_r, [void 0].concat([1, 2].concat(a, ["string"])))); // Element access expression with a number new i["a-b"][1](1, 2, "string"); -new (Function.bind.apply(i["a-b"][1], [void 0].concat([1, 2].concat(a)))); -new (Function.bind.apply(i["a-b"][1], [void 0].concat([1, 2].concat(a, ["string"])))); +new ((_s = i["a-b"][1]).bind.apply(_s, [void 0].concat([1, 2].concat(a)))); +new ((_t = i["a-b"][1]).bind.apply(_t, [void 0].concat([1, 2].concat(a, ["string"])))); +var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; diff --git a/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts b/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts index 9acba00697a..245028db3d4 100644 --- a/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts +++ b/tests/cases/conformance/expressions/functionCalls/callWithSpread.ts @@ -47,6 +47,3 @@ class D extends C { super.foo(1, 2, ...a); } } - -// Only supported in when target is ES6 -var c = new C(1, 2, ...a); diff --git a/tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts b/tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts index 2f7d16ba368..accb6df135d 100644 --- a/tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts +++ b/tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts @@ -49,6 +49,3 @@ class D extends C { super.foo(1, 2, ...a); } } - -// Only supported in when target is ES6 -var c = new C(1, 2, ...a);