mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 17:30:04 -05:00
Merge branch 'master' into common_source_directory
This commit is contained in:
8
tests/baselines/reference/alwaysStrictModule3.js
Normal file
8
tests/baselines/reference/alwaysStrictModule3.js
Normal file
@@ -0,0 +1,8 @@
|
||||
//// [alwaysStrictModule3.ts]
|
||||
|
||||
// module ES2015
|
||||
export const a = 1;
|
||||
|
||||
//// [alwaysStrictModule3.js]
|
||||
// module ES2015
|
||||
export var a = 1;
|
||||
6
tests/baselines/reference/alwaysStrictModule3.symbols
Normal file
6
tests/baselines/reference/alwaysStrictModule3.symbols
Normal file
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule3.ts ===
|
||||
|
||||
// module ES2015
|
||||
export const a = 1;
|
||||
>a : Symbol(a, Decl(alwaysStrictModule3.ts, 2, 12))
|
||||
|
||||
7
tests/baselines/reference/alwaysStrictModule3.types
Normal file
7
tests/baselines/reference/alwaysStrictModule3.types
Normal file
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule3.ts ===
|
||||
|
||||
// module ES2015
|
||||
export const a = 1;
|
||||
>a : 1
|
||||
>1 : 1
|
||||
|
||||
9
tests/baselines/reference/alwaysStrictModule4.js
Normal file
9
tests/baselines/reference/alwaysStrictModule4.js
Normal file
@@ -0,0 +1,9 @@
|
||||
//// [alwaysStrictModule4.ts]
|
||||
|
||||
// Module commonjs
|
||||
export const a = 1
|
||||
|
||||
//// [alwaysStrictModule4.js]
|
||||
"use strict";
|
||||
// Module commonjs
|
||||
exports.a = 1;
|
||||
6
tests/baselines/reference/alwaysStrictModule4.symbols
Normal file
6
tests/baselines/reference/alwaysStrictModule4.symbols
Normal file
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule4.ts ===
|
||||
|
||||
// Module commonjs
|
||||
export const a = 1
|
||||
>a : Symbol(a, Decl(alwaysStrictModule4.ts, 2, 12))
|
||||
|
||||
7
tests/baselines/reference/alwaysStrictModule4.types
Normal file
7
tests/baselines/reference/alwaysStrictModule4.types
Normal file
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule4.ts ===
|
||||
|
||||
// Module commonjs
|
||||
export const a = 1
|
||||
>a : 1
|
||||
>1 : 1
|
||||
|
||||
8
tests/baselines/reference/alwaysStrictModule5.js
Normal file
8
tests/baselines/reference/alwaysStrictModule5.js
Normal file
@@ -0,0 +1,8 @@
|
||||
//// [alwaysStrictModule5.ts]
|
||||
|
||||
// Targeting ES6
|
||||
export const a = 1;
|
||||
|
||||
//// [alwaysStrictModule5.js]
|
||||
// Targeting ES6
|
||||
export const a = 1;
|
||||
6
tests/baselines/reference/alwaysStrictModule5.symbols
Normal file
6
tests/baselines/reference/alwaysStrictModule5.symbols
Normal file
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule5.ts ===
|
||||
|
||||
// Targeting ES6
|
||||
export const a = 1;
|
||||
>a : Symbol(a, Decl(alwaysStrictModule5.ts, 2, 12))
|
||||
|
||||
7
tests/baselines/reference/alwaysStrictModule5.types
Normal file
7
tests/baselines/reference/alwaysStrictModule5.types
Normal file
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule5.ts ===
|
||||
|
||||
// Targeting ES6
|
||||
export const a = 1;
|
||||
>a : 1
|
||||
>1 : 1
|
||||
|
||||
9
tests/baselines/reference/alwaysStrictModule6.js
Normal file
9
tests/baselines/reference/alwaysStrictModule6.js
Normal file
@@ -0,0 +1,9 @@
|
||||
//// [alwaysStrictModule6.ts]
|
||||
|
||||
// Targeting ES5
|
||||
export const a = 1;
|
||||
|
||||
//// [alwaysStrictModule6.js]
|
||||
"use strict";
|
||||
// Targeting ES5
|
||||
exports.a = 1;
|
||||
6
tests/baselines/reference/alwaysStrictModule6.symbols
Normal file
6
tests/baselines/reference/alwaysStrictModule6.symbols
Normal file
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule6.ts ===
|
||||
|
||||
// Targeting ES5
|
||||
export const a = 1;
|
||||
>a : Symbol(a, Decl(alwaysStrictModule6.ts, 2, 12))
|
||||
|
||||
7
tests/baselines/reference/alwaysStrictModule6.types
Normal file
7
tests/baselines/reference/alwaysStrictModule6.types
Normal file
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/compiler/alwaysStrictModule6.ts ===
|
||||
|
||||
// Targeting ES5
|
||||
export const a = 1;
|
||||
>a : 1
|
||||
>1 : 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//// [callWithSpread.ts]
|
||||
interface X {
|
||||
foo(x: number, y: number, ...z: string[]);
|
||||
foo(x: number, y: number, ...z: string[]): X;
|
||||
}
|
||||
|
||||
function foo(x: number, y: number, ...z: string[]) {
|
||||
@@ -19,10 +19,18 @@ obj.foo(1, 2, "abc");
|
||||
obj.foo(1, 2, ...a);
|
||||
obj.foo(1, 2, ...a, "abc");
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, "abc");
|
||||
obj.foo(1, 2, ...a).foo(1, 2, ...a);
|
||||
obj.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, ...a).foo)(1, 2, "abc");
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
|
||||
|
||||
xa[1].foo(1, 2, "abc");
|
||||
xa[1].foo(1, 2, ...a);
|
||||
xa[1].foo(1, 2, ...a, "abc");
|
||||
@@ -72,13 +80,19 @@ foo.apply(void 0, [1, 2].concat(a, ["abc"]));
|
||||
obj.foo(1, 2, "abc");
|
||||
obj.foo.apply(obj, [1, 2].concat(a));
|
||||
obj.foo.apply(obj, [1, 2].concat(a, ["abc"]));
|
||||
obj.foo.apply(obj, [1, 2].concat(a)).foo(1, 2, "abc");
|
||||
(_a = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_a, [1, 2].concat(a));
|
||||
(_b = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_b, [1, 2].concat(a, ["abc"]));
|
||||
(obj.foo)(1, 2, "abc");
|
||||
obj.foo.apply(obj, [1, 2].concat(a));
|
||||
obj.foo.apply(obj, [1, 2].concat(a, ["abc"]));
|
||||
(obj.foo.apply(obj, [1, 2].concat(a)).foo)(1, 2, "abc");
|
||||
(_c = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_c, [1, 2].concat(a));
|
||||
(_d = obj.foo.apply(obj, [1, 2].concat(a))).foo.apply(_d, [1, 2].concat(a, ["abc"]));
|
||||
xa[1].foo(1, 2, "abc");
|
||||
(_a = xa[1]).foo.apply(_a, [1, 2].concat(a));
|
||||
(_b = xa[1]).foo.apply(_b, [1, 2].concat(a, ["abc"]));
|
||||
(_c = xa[1]).foo.apply(_c, [1, 2, "abc"]);
|
||||
(_e = xa[1]).foo.apply(_e, [1, 2].concat(a));
|
||||
(_f = xa[1]).foo.apply(_f, [1, 2].concat(a, ["abc"]));
|
||||
(_g = xa[1]).foo.apply(_g, [1, 2, "abc"]);
|
||||
var C = (function () {
|
||||
function C(x, y) {
|
||||
var z = [];
|
||||
@@ -109,4 +123,4 @@ var D = (function (_super) {
|
||||
};
|
||||
return D;
|
||||
}(C));
|
||||
var _a, _b, _c;
|
||||
var _a, _b, _c, _d, _e, _f, _g;
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
interface X {
|
||||
>X : Symbol(X, Decl(callWithSpread.ts, 0, 0))
|
||||
|
||||
foo(x: number, y: number, ...z: string[]);
|
||||
foo(x: number, y: number, ...z: string[]): X;
|
||||
>foo : Symbol(X.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))
|
||||
>X : Symbol(X, Decl(callWithSpread.ts, 0, 0))
|
||||
}
|
||||
|
||||
function foo(x: number, y: number, ...z: string[]) {
|
||||
@@ -58,6 +59,32 @@ obj.foo(1, 2, ...a, "abc");
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, "abc");
|
||||
>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, ...a);
|
||||
>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
|
||||
>obj.foo(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>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))
|
||||
@@ -75,6 +102,32 @@ obj.foo(1, 2, ...a, "abc");
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
|
||||
>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
|
||||
>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
|
||||
>(obj.foo)(1, 2, ...a).foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
>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))
|
||||
>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))
|
||||
@@ -99,60 +152,60 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>foo : Symbol(X.foo, Decl(callWithSpread.ts, 0, 13))
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>C : Symbol(C, Decl(callWithSpread.ts, 36, 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))
|
||||
>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
|
||||
>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
|
||||
>z : Symbol(z, Decl(callWithSpread.ts, 39, 37))
|
||||
|
||||
this.foo(x, y);
|
||||
>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
|
||||
>this : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
|
||||
>x : Symbol(x, Decl(callWithSpread.ts, 31, 16))
|
||||
>y : Symbol(y, Decl(callWithSpread.ts, 31, 26))
|
||||
>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>this : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
|
||||
>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
|
||||
|
||||
this.foo(x, y, ...z);
|
||||
>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 34, 5))
|
||||
>this : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>foo : Symbol(C.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))
|
||||
>this.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>this : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>x : Symbol(x, Decl(callWithSpread.ts, 39, 16))
|
||||
>y : Symbol(y, Decl(callWithSpread.ts, 39, 26))
|
||||
>z : Symbol(z, Decl(callWithSpread.ts, 39, 37))
|
||||
}
|
||||
foo(x: number, y: number, ...z: string[]) {
|
||||
>foo : Symbol(C.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))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>x : Symbol(x, Decl(callWithSpread.ts, 43, 8))
|
||||
>y : Symbol(y, Decl(callWithSpread.ts, 43, 18))
|
||||
>z : Symbol(z, Decl(callWithSpread.ts, 43, 29))
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
>D : Symbol(D, Decl(callWithSpread.ts, 37, 1))
|
||||
>C : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>D : Symbol(D, Decl(callWithSpread.ts, 45, 1))
|
||||
>C : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
|
||||
constructor() {
|
||||
super(1, 2);
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
|
||||
super(1, 2, ...a);
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 28, 40))
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
}
|
||||
foo() {
|
||||
>foo : Symbol(D.foo, Decl(callWithSpread.ts, 43, 5))
|
||||
>foo : Symbol(D.foo, Decl(callWithSpread.ts, 51, 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 : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 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))
|
||||
>super.foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>super : Symbol(C, Decl(callWithSpread.ts, 36, 40))
|
||||
>foo : Symbol(C.foo, Decl(callWithSpread.ts, 42, 5))
|
||||
>a : Symbol(a, Decl(callWithSpread.ts, 7, 3))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
interface X {
|
||||
>X : X
|
||||
|
||||
foo(x: number, y: number, ...z: string[]);
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
foo(x: number, y: number, ...z: string[]): X;
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
>X : X
|
||||
}
|
||||
|
||||
function foo(x: number, y: number, ...z: string[]) {
|
||||
@@ -55,29 +56,80 @@ foo(1, 2, ...a, "abc");
|
||||
>"abc" : "abc"
|
||||
|
||||
obj.foo(1, 2, "abc");
|
||||
>obj.foo(1, 2, "abc") : any
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => any
|
||||
>obj.foo(1, 2, "abc") : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>"abc" : "abc"
|
||||
|
||||
obj.foo(1, 2, ...a);
|
||||
>obj.foo(1, 2, ...a) : any
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => any
|
||||
>obj.foo(1, 2, ...a) : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...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(1, 2, ...a, "abc") : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"abc" : "abc"
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, "abc");
|
||||
>obj.foo(1, 2, ...a).foo(1, 2, "abc") : X
|
||||
>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo(1, 2, ...a) : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>"abc" : "abc"
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, ...a);
|
||||
>obj.foo(1, 2, ...a).foo(1, 2, ...a) : X
|
||||
>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo(1, 2, ...a) : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc");
|
||||
>obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc") : X
|
||||
>obj.foo(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo(1, 2, ...a) : X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
@@ -85,32 +137,89 @@ obj.foo(1, 2, ...a, "abc");
|
||||
>"abc" : "abc"
|
||||
|
||||
(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.foo)(1, 2, "abc") : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>"abc" : "abc"
|
||||
|
||||
(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.foo)(1, 2, ...a) : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...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.foo)(1, 2, ...a, "abc") : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"abc" : "abc"
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, "abc");
|
||||
>((obj.foo)(1, 2, ...a).foo)(1, 2, "abc") : X
|
||||
>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a) : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>"abc" : "abc"
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a);
|
||||
>((obj.foo)(1, 2, ...a).foo)(1, 2, ...a) : X
|
||||
>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a) : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc");
|
||||
>((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc") : X
|
||||
>((obj.foo)(1, 2, ...a).foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a).foo : (x: number, y: number, ...z: string[]) => X
|
||||
>(obj.foo)(1, 2, ...a) : X
|
||||
>(obj.foo) : (x: number, y: number, ...z: string[]) => X
|
||||
>obj.foo : (x: number, y: number, ...z: string[]) => X
|
||||
>obj : X
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
@@ -118,35 +227,35 @@ obj.foo(1, 2, ...a, "abc");
|
||||
>"abc" : "abc"
|
||||
|
||||
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].foo(1, 2, "abc") : X
|
||||
>xa[1].foo : (x: number, y: number, ...z: string[]) => X
|
||||
>xa[1] : X
|
||||
>xa : X[]
|
||||
>1 : 1
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>"abc" : "abc"
|
||||
|
||||
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].foo(1, 2, ...a) : X
|
||||
>xa[1].foo : (x: number, y: number, ...z: string[]) => X
|
||||
>xa[1] : X
|
||||
>xa : X[]
|
||||
>1 : 1
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...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].foo(1, 2, ...a, "abc") : X
|
||||
>xa[1].foo : (x: number, y: number, ...z: string[]) => X
|
||||
>xa[1] : X
|
||||
>xa : X[]
|
||||
>1 : 1
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>...a : string
|
||||
@@ -158,11 +267,11 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>(<Function>xa[1].foo) : Function
|
||||
><Function>xa[1].foo : Function
|
||||
>Function : Function
|
||||
>xa[1].foo : (x: number, y: number, ...z: string[]) => any
|
||||
>xa[1].foo : (x: number, y: number, ...z: string[]) => X
|
||||
>xa[1] : X
|
||||
>xa : X[]
|
||||
>1 : 1
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>foo : (x: number, y: number, ...z: string[]) => X
|
||||
>...[1, 2, "abc"] : string | number
|
||||
>[1, 2, "abc"] : (string | number)[]
|
||||
>1 : 1
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
EmitSkipped: true
|
||||
Diagnostics:
|
||||
Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file.
|
||||
Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
EmitSkipped: false
|
||||
FileName : /tests/cases/fourslash/a.js
|
||||
|
||||
@@ -12,4 +12,4 @@ exports.y = function (x) { return 1; };
|
||||
//// [declarationEmitTypeAliasWithTypeParameters1.d.ts]
|
||||
export declare type Bar<X, Y> = () => [X, Y];
|
||||
export declare type Foo<Y> = Bar<any, Y>;
|
||||
export declare const y: (x: () => [any, string]) => number;
|
||||
export declare const y: (x: Bar<any, string>) => number;
|
||||
|
||||
@@ -8,15 +8,15 @@ export type Bar<X, Y> = () => [X, Y];
|
||||
>Y : Y
|
||||
|
||||
export type Foo<Y> = Bar<any, Y>;
|
||||
>Foo : () => [any, Y]
|
||||
>Foo : Bar<any, Y>
|
||||
>Y : Y
|
||||
>Bar : Bar<X, Y>
|
||||
>Y : Y
|
||||
|
||||
export const y = (x: Foo<string>) => 1
|
||||
>y : (x: () => [any, string]) => number
|
||||
>(x: Foo<string>) => 1 : (x: () => [any, string]) => number
|
||||
>x : () => [any, string]
|
||||
>Foo : () => [any, Y]
|
||||
>y : (x: Bar<any, string>) => number
|
||||
>(x: Foo<string>) => 1 : (x: Bar<any, string>) => number
|
||||
>x : Bar<any, string>
|
||||
>Foo : Bar<any, Y>
|
||||
>1 : 1
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters2.ts]
|
||||
|
||||
export type Bar<X, Y, Z> = () => [X, Y, Z];
|
||||
export type Baz<M, N> = Bar<M, string, N>;
|
||||
export type Baa<Y> = Baz<boolean, Y>;
|
||||
export const y = (x: Baa<number>) => 1
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters2.js]
|
||||
"use strict";
|
||||
exports.y = function (x) { return 1; };
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters2.d.ts]
|
||||
export declare type Bar<X, Y, Z> = () => [X, Y, Z];
|
||||
export declare type Baz<M, N> = Bar<M, string, N>;
|
||||
export declare type Baa<Y> = Baz<boolean, Y>;
|
||||
export declare const y: (x: Bar<boolean, string, number>) => number;
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters2.ts ===
|
||||
|
||||
export type Bar<X, Y, Z> = () => [X, Y, Z];
|
||||
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 0, 0))
|
||||
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 16))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 18))
|
||||
>Z : Symbol(Z, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 21))
|
||||
>X : Symbol(X, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 16))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 18))
|
||||
>Z : Symbol(Z, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 21))
|
||||
|
||||
export type Baz<M, N> = Bar<M, string, N>;
|
||||
>Baz : Symbol(Baz, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 43))
|
||||
>M : Symbol(M, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 16))
|
||||
>N : Symbol(N, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 18))
|
||||
>Bar : Symbol(Bar, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 0, 0))
|
||||
>M : Symbol(M, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 16))
|
||||
>N : Symbol(N, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 18))
|
||||
|
||||
export type Baa<Y> = Baz<boolean, Y>;
|
||||
>Baa : Symbol(Baa, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 42))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 3, 16))
|
||||
>Baz : Symbol(Baz, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 1, 43))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 3, 16))
|
||||
|
||||
export const y = (x: Baa<number>) => 1
|
||||
>y : Symbol(y, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 4, 12))
|
||||
>x : Symbol(x, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 4, 18))
|
||||
>Baa : Symbol(Baa, Decl(declarationEmitTypeAliasWithTypeParameters2.ts, 2, 42))
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters2.ts ===
|
||||
|
||||
export type Bar<X, Y, Z> = () => [X, Y, Z];
|
||||
>Bar : Bar<X, Y, Z>
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
>X : X
|
||||
>Y : Y
|
||||
>Z : Z
|
||||
|
||||
export type Baz<M, N> = Bar<M, string, N>;
|
||||
>Baz : Bar<M, string, N>
|
||||
>M : M
|
||||
>N : N
|
||||
>Bar : Bar<X, Y, Z>
|
||||
>M : M
|
||||
>N : N
|
||||
|
||||
export type Baa<Y> = Baz<boolean, Y>;
|
||||
>Baa : Bar<boolean, string, Y>
|
||||
>Y : Y
|
||||
>Baz : Bar<M, string, N>
|
||||
>Y : Y
|
||||
|
||||
export const y = (x: Baa<number>) => 1
|
||||
>y : (x: Bar<boolean, string, number>) => number
|
||||
>(x: Baa<number>) => 1 : (x: Bar<boolean, string, number>) => number
|
||||
>x : Bar<boolean, string, number>
|
||||
>Baa : Bar<boolean, string, Y>
|
||||
>1 : 1
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters3.ts]
|
||||
|
||||
type Foo<T> = {
|
||||
foo<U>(): Foo<U>
|
||||
};
|
||||
function bar() {
|
||||
return {} as Foo<number>;
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters3.js]
|
||||
function bar() {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters3.d.ts]
|
||||
declare type Foo<T> = {
|
||||
foo<U>(): Foo<U>;
|
||||
};
|
||||
declare function bar(): Foo<number>;
|
||||
@@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters3.ts ===
|
||||
|
||||
type Foo<T> = {
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 1, 9))
|
||||
|
||||
foo<U>(): Foo<U>
|
||||
>foo : Symbol(foo, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 1, 15))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 2, 8))
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 2, 8))
|
||||
|
||||
};
|
||||
function bar() {
|
||||
>bar : Symbol(bar, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 3, 2))
|
||||
|
||||
return {} as Foo<number>;
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters3.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters3.ts ===
|
||||
|
||||
type Foo<T> = {
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
|
||||
foo<U>(): Foo<U>
|
||||
>foo : <U>() => Foo<U>
|
||||
>U : U
|
||||
>Foo : Foo<T>
|
||||
>U : U
|
||||
|
||||
};
|
||||
function bar() {
|
||||
>bar : () => Foo<number>
|
||||
|
||||
return {} as Foo<number>;
|
||||
>{} as Foo<number> : Foo<number>
|
||||
>{} : {}
|
||||
>Foo : Foo<T>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters4.ts]
|
||||
|
||||
type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>
|
||||
};
|
||||
type SubFoo<R> = Foo<string, R>;
|
||||
|
||||
function foo() {
|
||||
return {} as SubFoo<number>;
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters4.js]
|
||||
function foo() {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters4.d.ts]
|
||||
declare type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>;
|
||||
};
|
||||
declare type SubFoo<R> = Foo<string, R>;
|
||||
declare function foo(): Foo<string, number>;
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters4.ts ===
|
||||
|
||||
type Foo<T, Y> = {
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 1, 9))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 1, 11))
|
||||
|
||||
foo<U, J>(): Foo<U, J>
|
||||
>foo : Symbol(foo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 1, 18))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 2, 8))
|
||||
>J : Symbol(J, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 2, 10))
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 2, 8))
|
||||
>J : Symbol(J, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 2, 10))
|
||||
|
||||
};
|
||||
type SubFoo<R> = Foo<string, R>;
|
||||
>SubFoo : Symbol(SubFoo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 3, 2))
|
||||
>R : Symbol(R, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 4, 12))
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 0, 0))
|
||||
>R : Symbol(R, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 4, 12))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 4, 32))
|
||||
|
||||
return {} as SubFoo<number>;
|
||||
>SubFoo : Symbol(SubFoo, Decl(declarationEmitTypeAliasWithTypeParameters4.ts, 3, 2))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters4.ts ===
|
||||
|
||||
type Foo<T, Y> = {
|
||||
>Foo : Foo<T, Y>
|
||||
>T : T
|
||||
>Y : Y
|
||||
|
||||
foo<U, J>(): Foo<U, J>
|
||||
>foo : <U, J>() => Foo<U, J>
|
||||
>U : U
|
||||
>J : J
|
||||
>Foo : Foo<T, Y>
|
||||
>U : U
|
||||
>J : J
|
||||
|
||||
};
|
||||
type SubFoo<R> = Foo<string, R>;
|
||||
>SubFoo : Foo<string, R>
|
||||
>R : R
|
||||
>Foo : Foo<T, Y>
|
||||
>R : R
|
||||
|
||||
function foo() {
|
||||
>foo : () => Foo<string, number>
|
||||
|
||||
return {} as SubFoo<number>;
|
||||
>{} as SubFoo<number> : Foo<string, number>
|
||||
>{} : {}
|
||||
>SubFoo : Foo<string, R>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters5.ts(5,25): error TS4081: Exported type alias 'SubFoo' has or is using private name 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters5.ts (1 errors) ====
|
||||
|
||||
type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>
|
||||
};
|
||||
export type SubFoo<R> = Foo<string, R>;
|
||||
~~~
|
||||
!!! error TS4081: Exported type alias 'SubFoo' has or is using private name 'Foo'.
|
||||
|
||||
function foo() {
|
||||
return {} as SubFoo<number>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters5.ts]
|
||||
|
||||
type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>
|
||||
};
|
||||
export type SubFoo<R> = Foo<string, R>;
|
||||
|
||||
function foo() {
|
||||
return {} as SubFoo<number>;
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters5.js]
|
||||
"use strict";
|
||||
function foo() {
|
||||
return {};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//// [declarationEmitTypeAliasWithTypeParameters6.ts]
|
||||
|
||||
type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>
|
||||
};
|
||||
type SubFoo<R, S> = Foo<S, R>;
|
||||
|
||||
function foo() {
|
||||
return {} as SubFoo<number, string>;
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters6.js]
|
||||
function foo() {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitTypeAliasWithTypeParameters6.d.ts]
|
||||
declare type Foo<T, Y> = {
|
||||
foo<U, J>(): Foo<U, J>;
|
||||
};
|
||||
declare type SubFoo<R, S> = Foo<S, R>;
|
||||
declare function foo(): Foo<string, number>;
|
||||
@@ -0,0 +1,31 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters6.ts ===
|
||||
|
||||
type Foo<T, Y> = {
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 1, 9))
|
||||
>Y : Symbol(Y, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 1, 11))
|
||||
|
||||
foo<U, J>(): Foo<U, J>
|
||||
>foo : Symbol(foo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 1, 18))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 2, 8))
|
||||
>J : Symbol(J, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 2, 10))
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 0, 0))
|
||||
>U : Symbol(U, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 2, 8))
|
||||
>J : Symbol(J, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 2, 10))
|
||||
|
||||
};
|
||||
type SubFoo<R, S> = Foo<S, R>;
|
||||
>SubFoo : Symbol(SubFoo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 3, 2))
|
||||
>R : Symbol(R, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 4, 12))
|
||||
>S : Symbol(S, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 4, 14))
|
||||
>Foo : Symbol(Foo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 0, 0))
|
||||
>S : Symbol(S, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 4, 14))
|
||||
>R : Symbol(R, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 4, 12))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 4, 30))
|
||||
|
||||
return {} as SubFoo<number, string>;
|
||||
>SubFoo : Symbol(SubFoo, Decl(declarationEmitTypeAliasWithTypeParameters6.ts, 3, 2))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/declarationEmitTypeAliasWithTypeParameters6.ts ===
|
||||
|
||||
type Foo<T, Y> = {
|
||||
>Foo : Foo<T, Y>
|
||||
>T : T
|
||||
>Y : Y
|
||||
|
||||
foo<U, J>(): Foo<U, J>
|
||||
>foo : <U, J>() => Foo<U, J>
|
||||
>U : U
|
||||
>J : J
|
||||
>Foo : Foo<T, Y>
|
||||
>U : U
|
||||
>J : J
|
||||
|
||||
};
|
||||
type SubFoo<R, S> = Foo<S, R>;
|
||||
>SubFoo : Foo<S, R>
|
||||
>R : R
|
||||
>S : S
|
||||
>Foo : Foo<T, Y>
|
||||
>S : S
|
||||
>R : R
|
||||
|
||||
function foo() {
|
||||
>foo : () => Foo<string, number>
|
||||
|
||||
return {} as SubFoo<number, string>;
|
||||
>{} as SubFoo<number, string> : Foo<string, number>
|
||||
>{} : {}
|
||||
>SubFoo : Foo<S, R>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.d.ts (0 errors) ====
|
||||
|
||||
declare class c {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/out.d.ts (0 errors) ====
|
||||
|
||||
declare class c {
|
||||
|
||||
13
tests/baselines/reference/decoratorInJsFile.errors.txt
Normal file
13
tests/baselines/reference/decoratorInJsFile.errors.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
tests/cases/compiler/a.js(4,12): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
|
||||
@SomeDecorator
|
||||
class SomeClass {
|
||||
foo(x: number) {
|
||||
~~~~~~
|
||||
!!! error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
}
|
||||
}
|
||||
16
tests/baselines/reference/decoratorInJsFile1.errors.txt
Normal file
16
tests/baselines/reference/decoratorInJsFile1.errors.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
tests/cases/compiler/a.js(3,7): error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
|
||||
tests/cases/compiler/a.js(4,12): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (2 errors) ====
|
||||
|
||||
@SomeDecorator
|
||||
class SomeClass {
|
||||
~~~~~~~~~
|
||||
!!! error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.
|
||||
foo(x: number) {
|
||||
~~~~~~
|
||||
!!! error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,12 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(4,6): error TS2459: Type 'string | number | {}' has no property 'i1' and no string index signature.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(5,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(5,21): error TS2353: Object literal may only specify known properties, and 'f212' does not exist in type '{ f21: any; }'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(6,7): error TS1180: Property destructuring pattern expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(7,5): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ d1: any; }'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(7,11): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ d1: any; }'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(7,24): error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ d1: any; }'.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(9,7): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(9,15): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(10,12): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(6,7): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(6,15): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts(7,12): error TS1005: ':' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts (13 errors) ====
|
||||
==== tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts (9 errors) ====
|
||||
// Error
|
||||
var {h?} = { h?: 1 };
|
||||
~
|
||||
@@ -33,17 +29,6 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs
|
||||
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
|
||||
~~~~
|
||||
!!! error TS2353: Object literal may only specify known properties, and 'f212' does not exist in type '{ f21: any; }'.
|
||||
var { ...d1 } = {
|
||||
~~~
|
||||
!!! error TS1180: Property destructuring pattern expected.
|
||||
a: 1, b: 1, d1: 9, e: 10
|
||||
~
|
||||
!!! error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ d1: any; }'.
|
||||
~
|
||||
!!! error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ d1: any; }'.
|
||||
~
|
||||
!!! error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ d1: any; }'.
|
||||
}
|
||||
var {1} = { 1 };
|
||||
~
|
||||
!!! error TS1005: ':' expected.
|
||||
@@ -51,4 +36,5 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs
|
||||
!!! error TS1005: ':' expected.
|
||||
var {"prop"} = { "prop": 1 };
|
||||
~
|
||||
!!! error TS1005: ':' expected.
|
||||
!!! error TS1005: ':' expected.
|
||||
|
||||
@@ -4,11 +4,9 @@ var {h?} = { h?: 1 };
|
||||
var {i}: string | number = { i: 2 };
|
||||
var {i1}: string | number| {} = { i1: 2 };
|
||||
var { f2: {f21} = { f212: "string" } }: any = undefined;
|
||||
var { ...d1 } = {
|
||||
a: 1, b: 1, d1: 9, e: 10
|
||||
}
|
||||
var {1} = { 1 };
|
||||
var {"prop"} = { "prop": 1 };
|
||||
var {"prop"} = { "prop": 1 };
|
||||
|
||||
|
||||
//// [destructuringObjectBindingPatternAndAssignment3.js]
|
||||
// Error
|
||||
@@ -16,8 +14,5 @@ var h = { h: 1 }.h;
|
||||
var i = { i: 2 }.i;
|
||||
var i1 = { i1: 2 }.i1;
|
||||
var _a = undefined.f2, f21 = (_a === void 0 ? { f212: "string" } : _a).f21;
|
||||
var d1 = {
|
||||
a: 1, b: 1, d1: 9, e: 10
|
||||
}.d1;
|
||||
var = { 1: }[1];
|
||||
var = { "prop": 1 }["prop"];
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/conformance/salsa/myFile01.js (0 errors) ====
|
||||
|
||||
export default "hello";
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/conformance/salsa/myFile02.js (0 errors) ====
|
||||
|
||||
export default "hello";
|
||||
@@ -0,0 +1,10 @@
|
||||
//// [a.ts]
|
||||
|
||||
export { };
|
||||
|
||||
declare global {
|
||||
var x: number;
|
||||
}
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/externalModules/a.ts ===
|
||||
|
||||
export { };
|
||||
|
||||
declare global {
|
||||
>global : Symbol(global, Decl(a.ts, 1, 11))
|
||||
|
||||
var x: number;
|
||||
>x : Symbol(x, Decl(a.ts, 4, 5))
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/externalModules/a.ts ===
|
||||
|
||||
export { };
|
||||
|
||||
declare global {
|
||||
>global : any
|
||||
|
||||
var x: number;
|
||||
>x : number
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
error TS2305: Module 'tslib' has no exported member '__assign'.
|
||||
error TS2305: Module 'tslib' has no exported member '__decorate'.
|
||||
error TS2305: Module 'tslib' has no exported member '__extends'.
|
||||
error TS2305: Module 'tslib' has no exported member '__metadata'.
|
||||
error TS2305: Module 'tslib' has no exported member '__param'.
|
||||
error TS2305: Module 'tslib' has no exported member '__rest'.
|
||||
|
||||
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__assign'.
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__decorate'.
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__extends'.
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__metadata'.
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__param'.
|
||||
!!! error TS2305: Module 'tslib' has no exported member '__rest'.
|
||||
==== tests/cases/compiler/external.ts (0 errors) ====
|
||||
export class A { }
|
||||
export class B extends A { }
|
||||
@@ -20,6 +24,10 @@ error TS2305: Module 'tslib' has no exported member '__param'.
|
||||
}
|
||||
}
|
||||
|
||||
const o = { a: 1 };
|
||||
const y = { ...o };
|
||||
const { ...x } = y;
|
||||
|
||||
==== tests/cases/compiler/script.ts (0 errors) ====
|
||||
class A { }
|
||||
class B extends A { }
|
||||
@@ -33,4 +41,5 @@ error TS2305: Module 'tslib' has no exported member '__param'.
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/tslib.d.ts (0 errors) ====
|
||||
export {}
|
||||
export {}
|
||||
|
||||
@@ -11,6 +11,10 @@ class C {
|
||||
method(@dec x: number) {
|
||||
}
|
||||
}
|
||||
|
||||
const o = { a: 1 };
|
||||
const y = { ...o };
|
||||
const { ...x } = y;
|
||||
|
||||
//// [script.ts]
|
||||
class A { }
|
||||
@@ -25,7 +29,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [tslib.d.ts]
|
||||
export {}
|
||||
export {}
|
||||
|
||||
|
||||
//// [external.js]
|
||||
"use strict";
|
||||
@@ -61,6 +66,9 @@ C = tslib_1.__decorate([
|
||||
dec,
|
||||
tslib_1.__metadata("design:paramtypes", [])
|
||||
], C);
|
||||
var o = { a: 1 };
|
||||
var y = __assign({}, o);
|
||||
var x = __rest(y, []);
|
||||
//// [script.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
|
||||
|
||||
==== tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts (1 errors) ====
|
||||
interface T { }
|
||||
declare const a: T;
|
||||
class Foo<T> {
|
||||
x: T;
|
||||
fn() {
|
||||
this.x = a;
|
||||
~~~~~~
|
||||
!!! error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//// [incompatibleAssignmentOfIdenticallyNamedTypes.ts]
|
||||
interface T { }
|
||||
declare const a: T;
|
||||
class Foo<T> {
|
||||
x: T;
|
||||
fn() {
|
||||
this.x = a;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [incompatibleAssignmentOfIdenticallyNamedTypes.js]
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
Foo.prototype.fn = function () {
|
||||
this.x = a;
|
||||
};
|
||||
return Foo;
|
||||
}());
|
||||
36
tests/baselines/reference/instantiatedTypeAliasDisplay.js
Normal file
36
tests/baselines/reference/instantiatedTypeAliasDisplay.js
Normal file
@@ -0,0 +1,36 @@
|
||||
//// [instantiatedTypeAliasDisplay.ts]
|
||||
|
||||
// Repros from #12066
|
||||
|
||||
interface X<A> {
|
||||
a: A;
|
||||
}
|
||||
interface Y<B> {
|
||||
b: B;
|
||||
}
|
||||
type Z<A, B> = X<A> | Y<B>;
|
||||
|
||||
declare function f1<A>(): Z<A, number>;
|
||||
declare function f2<A, B, C, D, E>(a: A, b: B, c: C, d: D): Z<A, string[]>;
|
||||
|
||||
const x1 = f1<string>(); // Z<string, number>
|
||||
const x2 = f2({}, {}, {}, {}); // Z<{}, string[]>
|
||||
|
||||
//// [instantiatedTypeAliasDisplay.js]
|
||||
// Repros from #12066
|
||||
var x1 = f1(); // Z<string, number>
|
||||
var x2 = f2({}, {}, {}, {}); // Z<{}, string[]>
|
||||
|
||||
|
||||
//// [instantiatedTypeAliasDisplay.d.ts]
|
||||
interface X<A> {
|
||||
a: A;
|
||||
}
|
||||
interface Y<B> {
|
||||
b: B;
|
||||
}
|
||||
declare type Z<A, B> = X<A> | Y<B>;
|
||||
declare function f1<A>(): Z<A, number>;
|
||||
declare function f2<A, B, C, D, E>(a: A, b: B, c: C, d: D): Z<A, string[]>;
|
||||
declare const x1: Z<string, number>;
|
||||
declare const x2: Z<{}, string[]>;
|
||||
@@ -0,0 +1,61 @@
|
||||
=== tests/cases/compiler/instantiatedTypeAliasDisplay.ts ===
|
||||
|
||||
// Repros from #12066
|
||||
|
||||
interface X<A> {
|
||||
>X : Symbol(X, Decl(instantiatedTypeAliasDisplay.ts, 0, 0))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 3, 12))
|
||||
|
||||
a: A;
|
||||
>a : Symbol(X.a, Decl(instantiatedTypeAliasDisplay.ts, 3, 16))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 3, 12))
|
||||
}
|
||||
interface Y<B> {
|
||||
>Y : Symbol(Y, Decl(instantiatedTypeAliasDisplay.ts, 5, 1))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 6, 12))
|
||||
|
||||
b: B;
|
||||
>b : Symbol(Y.b, Decl(instantiatedTypeAliasDisplay.ts, 6, 16))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 6, 12))
|
||||
}
|
||||
type Z<A, B> = X<A> | Y<B>;
|
||||
>Z : Symbol(Z, Decl(instantiatedTypeAliasDisplay.ts, 8, 1))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 9, 7))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 9, 9))
|
||||
>X : Symbol(X, Decl(instantiatedTypeAliasDisplay.ts, 0, 0))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 9, 7))
|
||||
>Y : Symbol(Y, Decl(instantiatedTypeAliasDisplay.ts, 5, 1))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 9, 9))
|
||||
|
||||
declare function f1<A>(): Z<A, number>;
|
||||
>f1 : Symbol(f1, Decl(instantiatedTypeAliasDisplay.ts, 9, 27))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 11, 20))
|
||||
>Z : Symbol(Z, Decl(instantiatedTypeAliasDisplay.ts, 8, 1))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 11, 20))
|
||||
|
||||
declare function f2<A, B, C, D, E>(a: A, b: B, c: C, d: D): Z<A, string[]>;
|
||||
>f2 : Symbol(f2, Decl(instantiatedTypeAliasDisplay.ts, 11, 39))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 12, 20))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 12, 22))
|
||||
>C : Symbol(C, Decl(instantiatedTypeAliasDisplay.ts, 12, 25))
|
||||
>D : Symbol(D, Decl(instantiatedTypeAliasDisplay.ts, 12, 28))
|
||||
>E : Symbol(E, Decl(instantiatedTypeAliasDisplay.ts, 12, 31))
|
||||
>a : Symbol(a, Decl(instantiatedTypeAliasDisplay.ts, 12, 35))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 12, 20))
|
||||
>b : Symbol(b, Decl(instantiatedTypeAliasDisplay.ts, 12, 40))
|
||||
>B : Symbol(B, Decl(instantiatedTypeAliasDisplay.ts, 12, 22))
|
||||
>c : Symbol(c, Decl(instantiatedTypeAliasDisplay.ts, 12, 46))
|
||||
>C : Symbol(C, Decl(instantiatedTypeAliasDisplay.ts, 12, 25))
|
||||
>d : Symbol(d, Decl(instantiatedTypeAliasDisplay.ts, 12, 52))
|
||||
>D : Symbol(D, Decl(instantiatedTypeAliasDisplay.ts, 12, 28))
|
||||
>Z : Symbol(Z, Decl(instantiatedTypeAliasDisplay.ts, 8, 1))
|
||||
>A : Symbol(A, Decl(instantiatedTypeAliasDisplay.ts, 12, 20))
|
||||
|
||||
const x1 = f1<string>(); // Z<string, number>
|
||||
>x1 : Symbol(x1, Decl(instantiatedTypeAliasDisplay.ts, 14, 5))
|
||||
>f1 : Symbol(f1, Decl(instantiatedTypeAliasDisplay.ts, 9, 27))
|
||||
|
||||
const x2 = f2({}, {}, {}, {}); // Z<{}, string[]>
|
||||
>x2 : Symbol(x2, Decl(instantiatedTypeAliasDisplay.ts, 15, 5))
|
||||
>f2 : Symbol(f2, Decl(instantiatedTypeAliasDisplay.ts, 11, 39))
|
||||
|
||||
67
tests/baselines/reference/instantiatedTypeAliasDisplay.types
Normal file
67
tests/baselines/reference/instantiatedTypeAliasDisplay.types
Normal file
@@ -0,0 +1,67 @@
|
||||
=== tests/cases/compiler/instantiatedTypeAliasDisplay.ts ===
|
||||
|
||||
// Repros from #12066
|
||||
|
||||
interface X<A> {
|
||||
>X : X<A>
|
||||
>A : A
|
||||
|
||||
a: A;
|
||||
>a : A
|
||||
>A : A
|
||||
}
|
||||
interface Y<B> {
|
||||
>Y : Y<B>
|
||||
>B : B
|
||||
|
||||
b: B;
|
||||
>b : B
|
||||
>B : B
|
||||
}
|
||||
type Z<A, B> = X<A> | Y<B>;
|
||||
>Z : Z<A, B>
|
||||
>A : A
|
||||
>B : B
|
||||
>X : X<A>
|
||||
>A : A
|
||||
>Y : Y<B>
|
||||
>B : B
|
||||
|
||||
declare function f1<A>(): Z<A, number>;
|
||||
>f1 : <A>() => Z<A, number>
|
||||
>A : A
|
||||
>Z : Z<A, B>
|
||||
>A : A
|
||||
|
||||
declare function f2<A, B, C, D, E>(a: A, b: B, c: C, d: D): Z<A, string[]>;
|
||||
>f2 : <A, B, C, D, E>(a: A, b: B, c: C, d: D) => Z<A, string[]>
|
||||
>A : A
|
||||
>B : B
|
||||
>C : C
|
||||
>D : D
|
||||
>E : E
|
||||
>a : A
|
||||
>A : A
|
||||
>b : B
|
||||
>B : B
|
||||
>c : C
|
||||
>C : C
|
||||
>d : D
|
||||
>D : D
|
||||
>Z : Z<A, B>
|
||||
>A : A
|
||||
|
||||
const x1 = f1<string>(); // Z<string, number>
|
||||
>x1 : Z<string, number>
|
||||
>f1<string>() : Z<string, number>
|
||||
>f1 : <A>() => Z<A, number>
|
||||
|
||||
const x2 = f2({}, {}, {}, {}); // Z<{}, string[]>
|
||||
>x2 : Z<{}, string[]>
|
||||
>f2({}, {}, {}, {}) : Z<{}, string[]>
|
||||
>f2 : <A, B, C, D, E>(a: A, b: B, c: C, d: D) => Z<A, string[]>
|
||||
>{} : {}
|
||||
>{} : {}
|
||||
>{} : {}
|
||||
>{} : {}
|
||||
|
||||
21
tests/baselines/reference/interfaceSpread.errors.txt
Normal file
21
tests/baselines/reference/interfaceSpread.errors.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
tests/cases/conformance/types/spread/interfaceSpread.ts(2,5): error TS2698: Interface declaration cannot contain a spread property.
|
||||
tests/cases/conformance/types/spread/interfaceSpread.ts(7,10): error TS2339: Property 'jam' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'.
|
||||
tests/cases/conformance/types/spread/interfaceSpread.ts(8,10): error TS2339: Property 'peanutButter' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/spread/interfaceSpread.ts (3 errors) ====
|
||||
interface Congealed<T, U> {
|
||||
...T
|
||||
~~~~
|
||||
!!! error TS2698: Interface declaration cannot contain a spread property.
|
||||
...U
|
||||
}
|
||||
|
||||
let sandwich: Congealed<{jam: number }, { peanutButter: number }>;
|
||||
sandwich.jam;
|
||||
~~~
|
||||
!!! error TS2339: Property 'jam' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'.
|
||||
sandwich.peanutButter;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'peanutButter' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'.
|
||||
|
||||
15
tests/baselines/reference/interfaceSpread.js
Normal file
15
tests/baselines/reference/interfaceSpread.js
Normal file
@@ -0,0 +1,15 @@
|
||||
//// [interfaceSpread.ts]
|
||||
interface Congealed<T, U> {
|
||||
...T
|
||||
...U
|
||||
}
|
||||
|
||||
let sandwich: Congealed<{jam: number }, { peanutButter: number }>;
|
||||
sandwich.jam;
|
||||
sandwich.peanutButter;
|
||||
|
||||
|
||||
//// [interfaceSpread.js]
|
||||
var sandwich;
|
||||
sandwich.jam;
|
||||
sandwich.peanutButter;
|
||||
@@ -0,0 +1,16 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,1): error TS8009: 'abstract' can only be used in a .ts file.
|
||||
tests/cases/compiler/a.js(2,5): error TS8009: 'abstract' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (2 errors) ====
|
||||
abstract class c {
|
||||
~~~~~~~~
|
||||
!!! error TS8009: 'abstract' can only be used in a .ts file.
|
||||
abstract x;
|
||||
~~~~~~~~
|
||||
!!! error TS8009: 'abstract' can only be used in a .ts file.
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
declare var v;
|
||||
~~~~~~~
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
const c = 10;
|
||||
>c : Symbol(c, Decl(a.js, 0, 5))
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
=== tests/cases/compiler/a.js ===
|
||||
const c = 10;
|
||||
>c : 10
|
||||
>10 : 10
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
enum E { }
|
||||
~
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
export = b;
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C implements D { }
|
||||
~~~~~~~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
import a = b;
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
interface I { }
|
||||
~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
module M { }
|
||||
~
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(p?) { }
|
||||
~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C {
|
||||
public foo() {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C { constructor(public x) { }}
|
||||
~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(): number { }
|
||||
~~~~~~
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (0 errors) ====
|
||||
/**
|
||||
* @type {number}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,6): error TS8008: 'type aliases' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
type a = b;
|
||||
~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
Foo<number>();
|
||||
~~~~~~
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,10): error TS17008: JSX element 'string' has no corresponding closing tag.
|
||||
tests/cases/compiler/a.js(1,27): error TS1005: '</' expected.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (2 errors) ====
|
||||
var v = <string>undefined;
|
||||
~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F(a: number) { }
|
||||
~~~~~~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
class C<T> { }
|
||||
~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
function F<T>() { }
|
||||
~
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
var v: () => number;
|
||||
~~~~~~~~~~~~
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
|
||||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
class c {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
error TS5053: Option 'reactNamespace' cannot be specified with option 'jsxFactory'.
|
||||
|
||||
|
||||
!!! error TS5053: Option 'reactNamespace' cannot be specified with option 'jsxFactory'.
|
||||
==== tests/cases/compiler/Element.ts (0 errors) ====
|
||||
|
||||
declare namespace JSX {
|
||||
interface Element {
|
||||
name: string;
|
||||
isIntrinsic: boolean;
|
||||
isCustomElement: boolean;
|
||||
toString(renderId?: number): string;
|
||||
bindDOM(renderId?: number): number;
|
||||
resetComponent(): void;
|
||||
instantiateComponents(renderId?: number): number;
|
||||
props: any;
|
||||
}
|
||||
}
|
||||
export namespace Element {
|
||||
export function isElement(el: any): el is JSX.Element {
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
}
|
||||
|
||||
export function createElement(args: any[]) {
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let createElement = Element.createElement;
|
||||
|
||||
function toCamelCase(text: string): string {
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/test.tsx (0 errors) ====
|
||||
import { Element} from './Element';
|
||||
|
||||
let c: {
|
||||
a?: {
|
||||
b: string
|
||||
}
|
||||
};
|
||||
|
||||
class A {
|
||||
view() {
|
||||
return [
|
||||
<meta content="helloworld"></meta>,
|
||||
<meta content={c.a!.b}></meta>
|
||||
];
|
||||
}
|
||||
}
|
||||
81
tests/baselines/reference/jsxFactoryAndReactNamespace.js
Normal file
81
tests/baselines/reference/jsxFactoryAndReactNamespace.js
Normal file
@@ -0,0 +1,81 @@
|
||||
//// [tests/cases/compiler/jsxFactoryAndReactNamespace.ts] ////
|
||||
|
||||
//// [Element.ts]
|
||||
|
||||
declare namespace JSX {
|
||||
interface Element {
|
||||
name: string;
|
||||
isIntrinsic: boolean;
|
||||
isCustomElement: boolean;
|
||||
toString(renderId?: number): string;
|
||||
bindDOM(renderId?: number): number;
|
||||
resetComponent(): void;
|
||||
instantiateComponents(renderId?: number): number;
|
||||
props: any;
|
||||
}
|
||||
}
|
||||
export namespace Element {
|
||||
export function isElement(el: any): el is JSX.Element {
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
}
|
||||
|
||||
export function createElement(args: any[]) {
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let createElement = Element.createElement;
|
||||
|
||||
function toCamelCase(text: string): string {
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
}
|
||||
|
||||
//// [test.tsx]
|
||||
import { Element} from './Element';
|
||||
|
||||
let c: {
|
||||
a?: {
|
||||
b: string
|
||||
}
|
||||
};
|
||||
|
||||
class A {
|
||||
view() {
|
||||
return [
|
||||
<meta content="helloworld"></meta>,
|
||||
<meta content={c.a!.b}></meta>
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
//// [Element.js]
|
||||
"use strict";
|
||||
var Element;
|
||||
(function (Element) {
|
||||
function isElement(el) {
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
}
|
||||
Element.isElement = isElement;
|
||||
function createElement(args) {
|
||||
return {};
|
||||
}
|
||||
Element.createElement = createElement;
|
||||
})(Element = exports.Element || (exports.Element = {}));
|
||||
exports.createElement = Element.createElement;
|
||||
function toCamelCase(text) {
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
}
|
||||
//// [test.js]
|
||||
"use strict";
|
||||
const Element_1 = require("./Element");
|
||||
let c;
|
||||
class A {
|
||||
view() {
|
||||
return [
|
||||
Element_1.Element.createElement("meta", { content: "helloworld" }),
|
||||
Element_1.Element.createElement("meta", { content: c.a.b })
|
||||
];
|
||||
}
|
||||
}
|
||||
83
tests/baselines/reference/jsxFactoryIdentifier.js
Normal file
83
tests/baselines/reference/jsxFactoryIdentifier.js
Normal file
@@ -0,0 +1,83 @@
|
||||
//// [tests/cases/compiler/jsxFactoryIdentifier.ts] ////
|
||||
|
||||
//// [Element.ts]
|
||||
|
||||
declare namespace JSX {
|
||||
interface Element {
|
||||
name: string;
|
||||
isIntrinsic: boolean;
|
||||
isCustomElement: boolean;
|
||||
toString(renderId?: number): string;
|
||||
bindDOM(renderId?: number): number;
|
||||
resetComponent(): void;
|
||||
instantiateComponents(renderId?: number): number;
|
||||
props: any;
|
||||
}
|
||||
}
|
||||
export namespace Element {
|
||||
export function isElement(el: any): el is JSX.Element {
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
}
|
||||
|
||||
export function createElement(args: any[]) {
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let createElement = Element.createElement;
|
||||
|
||||
function toCamelCase(text: string): string {
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
}
|
||||
|
||||
//// [test.tsx]
|
||||
import { Element} from './Element';
|
||||
let createElement = Element.createElement;
|
||||
let c: {
|
||||
a?: {
|
||||
b: string
|
||||
}
|
||||
};
|
||||
|
||||
class A {
|
||||
view() {
|
||||
return [
|
||||
<meta content="helloworld"></meta>,
|
||||
<meta content={c.a!.b}></meta>
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
//// [Element.js]
|
||||
"use strict";
|
||||
var Element;
|
||||
(function (Element) {
|
||||
function isElement(el) {
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
}
|
||||
Element.isElement = isElement;
|
||||
function createElement(args) {
|
||||
return {};
|
||||
}
|
||||
Element.createElement = createElement;
|
||||
})(Element = exports.Element || (exports.Element = {}));
|
||||
exports.createElement = Element.createElement;
|
||||
function toCamelCase(text) {
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
}
|
||||
//# sourceMappingURL=Element.js.map//// [test.js]
|
||||
"use strict";
|
||||
const Element_1 = require("./Element");
|
||||
let createElement = Element_1.Element.createElement;
|
||||
let c;
|
||||
class A {
|
||||
view() {
|
||||
return [
|
||||
createElement("meta", { content: "helloworld" }),
|
||||
createElement("meta", { content: c.a.b })
|
||||
];
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=test.js.map
|
||||
3
tests/baselines/reference/jsxFactoryIdentifier.js.map
Normal file
3
tests/baselines/reference/jsxFactoryIdentifier.js.map
Normal file
@@ -0,0 +1,3 @@
|
||||
//// [Element.js.map]
|
||||
{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";AAaA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,MAAM,CAAC,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map]
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,MAAM,CAAC;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"}
|
||||
520
tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt
Normal file
520
tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt
Normal file
@@ -0,0 +1,520 @@
|
||||
===================================================================
|
||||
JsFile: Element.js
|
||||
mapUrl: Element.js.map
|
||||
sourceRoot:
|
||||
sources: Element.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/Element.js
|
||||
sourceFile:Element.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>"use strict";
|
||||
>>>var Element;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
>declare namespace JSX {
|
||||
> interface Element {
|
||||
> name: string;
|
||||
> isIntrinsic: boolean;
|
||||
> isCustomElement: boolean;
|
||||
> toString(renderId?: number): string;
|
||||
> bindDOM(renderId?: number): number;
|
||||
> resetComponent(): void;
|
||||
> instantiateComponents(renderId?: number): number;
|
||||
> props: any;
|
||||
> }
|
||||
>}
|
||||
>
|
||||
2 >export namespace
|
||||
3 > Element
|
||||
4 > {
|
||||
> export function isElement(el: any): el is JSX.Element {
|
||||
> return el.markAsChildOfRootElement !== undefined;
|
||||
> }
|
||||
>
|
||||
> export function createElement(args: any[]) {
|
||||
>
|
||||
> return {
|
||||
> }
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0)
|
||||
2 >Emitted(2, 5) Source(14, 18) + SourceIndex(0)
|
||||
3 >Emitted(2, 12) Source(14, 25) + SourceIndex(0)
|
||||
4 >Emitted(2, 13) Source(24, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>(function (Element) {
|
||||
1->
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^^^^^^^^^^^->
|
||||
1->
|
||||
2 >export namespace
|
||||
3 > Element
|
||||
1->Emitted(3, 1) Source(14, 1) + SourceIndex(0)
|
||||
2 >Emitted(3, 12) Source(14, 18) + SourceIndex(0)
|
||||
3 >Emitted(3, 19) Source(14, 25) + SourceIndex(0)
|
||||
---
|
||||
>>> function isElement(el) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1-> {
|
||||
>
|
||||
2 > export function isElement(
|
||||
3 > el: any
|
||||
1->Emitted(4, 5) Source(15, 5) + SourceIndex(0)
|
||||
2 >Emitted(4, 24) Source(15, 31) + SourceIndex(0)
|
||||
3 >Emitted(4, 26) Source(15, 38) + SourceIndex(0)
|
||||
---
|
||||
>>> return el.markAsChildOfRootElement !== undefined;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^^^^^^^
|
||||
9 > ^
|
||||
1->): el is JSX.Element {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > el
|
||||
5 > .
|
||||
6 > markAsChildOfRootElement
|
||||
7 > !==
|
||||
8 > undefined
|
||||
9 > ;
|
||||
1->Emitted(5, 9) Source(16, 9) + SourceIndex(0)
|
||||
2 >Emitted(5, 15) Source(16, 15) + SourceIndex(0)
|
||||
3 >Emitted(5, 16) Source(16, 16) + SourceIndex(0)
|
||||
4 >Emitted(5, 18) Source(16, 18) + SourceIndex(0)
|
||||
5 >Emitted(5, 19) Source(16, 19) + SourceIndex(0)
|
||||
6 >Emitted(5, 43) Source(16, 43) + SourceIndex(0)
|
||||
7 >Emitted(5, 48) Source(16, 48) + SourceIndex(0)
|
||||
8 >Emitted(5, 57) Source(16, 57) + SourceIndex(0)
|
||||
9 >Emitted(5, 58) Source(16, 58) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(6, 5) Source(17, 5) + SourceIndex(0)
|
||||
2 >Emitted(6, 6) Source(17, 6) + SourceIndex(0)
|
||||
---
|
||||
>>> Element.isElement = isElement;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^->
|
||||
1->
|
||||
2 > isElement
|
||||
3 > (el: any): el is JSX.Element {
|
||||
> return el.markAsChildOfRootElement !== undefined;
|
||||
> }
|
||||
4 >
|
||||
1->Emitted(7, 5) Source(15, 21) + SourceIndex(0)
|
||||
2 >Emitted(7, 22) Source(15, 30) + SourceIndex(0)
|
||||
3 >Emitted(7, 34) Source(17, 6) + SourceIndex(0)
|
||||
4 >Emitted(7, 35) Source(17, 6) + SourceIndex(0)
|
||||
---
|
||||
>>> function createElement(args) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^
|
||||
1->
|
||||
>
|
||||
>
|
||||
2 > export function createElement(
|
||||
3 > args: any[]
|
||||
1->Emitted(8, 5) Source(19, 5) + SourceIndex(0)
|
||||
2 >Emitted(8, 28) Source(19, 35) + SourceIndex(0)
|
||||
3 >Emitted(8, 32) Source(19, 46) + SourceIndex(0)
|
||||
---
|
||||
>>> return {};
|
||||
1 >^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1 >) {
|
||||
>
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > {
|
||||
> }
|
||||
5 >
|
||||
1 >Emitted(9, 9) Source(21, 9) + SourceIndex(0)
|
||||
2 >Emitted(9, 15) Source(21, 15) + SourceIndex(0)
|
||||
3 >Emitted(9, 16) Source(21, 16) + SourceIndex(0)
|
||||
4 >Emitted(9, 18) Source(22, 10) + SourceIndex(0)
|
||||
5 >Emitted(9, 19) Source(22, 10) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(10, 5) Source(23, 5) + SourceIndex(0)
|
||||
2 >Emitted(10, 6) Source(23, 6) + SourceIndex(0)
|
||||
---
|
||||
>>> Element.createElement = createElement;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
2 > createElement
|
||||
3 > (args: any[]) {
|
||||
>
|
||||
> return {
|
||||
> }
|
||||
> }
|
||||
4 >
|
||||
1->Emitted(11, 5) Source(19, 21) + SourceIndex(0)
|
||||
2 >Emitted(11, 26) Source(19, 34) + SourceIndex(0)
|
||||
3 >Emitted(11, 42) Source(23, 6) + SourceIndex(0)
|
||||
4 >Emitted(11, 43) Source(23, 6) + SourceIndex(0)
|
||||
---
|
||||
>>>})(Element = exports.Element || (exports.Element = {}));
|
||||
1->
|
||||
2 >^
|
||||
3 > ^^
|
||||
4 > ^^^^^^^
|
||||
5 > ^^^
|
||||
6 > ^^^^^^^^^^^^^^^
|
||||
7 > ^^^^^
|
||||
8 > ^^^^^^^^^^^^^^^
|
||||
9 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 >}
|
||||
3 >
|
||||
4 > Element
|
||||
5 >
|
||||
6 > Element
|
||||
7 >
|
||||
8 > Element
|
||||
9 > {
|
||||
> export function isElement(el: any): el is JSX.Element {
|
||||
> return el.markAsChildOfRootElement !== undefined;
|
||||
> }
|
||||
>
|
||||
> export function createElement(args: any[]) {
|
||||
>
|
||||
> return {
|
||||
> }
|
||||
> }
|
||||
> }
|
||||
1->Emitted(12, 1) Source(24, 1) + SourceIndex(0)
|
||||
2 >Emitted(12, 2) Source(24, 2) + SourceIndex(0)
|
||||
3 >Emitted(12, 4) Source(14, 18) + SourceIndex(0)
|
||||
4 >Emitted(12, 11) Source(14, 25) + SourceIndex(0)
|
||||
5 >Emitted(12, 14) Source(14, 18) + SourceIndex(0)
|
||||
6 >Emitted(12, 29) Source(14, 25) + SourceIndex(0)
|
||||
7 >Emitted(12, 34) Source(14, 18) + SourceIndex(0)
|
||||
8 >Emitted(12, 49) Source(14, 25) + SourceIndex(0)
|
||||
9 >Emitted(12, 57) Source(24, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>exports.createElement = Element.createElement;
|
||||
1 >
|
||||
2 >^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^
|
||||
8 > ^
|
||||
1 >
|
||||
>
|
||||
>export let
|
||||
2 >
|
||||
3 > createElement
|
||||
4 > =
|
||||
5 > Element
|
||||
6 > .
|
||||
7 > createElement
|
||||
8 > ;
|
||||
1 >Emitted(13, 1) Source(26, 12) + SourceIndex(0)
|
||||
2 >Emitted(13, 9) Source(26, 12) + SourceIndex(0)
|
||||
3 >Emitted(13, 22) Source(26, 25) + SourceIndex(0)
|
||||
4 >Emitted(13, 25) Source(26, 28) + SourceIndex(0)
|
||||
5 >Emitted(13, 32) Source(26, 35) + SourceIndex(0)
|
||||
6 >Emitted(13, 33) Source(26, 36) + SourceIndex(0)
|
||||
7 >Emitted(13, 46) Source(26, 49) + SourceIndex(0)
|
||||
8 >Emitted(13, 47) Source(26, 50) + SourceIndex(0)
|
||||
---
|
||||
>>>function toCamelCase(text) {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
>
|
||||
2 >function toCamelCase(
|
||||
3 > text: string
|
||||
1 >Emitted(14, 1) Source(28, 1) + SourceIndex(0)
|
||||
2 >Emitted(14, 22) Source(28, 22) + SourceIndex(0)
|
||||
3 >Emitted(14, 26) Source(28, 34) + SourceIndex(0)
|
||||
---
|
||||
>>> return text[0].toLowerCase() + text.substring(1);
|
||||
1->^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^
|
||||
5 > ^
|
||||
6 > ^
|
||||
7 > ^
|
||||
8 > ^
|
||||
9 > ^^^^^^^^^^^
|
||||
10> ^^
|
||||
11> ^^^
|
||||
12> ^^^^
|
||||
13> ^
|
||||
14> ^^^^^^^^^
|
||||
15> ^
|
||||
16> ^
|
||||
17> ^
|
||||
18> ^
|
||||
1->): string {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > text
|
||||
5 > [
|
||||
6 > 0
|
||||
7 > ]
|
||||
8 > .
|
||||
9 > toLowerCase
|
||||
10> ()
|
||||
11> +
|
||||
12> text
|
||||
13> .
|
||||
14> substring
|
||||
15> (
|
||||
16> 1
|
||||
17> )
|
||||
18> ;
|
||||
1->Emitted(15, 5) Source(29, 5) + SourceIndex(0)
|
||||
2 >Emitted(15, 11) Source(29, 11) + SourceIndex(0)
|
||||
3 >Emitted(15, 12) Source(29, 12) + SourceIndex(0)
|
||||
4 >Emitted(15, 16) Source(29, 16) + SourceIndex(0)
|
||||
5 >Emitted(15, 17) Source(29, 17) + SourceIndex(0)
|
||||
6 >Emitted(15, 18) Source(29, 18) + SourceIndex(0)
|
||||
7 >Emitted(15, 19) Source(29, 19) + SourceIndex(0)
|
||||
8 >Emitted(15, 20) Source(29, 20) + SourceIndex(0)
|
||||
9 >Emitted(15, 31) Source(29, 31) + SourceIndex(0)
|
||||
10>Emitted(15, 33) Source(29, 33) + SourceIndex(0)
|
||||
11>Emitted(15, 36) Source(29, 36) + SourceIndex(0)
|
||||
12>Emitted(15, 40) Source(29, 40) + SourceIndex(0)
|
||||
13>Emitted(15, 41) Source(29, 41) + SourceIndex(0)
|
||||
14>Emitted(15, 50) Source(29, 50) + SourceIndex(0)
|
||||
15>Emitted(15, 51) Source(29, 51) + SourceIndex(0)
|
||||
16>Emitted(15, 52) Source(29, 52) + SourceIndex(0)
|
||||
17>Emitted(15, 53) Source(29, 53) + SourceIndex(0)
|
||||
18>Emitted(15, 54) Source(29, 54) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
1 >Emitted(16, 1) Source(30, 1) + SourceIndex(0)
|
||||
2 >Emitted(16, 2) Source(30, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=Element.js.map===================================================================
|
||||
JsFile: test.js
|
||||
mapUrl: test.js.map
|
||||
sourceRoot:
|
||||
sources: test.tsx
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/test.js
|
||||
sourceFile:test.tsx
|
||||
-------------------------------------------------------------------
|
||||
>>>"use strict";
|
||||
>>>const Element_1 = require("./Element");
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >import { Element} from './Element';
|
||||
1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(2, 40) Source(1, 36) + SourceIndex(0)
|
||||
---
|
||||
>>>let createElement = Element_1.Element.createElement;
|
||||
1->
|
||||
2 >^^^^
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^
|
||||
6 > ^
|
||||
7 > ^^^^^^^^^^^^^
|
||||
8 > ^
|
||||
1->
|
||||
>
|
||||
2 >let
|
||||
3 > createElement
|
||||
4 > =
|
||||
5 > Element
|
||||
6 > .
|
||||
7 > createElement
|
||||
8 > ;
|
||||
1->Emitted(3, 1) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(3, 5) Source(2, 5) + SourceIndex(0)
|
||||
3 >Emitted(3, 18) Source(2, 18) + SourceIndex(0)
|
||||
4 >Emitted(3, 21) Source(2, 21) + SourceIndex(0)
|
||||
5 >Emitted(3, 38) Source(2, 28) + SourceIndex(0)
|
||||
6 >Emitted(3, 39) Source(2, 29) + SourceIndex(0)
|
||||
7 >Emitted(3, 52) Source(2, 42) + SourceIndex(0)
|
||||
8 >Emitted(3, 53) Source(2, 43) + SourceIndex(0)
|
||||
---
|
||||
>>>let c;
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >let
|
||||
3 > c: {
|
||||
> a?: {
|
||||
> b: string
|
||||
> }
|
||||
> }
|
||||
4 > ;
|
||||
1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0)
|
||||
2 >Emitted(4, 5) Source(3, 5) + SourceIndex(0)
|
||||
3 >Emitted(4, 6) Source(7, 2) + SourceIndex(0)
|
||||
4 >Emitted(4, 7) Source(7, 3) + SourceIndex(0)
|
||||
---
|
||||
>>>class A {
|
||||
1->
|
||||
2 >^^^^^^^^^^^^^->
|
||||
1->
|
||||
>
|
||||
>
|
||||
1->Emitted(5, 1) Source(9, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> view() {
|
||||
1->^^^^
|
||||
2 > ^^^^
|
||||
3 > ^^^^^^^^^->
|
||||
1->class A {
|
||||
>
|
||||
2 > view
|
||||
1->Emitted(6, 5) Source(10, 2) + SourceIndex(0)
|
||||
2 >Emitted(6, 9) Source(10, 6) + SourceIndex(0)
|
||||
---
|
||||
>>> return [
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->() {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
1->Emitted(7, 9) Source(11, 3) + SourceIndex(0)
|
||||
2 >Emitted(7, 15) Source(11, 9) + SourceIndex(0)
|
||||
3 >Emitted(7, 16) Source(11, 10) + SourceIndex(0)
|
||||
---
|
||||
>>> createElement("meta", { content: "helloworld" }),
|
||||
1->^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^^
|
||||
5 > ^^^^^^^^^^^^
|
||||
6 > ^^^
|
||||
1->[
|
||||
>
|
||||
2 > <meta
|
||||
3 > content
|
||||
4 > =
|
||||
5 > "helloworld"
|
||||
6 > ></meta>
|
||||
1->Emitted(8, 13) Source(12, 4) + SourceIndex(0)
|
||||
2 >Emitted(8, 37) Source(12, 10) + SourceIndex(0)
|
||||
3 >Emitted(8, 44) Source(12, 17) + SourceIndex(0)
|
||||
4 >Emitted(8, 46) Source(12, 18) + SourceIndex(0)
|
||||
5 >Emitted(8, 58) Source(12, 30) + SourceIndex(0)
|
||||
6 >Emitted(8, 61) Source(12, 38) + SourceIndex(0)
|
||||
---
|
||||
>>> createElement("meta", { content: c.a.b })
|
||||
1 >^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
6 > ^
|
||||
7 > ^
|
||||
8 > ^
|
||||
9 > ^
|
||||
10> ^^^
|
||||
1 >,
|
||||
>
|
||||
2 > <meta
|
||||
3 > content
|
||||
4 > ={
|
||||
5 > c
|
||||
6 > .
|
||||
7 > a!
|
||||
8 > .
|
||||
9 > b
|
||||
10> }></meta>
|
||||
1 >Emitted(9, 13) Source(13, 4) + SourceIndex(0)
|
||||
2 >Emitted(9, 37) Source(13, 10) + SourceIndex(0)
|
||||
3 >Emitted(9, 44) Source(13, 17) + SourceIndex(0)
|
||||
4 >Emitted(9, 46) Source(13, 19) + SourceIndex(0)
|
||||
5 >Emitted(9, 47) Source(13, 20) + SourceIndex(0)
|
||||
6 >Emitted(9, 48) Source(13, 21) + SourceIndex(0)
|
||||
7 >Emitted(9, 49) Source(13, 23) + SourceIndex(0)
|
||||
8 >Emitted(9, 50) Source(13, 24) + SourceIndex(0)
|
||||
9 >Emitted(9, 51) Source(13, 25) + SourceIndex(0)
|
||||
10>Emitted(9, 54) Source(13, 34) + SourceIndex(0)
|
||||
---
|
||||
>>> ];
|
||||
1 >^^^^^^^^^
|
||||
2 > ^
|
||||
1 >
|
||||
> ]
|
||||
2 > ;
|
||||
1 >Emitted(10, 10) Source(14, 4) + SourceIndex(0)
|
||||
2 >Emitted(10, 11) Source(14, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(11, 5) Source(15, 2) + SourceIndex(0)
|
||||
2 >Emitted(11, 6) Source(15, 3) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
1 >^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(12, 2) Source(16, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=test.js.map
|
||||
125
tests/baselines/reference/jsxFactoryIdentifier.symbols
Normal file
125
tests/baselines/reference/jsxFactoryIdentifier.symbols
Normal file
@@ -0,0 +1,125 @@
|
||||
=== tests/cases/compiler/Element.ts ===
|
||||
|
||||
declare namespace JSX {
|
||||
>JSX : Symbol(JSX, Decl(Element.ts, 0, 0))
|
||||
|
||||
interface Element {
|
||||
>Element : Symbol(Element, Decl(Element.ts, 1, 23))
|
||||
|
||||
name: string;
|
||||
>name : Symbol(Element.name, Decl(Element.ts, 2, 23))
|
||||
|
||||
isIntrinsic: boolean;
|
||||
>isIntrinsic : Symbol(Element.isIntrinsic, Decl(Element.ts, 3, 21))
|
||||
|
||||
isCustomElement: boolean;
|
||||
>isCustomElement : Symbol(Element.isCustomElement, Decl(Element.ts, 4, 29))
|
||||
|
||||
toString(renderId?: number): string;
|
||||
>toString : Symbol(Element.toString, Decl(Element.ts, 5, 33))
|
||||
>renderId : Symbol(renderId, Decl(Element.ts, 6, 17))
|
||||
|
||||
bindDOM(renderId?: number): number;
|
||||
>bindDOM : Symbol(Element.bindDOM, Decl(Element.ts, 6, 44))
|
||||
>renderId : Symbol(renderId, Decl(Element.ts, 7, 16))
|
||||
|
||||
resetComponent(): void;
|
||||
>resetComponent : Symbol(Element.resetComponent, Decl(Element.ts, 7, 43))
|
||||
|
||||
instantiateComponents(renderId?: number): number;
|
||||
>instantiateComponents : Symbol(Element.instantiateComponents, Decl(Element.ts, 8, 31))
|
||||
>renderId : Symbol(renderId, Decl(Element.ts, 9, 30))
|
||||
|
||||
props: any;
|
||||
>props : Symbol(Element.props, Decl(Element.ts, 9, 57))
|
||||
}
|
||||
}
|
||||
export namespace Element {
|
||||
>Element : Symbol(Element, Decl(Element.ts, 12, 1))
|
||||
|
||||
export function isElement(el: any): el is JSX.Element {
|
||||
>isElement : Symbol(isElement, Decl(Element.ts, 13, 26))
|
||||
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
||||
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
||||
>JSX : Symbol(JSX, Decl(Element.ts, 0, 0))
|
||||
>Element : Symbol(JSX.Element, Decl(Element.ts, 1, 23))
|
||||
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
>el : Symbol(el, Decl(Element.ts, 14, 30))
|
||||
>undefined : Symbol(undefined)
|
||||
}
|
||||
|
||||
export function createElement(args: any[]) {
|
||||
>createElement : Symbol(createElement, Decl(Element.ts, 16, 5))
|
||||
>args : Symbol(args, Decl(Element.ts, 18, 34))
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let createElement = Element.createElement;
|
||||
>createElement : Symbol(createElement, Decl(Element.ts, 25, 10))
|
||||
>Element.createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
||||
>Element : Symbol(Element, Decl(Element.ts, 12, 1))
|
||||
>createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
||||
|
||||
function toCamelCase(text: string): string {
|
||||
>toCamelCase : Symbol(toCamelCase, Decl(Element.ts, 25, 49))
|
||||
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
||||
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
|
||||
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
||||
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --))
|
||||
>text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --))
|
||||
>text : Symbol(text, Decl(Element.ts, 27, 21))
|
||||
>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/test.tsx ===
|
||||
import { Element} from './Element';
|
||||
>Element : Symbol(Element, Decl(test.tsx, 0, 8))
|
||||
|
||||
let createElement = Element.createElement;
|
||||
>createElement : Symbol(createElement, Decl(test.tsx, 1, 3))
|
||||
>Element.createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
||||
>Element : Symbol(Element, Decl(test.tsx, 0, 8))
|
||||
>createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5))
|
||||
|
||||
let c: {
|
||||
>c : Symbol(c, Decl(test.tsx, 2, 3))
|
||||
|
||||
a?: {
|
||||
>a : Symbol(a, Decl(test.tsx, 2, 8))
|
||||
|
||||
b: string
|
||||
>b : Symbol(b, Decl(test.tsx, 3, 6))
|
||||
}
|
||||
};
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(test.tsx, 6, 2))
|
||||
|
||||
view() {
|
||||
>view : Symbol(A.view, Decl(test.tsx, 8, 9))
|
||||
|
||||
return [
|
||||
<meta content="helloworld"></meta>,
|
||||
>meta : Symbol(unknown)
|
||||
>content : Symbol(unknown)
|
||||
>meta : Symbol(unknown)
|
||||
|
||||
<meta content={c.a!.b}></meta>
|
||||
>meta : Symbol(unknown)
|
||||
>content : Symbol(unknown)
|
||||
>c.a!.b : Symbol(b, Decl(test.tsx, 3, 6))
|
||||
>c.a : Symbol(a, Decl(test.tsx, 2, 8))
|
||||
>c : Symbol(c, Decl(test.tsx, 2, 3))
|
||||
>a : Symbol(a, Decl(test.tsx, 2, 8))
|
||||
>b : Symbol(b, Decl(test.tsx, 3, 6))
|
||||
>meta : Symbol(unknown)
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
140
tests/baselines/reference/jsxFactoryIdentifier.types
Normal file
140
tests/baselines/reference/jsxFactoryIdentifier.types
Normal file
@@ -0,0 +1,140 @@
|
||||
=== tests/cases/compiler/Element.ts ===
|
||||
|
||||
declare namespace JSX {
|
||||
>JSX : any
|
||||
|
||||
interface Element {
|
||||
>Element : Element
|
||||
|
||||
name: string;
|
||||
>name : string
|
||||
|
||||
isIntrinsic: boolean;
|
||||
>isIntrinsic : boolean
|
||||
|
||||
isCustomElement: boolean;
|
||||
>isCustomElement : boolean
|
||||
|
||||
toString(renderId?: number): string;
|
||||
>toString : (renderId?: number) => string
|
||||
>renderId : number
|
||||
|
||||
bindDOM(renderId?: number): number;
|
||||
>bindDOM : (renderId?: number) => number
|
||||
>renderId : number
|
||||
|
||||
resetComponent(): void;
|
||||
>resetComponent : () => void
|
||||
|
||||
instantiateComponents(renderId?: number): number;
|
||||
>instantiateComponents : (renderId?: number) => number
|
||||
>renderId : number
|
||||
|
||||
props: any;
|
||||
>props : any
|
||||
}
|
||||
}
|
||||
export namespace Element {
|
||||
>Element : typeof Element
|
||||
|
||||
export function isElement(el: any): el is JSX.Element {
|
||||
>isElement : (el: any) => el is JSX.Element
|
||||
>el : any
|
||||
>el : any
|
||||
>JSX : any
|
||||
>Element : JSX.Element
|
||||
|
||||
return el.markAsChildOfRootElement !== undefined;
|
||||
>el.markAsChildOfRootElement !== undefined : boolean
|
||||
>el.markAsChildOfRootElement : any
|
||||
>el : any
|
||||
>markAsChildOfRootElement : any
|
||||
>undefined : undefined
|
||||
}
|
||||
|
||||
export function createElement(args: any[]) {
|
||||
>createElement : (args: any[]) => {}
|
||||
>args : any[]
|
||||
|
||||
return {
|
||||
>{ } : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export let createElement = Element.createElement;
|
||||
>createElement : (args: any[]) => {}
|
||||
>Element.createElement : (args: any[]) => {}
|
||||
>Element : typeof Element
|
||||
>createElement : (args: any[]) => {}
|
||||
|
||||
function toCamelCase(text: string): string {
|
||||
>toCamelCase : (text: string) => string
|
||||
>text : string
|
||||
|
||||
return text[0].toLowerCase() + text.substring(1);
|
||||
>text[0].toLowerCase() + text.substring(1) : string
|
||||
>text[0].toLowerCase() : string
|
||||
>text[0].toLowerCase : () => string
|
||||
>text[0] : string
|
||||
>text : string
|
||||
>0 : 0
|
||||
>toLowerCase : () => string
|
||||
>text.substring(1) : string
|
||||
>text.substring : (start: number, end?: number) => string
|
||||
>text : string
|
||||
>substring : (start: number, end?: number) => string
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/test.tsx ===
|
||||
import { Element} from './Element';
|
||||
>Element : typeof Element
|
||||
|
||||
let createElement = Element.createElement;
|
||||
>createElement : (args: any[]) => {}
|
||||
>Element.createElement : (args: any[]) => {}
|
||||
>Element : typeof Element
|
||||
>createElement : (args: any[]) => {}
|
||||
|
||||
let c: {
|
||||
>c : { a?: { b: string; }; }
|
||||
|
||||
a?: {
|
||||
>a : { b: string; }
|
||||
|
||||
b: string
|
||||
>b : string
|
||||
}
|
||||
};
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
view() {
|
||||
>view : () => any[]
|
||||
|
||||
return [
|
||||
>[ <meta content="helloworld"></meta>, <meta content={c.a!.b}></meta> ] : any[]
|
||||
|
||||
<meta content="helloworld"></meta>,
|
||||
><meta content="helloworld"></meta> : any
|
||||
>meta : any
|
||||
>content : any
|
||||
>meta : any
|
||||
|
||||
<meta content={c.a!.b}></meta>
|
||||
><meta content={c.a!.b}></meta> : any
|
||||
>meta : any
|
||||
>content : any
|
||||
>c.a!.b : string
|
||||
>c.a! : { b: string; }
|
||||
>c.a : { b: string; }
|
||||
>c : { a?: { b: string; }; }
|
||||
>a : { b: string; }
|
||||
>b : string
|
||||
>meta : any
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
24
tests/baselines/reference/jsxFactoryIdentifierAsParameter.js
Normal file
24
tests/baselines/reference/jsxFactoryIdentifierAsParameter.js
Normal file
@@ -0,0 +1,24 @@
|
||||
//// [test.tsx]
|
||||
|
||||
declare module JSX {
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
export class AppComponent {
|
||||
render(createElement) {
|
||||
return <div />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [test.js]
|
||||
"use strict";
|
||||
class AppComponent {
|
||||
render(createElement) {
|
||||
return createElement("div", null);
|
||||
}
|
||||
}
|
||||
exports.AppComponent = AppComponent;
|
||||
//# sourceMappingURL=test.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [test.js.map]
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";AAOA;IACI,MAAM,CAAC,aAAa;QAChB,MAAM,CAAC,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"}
|
||||
@@ -0,0 +1,87 @@
|
||||
===================================================================
|
||||
JsFile: test.js
|
||||
mapUrl: test.js.map
|
||||
sourceRoot:
|
||||
sources: test.tsx
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/test.js
|
||||
sourceFile:test.tsx
|
||||
-------------------------------------------------------------------
|
||||
>>>"use strict";
|
||||
>>>class AppComponent {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>declare module JSX {
|
||||
> interface IntrinsicElements {
|
||||
> [s: string]: any;
|
||||
> }
|
||||
>}
|
||||
>
|
||||
>
|
||||
1 >Emitted(2, 1) Source(8, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> render(createElement) {
|
||||
1->^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^->
|
||||
1->export class AppComponent {
|
||||
>
|
||||
2 > render
|
||||
3 > (
|
||||
4 > createElement
|
||||
1->Emitted(3, 5) Source(9, 5) + SourceIndex(0)
|
||||
2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0)
|
||||
3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0)
|
||||
4 >Emitted(3, 25) Source(9, 25) + SourceIndex(0)
|
||||
---
|
||||
>>> return createElement("div", null);
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
5 > ^
|
||||
1->) {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > <div />
|
||||
5 > ;
|
||||
1->Emitted(4, 9) Source(10, 9) + SourceIndex(0)
|
||||
2 >Emitted(4, 15) Source(10, 15) + SourceIndex(0)
|
||||
3 >Emitted(4, 16) Source(10, 16) + SourceIndex(0)
|
||||
4 >Emitted(4, 42) Source(10, 23) + SourceIndex(0)
|
||||
5 >Emitted(4, 43) Source(10, 24) + SourceIndex(0)
|
||||
---
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(5, 5) Source(11, 5) + SourceIndex(0)
|
||||
2 >Emitted(5, 6) Source(11, 6) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
1 >^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(6, 2) Source(12, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>exports.AppComponent = AppComponent;
|
||||
1->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
2 >export class AppComponent {
|
||||
> render(createElement) {
|
||||
> return <div />;
|
||||
> }
|
||||
>}
|
||||
1->Emitted(7, 1) Source(8, 1) + SourceIndex(0)
|
||||
2 >Emitted(7, 37) Source(12, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=test.js.map
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/test.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : Symbol(JSX, Decl(test.tsx, 0, 0))
|
||||
|
||||
interface IntrinsicElements {
|
||||
>IntrinsicElements : Symbol(IntrinsicElements, Decl(test.tsx, 1, 20))
|
||||
|
||||
[s: string]: any;
|
||||
>s : Symbol(s, Decl(test.tsx, 3, 9))
|
||||
}
|
||||
}
|
||||
|
||||
export class AppComponent {
|
||||
>AppComponent : Symbol(AppComponent, Decl(test.tsx, 5, 1))
|
||||
|
||||
render(createElement) {
|
||||
>render : Symbol(AppComponent.render, Decl(test.tsx, 7, 27))
|
||||
>createElement : Symbol(createElement, Decl(test.tsx, 8, 11))
|
||||
|
||||
return <div />;
|
||||
>div : Symbol(unknown)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/compiler/test.tsx ===
|
||||
|
||||
declare module JSX {
|
||||
>JSX : any
|
||||
|
||||
interface IntrinsicElements {
|
||||
>IntrinsicElements : IntrinsicElements
|
||||
|
||||
[s: string]: any;
|
||||
>s : string
|
||||
}
|
||||
}
|
||||
|
||||
export class AppComponent {
|
||||
>AppComponent : AppComponent
|
||||
|
||||
render(createElement) {
|
||||
>render : (createElement: any) => any
|
||||
>createElement : any
|
||||
|
||||
return <div />;
|
||||
><div /> : any
|
||||
>div : any
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
tests/cases/compiler/test.tsx(10,17): error TS2304: Cannot find name 'createElement'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/test.tsx (1 errors) ====
|
||||
|
||||
declare module JSX {
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
export class AppComponent {
|
||||
render() {
|
||||
return <div />;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'createElement'.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//// [test.tsx]
|
||||
|
||||
declare module JSX {
|
||||
interface IntrinsicElements {
|
||||
[s: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
export class AppComponent {
|
||||
render() {
|
||||
return <div />;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [test.js]
|
||||
"use strict";
|
||||
class AppComponent {
|
||||
render() {
|
||||
return createElement("div", null);
|
||||
}
|
||||
}
|
||||
exports.AppComponent = AppComponent;
|
||||
//# sourceMappingURL=test.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [test.js.map]
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";AAOA;IACI,MAAM;QACF,MAAM,CAAC,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user