diff --git a/crates/swc/tests/tsc-references/ES5For-of20.1.normal.js b/crates/swc/tests/tsc-references/ES5For-of20.1.normal.js deleted file mode 100644 index 7a60b6f2745..00000000000 --- a/crates/swc/tests/tsc-references/ES5For-of20.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [ES5For-of20.ts] -//! -//! x 'const' declarations must be initialized -//! ,-[1:1] -//! 1 | for (let v of []) { -//! 2 | let v; -//! 3 | for (let v of [v]) { -//! 4 | const v; -//! : ^ -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/ES5For-of20.2.minified.js b/crates/swc/tests/tsc-references/ES5For-of20.2.minified.js deleted file mode 100644 index 7a60b6f2745..00000000000 --- a/crates/swc/tests/tsc-references/ES5For-of20.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [ES5For-of20.ts] -//! -//! x 'const' declarations must be initialized -//! ,-[1:1] -//! 1 | for (let v of []) { -//! 2 | let v; -//! 3 | for (let v of [v]) { -//! 4 | const v; -//! : ^ -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.1.normal.js b/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.1.normal.js deleted file mode 100644 index 5e7bc95fa81..00000000000 --- a/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [FunctionDeclaration5_es6.ts] -//! -//! x `yield` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | function*foo(yield) { -//! : ^^^^^ -//! 2 | } -//! `---- -//! -//! x Expected ident -//! ,-[1:1] -//! 1 | function*foo(yield) { -//! : ^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.2.minified.js b/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.2.minified.js deleted file mode 100644 index 5e7bc95fa81..00000000000 --- a/crates/swc/tests/tsc-references/FunctionDeclaration5_es6.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [FunctionDeclaration5_es6.ts] -//! -//! x `yield` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | function*foo(yield) { -//! : ^^^^^ -//! 2 | } -//! `---- -//! -//! x Expected ident -//! ,-[1:1] -//! 1 | function*foo(yield) { -//! : ^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration11_es6.1.normal.js b/crates/swc/tests/tsc-references/VariableDeclaration11_es6.1.normal.js deleted file mode 100644 index 1f70c52813d..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration11_es6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [VariableDeclaration11_es6.ts] -//! -//! x `let` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | let -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration11_es6.2.minified.js b/crates/swc/tests/tsc-references/VariableDeclaration11_es6.2.minified.js deleted file mode 100644 index 1f70c52813d..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration11_es6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [VariableDeclaration11_es6.ts] -//! -//! x `let` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | let -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration1_es6.1.normal.js b/crates/swc/tests/tsc-references/VariableDeclaration1_es6.1.normal.js deleted file mode 100644 index 77ee50f1200..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration1_es6.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration1_es6.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | const -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration1_es6.2.minified.js b/crates/swc/tests/tsc-references/VariableDeclaration1_es6.2.minified.js deleted file mode 100644 index 77ee50f1200..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration1_es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration1_es6.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | const -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration2_es6.1.normal.js b/crates/swc/tests/tsc-references/VariableDeclaration2_es6.1.normal.js deleted file mode 100644 index fc5e917b0fb..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration2_es6.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration2_es6.ts] -//! -//! x 'const' declarations must be initialized -//! ,---- -//! 1 | const a -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration2_es6.2.minified.js b/crates/swc/tests/tsc-references/VariableDeclaration2_es6.2.minified.js deleted file mode 100644 index fc5e917b0fb..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration2_es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration2_es6.ts] -//! -//! x 'const' declarations must be initialized -//! ,---- -//! 1 | const a -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration4_es6.1.normal.js b/crates/swc/tests/tsc-references/VariableDeclaration4_es6.1.normal.js deleted file mode 100644 index 9069d031eda..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration4_es6.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration4_es6.ts] -//! -//! x 'const' declarations must be initialized -//! ,---- -//! 1 | const a: number -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/VariableDeclaration4_es6.2.minified.js b/crates/swc/tests/tsc-references/VariableDeclaration4_es6.2.minified.js deleted file mode 100644 index 9069d031eda..00000000000 --- a/crates/swc/tests/tsc-references/VariableDeclaration4_es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [VariableDeclaration4_es6.ts] -//! -//! x 'const' declarations must be initialized -//! ,---- -//! 1 | const a: number -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/abstractPropertyInitializer.1.normal.js b/crates/swc/tests/tsc-references/abstractPropertyInitializer.1.normal.js deleted file mode 100644 index 9cab43a314e..00000000000 --- a/crates/swc/tests/tsc-references/abstractPropertyInitializer.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [abstractPropertyInitializer.ts] -//! -//! x Abstract property cannot have an initializer. -//! ,-[1:1] -//! 1 | abstract class C { -//! 2 | abstract prop = 1 -//! : ^^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/abstractPropertyInitializer.2.minified.js b/crates/swc/tests/tsc-references/abstractPropertyInitializer.2.minified.js deleted file mode 100644 index 9cab43a314e..00000000000 --- a/crates/swc/tests/tsc-references/abstractPropertyInitializer.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [abstractPropertyInitializer.ts] -//! -//! x Abstract property cannot have an initializer. -//! ,-[1:1] -//! 1 | abstract class C { -//! 2 | abstract prop = 1 -//! : ^^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty7.1.normal.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty7.1.normal.js deleted file mode 100644 index be59bb3b787..00000000000 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty7.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [accessorsOverrideProperty7.ts] -//! -//! x Abstract property cannot have an initializer. -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract p = 'yep' -//! : ^^^^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | class B extends A { -//! 5 | get p() { return 'oh no' } // error -//! `---- diff --git a/crates/swc/tests/tsc-references/accessorsOverrideProperty7.2.minified.js b/crates/swc/tests/tsc-references/accessorsOverrideProperty7.2.minified.js deleted file mode 100644 index be59bb3b787..00000000000 --- a/crates/swc/tests/tsc-references/accessorsOverrideProperty7.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [accessorsOverrideProperty7.ts] -//! -//! x Abstract property cannot have an initializer. -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract p = 'yep' -//! : ^^^^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | class B extends A { -//! 5 | get p() { return 'oh no' } // error -//! `---- diff --git a/crates/swc/tests/tsc-references/allowImportingTsExtensions.1.normal.js b/crates/swc/tests/tsc-references/allowImportingTsExtensions.1.normal.js new file mode 100644 index 00000000000..c50a512c0c1 --- /dev/null +++ b/crates/swc/tests/tsc-references/allowImportingTsExtensions.1.normal.js @@ -0,0 +1,18 @@ +//// [allowImportingTsExtensions.ts] +//// [/ts.ts] +export { }; +//// [/tsx.tsx] +export { }; +//// [/dts.d.ts] +export { }; +//// [/b.ts] +import "./ts.js"; +import "./ts.ts"; +import "./tsx.js"; +import "./tsx.jsx"; +import "./tsx.ts"; +import "./tsx.tsx"; +import "./dts.js"; +import "./dts.ts"; +//// [/c.ts] +import "./thisfiledoesnotexist.ts"; diff --git a/crates/swc/tests/tsc-references/allowImportingTsExtensions.2.minified.js b/crates/swc/tests/tsc-references/allowImportingTsExtensions.2.minified.js new file mode 100644 index 00000000000..c50a512c0c1 --- /dev/null +++ b/crates/swc/tests/tsc-references/allowImportingTsExtensions.2.minified.js @@ -0,0 +1,18 @@ +//// [allowImportingTsExtensions.ts] +//// [/ts.ts] +export { }; +//// [/tsx.tsx] +export { }; +//// [/dts.d.ts] +export { }; +//// [/b.ts] +import "./ts.js"; +import "./ts.ts"; +import "./tsx.js"; +import "./tsx.jsx"; +import "./tsx.ts"; +import "./tsx.tsx"; +import "./dts.js"; +import "./dts.ts"; +//// [/c.ts] +import "./thisfiledoesnotexist.ts"; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.1.normal.js deleted file mode 100644 index 8111a0ff439..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.1.normal.js +++ /dev/null @@ -1,136 +0,0 @@ -//// [arithmeticOperatorWithNullValueAndInvalidOperands.ts] -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. -var a; -var b; -var c; -// operator * -var r1a1 = null * a; -var r1a2 = null * b; -var r1a3 = null * c; -var r1b1 = a * null; -var r1b2 = b * null; -var r1b3 = c * null; -var r1c1 = null * true; -var r1c2 = null * ""; -var r1c3 = null * {}; -var r1d1 = true * null; -var r1d2 = "" * null; -var r1d3 = {} * null; -// operator / -var r2a1 = null / a; -var r2a2 = null / b; -var r2a3 = null / c; -var r2b1 = a / null; -var r2b2 = b / null; -var r2b3 = c / null; -var r2c1 = null / true; -var r2c2 = null / ""; -var r2c3 = null / {}; -var r2d1 = true / null; -var r2d2 = "" / null; -var r2d3 = {} / null; -// operator % -var r3a1 = null % a; -var r3a2 = null % b; -var r3a3 = null % c; -var r3b1 = a % null; -var r3b2 = b % null; -var r3b3 = c % null; -var r3c1 = null % true; -var r3c2 = null % ""; -var r3c3 = null % {}; -var r3d1 = true % null; -var r3d2 = "" % null; -var r3d3 = {} % null; -// operator - -var r4a1 = null - a; -var r4a2 = null - b; -var r4a3 = null - c; -var r4b1 = a - null; -var r4b2 = b - null; -var r4b3 = c - null; -var r4c1 = null - true; -var r4c2 = null - ""; -var r4c3 = null - {}; -var r4d1 = true - null; -var r4d2 = "" - null; -var r4d3 = {} - null; -// operator << -var r5a1 = null << a; -var r5a2 = null << b; -var r5a3 = null << c; -var r5b1 = a << null; -var r5b2 = b << null; -var r5b3 = c << null; -var r5c1 = null << true; -var r5c2 = null << ""; -var r5c3 = null << {}; -var r5d1 = true << null; -var r5d2 = "" << null; -var r5d3 = {} << null; -// operator >> -var r6a1 = null >> a; -var r6a2 = null >> b; -var r6a3 = null >> c; -var r6b1 = a >> null; -var r6b2 = b >> null; -var r6b3 = c >> null; -var r6c1 = null >> true; -var r6c2 = null >> ""; -var r6c3 = null >> {}; -var r6d1 = true >> null; -var r6d2 = "" >> null; -var r6d3 = {} >> null; -// operator >>> -var r7a1 = null >>> a; -var r7a2 = null >>> b; -var r7a3 = null >>> c; -var r7b1 = a >>> null; -var r7b2 = b >>> null; -var r7b3 = c >>> null; -var r7c1 = null >>> true; -var r7c2 = null >>> ""; -var r7c3 = null >>> {}; -var r7d1 = true >>> null; -var r7d2 = "" >>> null; -var r7d3 = {} >>> null; -// operator & -var r8a1 = null & a; -var r8a2 = null & b; -var r8a3 = null & c; -var r8b1 = a & null; -var r8b2 = b & null; -var r8b3 = c & null; -var r8c1 = null & true; -var r8c2 = null & ""; -var r8c3 = null & {}; -var r8d1 = true & null; -var r8d2 = "" & null; -var r8d3 = {} & null; -// operator ^ -var r9a1 = null ^ a; -var r9a2 = null ^ b; -var r9a3 = null ^ c; -var r9b1 = a ^ null; -var r9b2 = b ^ null; -var r9b3 = c ^ null; -var r9c1 = null ^ true; -var r9c2 = null ^ ""; -var r9c3 = null ^ {}; -var r9d1 = true ^ null; -var r9d2 = "" ^ null; -var r9d3 = {} ^ null; -// operator | -var r10a1 = null | a; -var r10a2 = null | b; -var r10a3 = null | c; -var r10b1 = a | null; -var r10b2 = b | null; -var r10b3 = c | null; -var r10c1 = null | true; -var r10c2 = null | ""; -var r10c3 = null | {}; -var r10d1 = true | null; -var r10d2 = "" | null; -var r10d3 = {} | null; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.2.minified.js deleted file mode 100644 index e789eb87776..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndInvalidOperands.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [arithmeticOperatorWithNullValueAndInvalidOperands.ts] diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.1.normal.js deleted file mode 100644 index a2db31a1f20..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.1.normal.js +++ /dev/null @@ -1,100 +0,0 @@ -//// [arithmeticOperatorWithNullValueAndValidOperands.ts] -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -// operator * -var ra1 = null * a; -var ra2 = null * b; -var ra3 = null * 1; -var ra4 = null * E.a; -var ra5 = a * null; -var ra6 = b * null; -var ra7 = 0 * null; -var ra8 = E.b * null; -// operator / -var rb1 = null / a; -var rb2 = null / b; -var rb3 = null / 1; -var rb4 = null / E.a; -var rb5 = a / null; -var rb6 = b / null; -var rb7 = 0 / null; -var rb8 = E.b / null; -// operator % -var rc1 = null % a; -var rc2 = null % b; -var rc3 = null % 1; -var rc4 = null % E.a; -var rc5 = a % null; -var rc6 = b % null; -var rc7 = 0 % null; -var rc8 = E.b % null; -// operator - -var rd1 = null - a; -var rd2 = null - b; -var rd3 = null - 1; -var rd4 = null - E.a; -var rd5 = a - null; -var rd6 = b - null; -var rd7 = 0 - null; -var rd8 = E.b - null; -// operator << -var re1 = null << a; -var re2 = null << b; -var re3 = null << 1; -var re4 = null << E.a; -var re5 = a << null; -var re6 = b << null; -var re7 = 0 << null; -var re8 = E.b << null; -// operator >> -var rf1 = null >> a; -var rf2 = null >> b; -var rf3 = null >> 1; -var rf4 = null >> E.a; -var rf5 = a >> null; -var rf6 = b >> null; -var rf7 = 0 >> null; -var rf8 = E.b >> null; -// operator >>> -var rg1 = null >>> a; -var rg2 = null >>> b; -var rg3 = null >>> 1; -var rg4 = null >>> E.a; -var rg5 = a >>> null; -var rg6 = b >>> null; -var rg7 = 0 >>> null; -var rg8 = E.b >>> null; -// operator & -var rh1 = null & a; -var rh2 = null & b; -var rh3 = null & 1; -var rh4 = null & E.a; -var rh5 = a & null; -var rh6 = b & null; -var rh7 = 0 & null; -var rh8 = E.b & null; -// operator ^ -var ri1 = null ^ a; -var ri2 = null ^ b; -var ri3 = null ^ 1; -var ri4 = null ^ E.a; -var ri5 = a ^ null; -var ri6 = b ^ null; -var ri7 = 0 ^ null; -var ri8 = E.b ^ null; -// operator | -var rj1 = null | a; -var rj2 = null | b; -var rj3 = null | 1; -var rj4 = null | E.a; -var rj5 = a | null; -var rj6 = b | null; -var rj7 = 0 | null; -var rj8 = E.b | null; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.2.minified.js deleted file mode 100644 index 967baa42c0a..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithNullValueAndValidOperands.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [arithmeticOperatorWithNullValueAndValidOperands.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js deleted file mode 100644 index d110a30ef99..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js +++ /dev/null @@ -1,51 +0,0 @@ -//// [arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts] -// operator * -var ra1 = null * null; -var ra2 = null * undefined; -var ra3 = undefined * null; -var ra4 = undefined * undefined; -// operator / -var rb1 = null / null; -var rb2 = null / undefined; -var rb3 = undefined / null; -var rb4 = undefined / undefined; -// operator % -var rc1 = null % null; -var rc2 = null % undefined; -var rc3 = undefined % null; -var rc4 = undefined % undefined; -// operator - -var rd1 = null - null; -var rd2 = null - undefined; -var rd3 = undefined - null; -var rd4 = undefined - undefined; -// operator << -var re1 = null << null; -var re2 = null << undefined; -var re3 = undefined << null; -var re4 = undefined << undefined; -// operator >> -var rf1 = null >> null; -var rf2 = null >> undefined; -var rf3 = undefined >> null; -var rf4 = undefined >> undefined; -// operator >>> -var rg1 = null >>> null; -var rg2 = null >>> undefined; -var rg3 = undefined >>> null; -var rg4 = undefined >>> undefined; -// operator & -var rh1 = null & null; -var rh2 = null & undefined; -var rh3 = undefined & null; -var rh4 = undefined & undefined; -// operator ^ -var ri1 = null ^ null; -var ri2 = null ^ undefined; -var ri3 = undefined ^ null; -var ri4 = undefined ^ undefined; -// operator | -var rj1 = null | null; -var rj2 = null | undefined; -var rj3 = undefined | null; -var rj4 = undefined | undefined; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js deleted file mode 100644 index 6e5cb683745..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts] diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.1.normal.js deleted file mode 100644 index 921d8dd84d4..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.1.normal.js +++ /dev/null @@ -1,136 +0,0 @@ -//// [arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts] -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. -var a; -var b; -var c; -// operator * -var r1a1 = undefined * a; -var r1a2 = undefined * b; -var r1a3 = undefined * c; -var r1b1 = a * undefined; -var r1b2 = b * undefined; -var r1b3 = c * undefined; -var r1c1 = undefined * true; -var r1c2 = undefined * ""; -var r1c3 = undefined * {}; -var r1d1 = true * undefined; -var r1d2 = "" * undefined; -var r1d3 = {} * undefined; -// operator / -var r2a1 = undefined / a; -var r2a2 = undefined / b; -var r2a3 = undefined / c; -var r2b1 = a / undefined; -var r2b2 = b / undefined; -var r2b3 = c / undefined; -var r2c1 = undefined / true; -var r2c2 = undefined / ""; -var r2c3 = undefined / {}; -var r2d1 = true / undefined; -var r2d2 = "" / undefined; -var r2d3 = {} / undefined; -// operator % -var r3a1 = undefined % a; -var r3a2 = undefined % b; -var r3a3 = undefined % c; -var r3b1 = a % undefined; -var r3b2 = b % undefined; -var r3b3 = c % undefined; -var r3c1 = undefined % true; -var r3c2 = undefined % ""; -var r3c3 = undefined % {}; -var r3d1 = true % undefined; -var r3d2 = "" % undefined; -var r3d3 = {} % undefined; -// operator - -var r4a1 = undefined - a; -var r4a2 = undefined - b; -var r4a3 = undefined - c; -var r4b1 = a - undefined; -var r4b2 = b - undefined; -var r4b3 = c - undefined; -var r4c1 = undefined - true; -var r4c2 = undefined - ""; -var r4c3 = undefined - {}; -var r4d1 = true - undefined; -var r4d2 = "" - undefined; -var r4d3 = {} - undefined; -// operator << -var r5a1 = undefined << a; -var r5a2 = undefined << b; -var r5a3 = undefined << c; -var r5b1 = a << undefined; -var r5b2 = b << undefined; -var r5b3 = c << undefined; -var r5c1 = undefined << true; -var r5c2 = undefined << ""; -var r5c3 = undefined << {}; -var r5d1 = true << undefined; -var r5d2 = "" << undefined; -var r5d3 = {} << undefined; -// operator >> -var r6a1 = undefined >> a; -var r6a2 = undefined >> b; -var r6a3 = undefined >> c; -var r6b1 = a >> undefined; -var r6b2 = b >> undefined; -var r6b3 = c >> undefined; -var r6c1 = undefined >> true; -var r6c2 = undefined >> ""; -var r6c3 = undefined >> {}; -var r6d1 = true >> undefined; -var r6d2 = "" >> undefined; -var r6d3 = {} >> undefined; -// operator >>> -var r7a1 = undefined >>> a; -var r7a2 = undefined >>> b; -var r7a3 = undefined >>> c; -var r7b1 = a >>> undefined; -var r7b2 = b >>> undefined; -var r7b3 = c >>> undefined; -var r7c1 = undefined >>> true; -var r7c2 = undefined >>> ""; -var r7c3 = undefined >>> {}; -var r7d1 = true >>> undefined; -var r7d2 = "" >>> undefined; -var r7d3 = {} >>> undefined; -// operator & -var r8a1 = undefined & a; -var r8a2 = undefined & b; -var r8a3 = undefined & c; -var r8b1 = a & undefined; -var r8b2 = b & undefined; -var r8b3 = c & undefined; -var r8c1 = undefined & true; -var r8c2 = undefined & ""; -var r8c3 = undefined & {}; -var r8d1 = true & undefined; -var r8d2 = "" & undefined; -var r8d3 = {} & undefined; -// operator ^ -var r9a1 = undefined ^ a; -var r9a2 = undefined ^ b; -var r9a3 = undefined ^ c; -var r9b1 = a ^ undefined; -var r9b2 = b ^ undefined; -var r9b3 = c ^ undefined; -var r9c1 = undefined ^ true; -var r9c2 = undefined ^ ""; -var r9c3 = undefined ^ {}; -var r9d1 = true ^ undefined; -var r9d2 = "" ^ undefined; -var r9d3 = {} ^ undefined; -// operator | -var r10a1 = undefined | a; -var r10a2 = undefined | b; -var r10a3 = undefined | c; -var r10b1 = a | undefined; -var r10b2 = b | undefined; -var r10b3 = c | undefined; -var r10c1 = undefined | true; -var r10c2 = undefined | ""; -var r10c3 = undefined | {}; -var r10d1 = true | undefined; -var r10d2 = "" | undefined; -var r10d3 = {} | undefined; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.2.minified.js deleted file mode 100644 index 1d6bc6bc987..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndInvalidOperands.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts] diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.1.normal.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.1.normal.js deleted file mode 100644 index 291e6481319..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.1.normal.js +++ /dev/null @@ -1,100 +0,0 @@ -//// [arithmeticOperatorWithUndefinedValueAndValidOperands.ts] -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -// operator * -var ra1 = undefined * a; -var ra2 = undefined * b; -var ra3 = undefined * 1; -var ra4 = undefined * E.a; -var ra5 = a * undefined; -var ra6 = b * undefined; -var ra7 = 0 * undefined; -var ra8 = E.b * undefined; -// operator / -var rb1 = undefined / a; -var rb2 = undefined / b; -var rb3 = undefined / 1; -var rb4 = undefined / E.a; -var rb5 = a / undefined; -var rb6 = b / undefined; -var rb7 = 0 / undefined; -var rb8 = E.b / undefined; -// operator % -var rc1 = undefined % a; -var rc2 = undefined % b; -var rc3 = undefined % 1; -var rc4 = undefined % E.a; -var rc5 = a % undefined; -var rc6 = b % undefined; -var rc7 = 0 % undefined; -var rc8 = E.b % undefined; -// operator - -var rd1 = undefined - a; -var rd2 = undefined - b; -var rd3 = undefined - 1; -var rd4 = undefined - E.a; -var rd5 = a - undefined; -var rd6 = b - undefined; -var rd7 = 0 - undefined; -var rd8 = E.b - undefined; -// operator << -var re1 = undefined << a; -var re2 = undefined << b; -var re3 = undefined << 1; -var re4 = undefined << E.a; -var re5 = a << undefined; -var re6 = b << undefined; -var re7 = 0 << undefined; -var re8 = E.b << undefined; -// operator >> -var rf1 = undefined >> a; -var rf2 = undefined >> b; -var rf3 = undefined >> 1; -var rf4 = undefined >> E.a; -var rf5 = a >> undefined; -var rf6 = b >> undefined; -var rf7 = 0 >> undefined; -var rf8 = E.b >> undefined; -// operator >>> -var rg1 = undefined >>> a; -var rg2 = undefined >>> b; -var rg3 = undefined >>> 1; -var rg4 = undefined >>> E.a; -var rg5 = a >>> undefined; -var rg6 = b >>> undefined; -var rg7 = 0 >>> undefined; -var rg8 = E.b >>> undefined; -// operator & -var rh1 = undefined & a; -var rh2 = undefined & b; -var rh3 = undefined & 1; -var rh4 = undefined & E.a; -var rh5 = a & undefined; -var rh6 = b & undefined; -var rh7 = 0 & undefined; -var rh8 = E.b & undefined; -// operator ^ -var ri1 = undefined ^ a; -var ri2 = undefined ^ b; -var ri3 = undefined ^ 1; -var ri4 = undefined ^ E.a; -var ri5 = a ^ undefined; -var ri6 = b ^ undefined; -var ri7 = 0 ^ undefined; -var ri8 = E.b ^ undefined; -// operator | -var rj1 = undefined | a; -var rj2 = undefined | b; -var rj3 = undefined | 1; -var rj4 = undefined | E.a; -var rj5 = a | undefined; -var rj6 = b | undefined; -var rj7 = 0 | undefined; -var rj8 = E.b | undefined; diff --git a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.2.minified.js b/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.2.minified.js deleted file mode 100644 index bf947617ccf..00000000000 --- a/crates/swc/tests/tsc-references/arithmeticOperatorWithUndefinedValueAndValidOperands.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [arithmeticOperatorWithUndefinedValueAndValidOperands.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b, E.a, E.b; diff --git a/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.1.normal.js b/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.1.normal.js new file mode 100644 index 00000000000..6357c37c399 --- /dev/null +++ b/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.1.normal.js @@ -0,0 +1,7 @@ +//// [arrayTypeOfTypeOf.ts] +// array type cannot use typeof. +var x = 1; +var xs; // Not an error. This is equivalent to Array +var xs2; +var xs3; +var xs4; diff --git a/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.2.minified.js b/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.2.minified.js new file mode 100644 index 00000000000..315ad0167bb --- /dev/null +++ b/crates/swc/tests/tsc-references/arrayTypeOfTypeOf.2.minified.js @@ -0,0 +1 @@ +//// [arrayTypeOfTypeOf.ts] diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.1.normal.js b/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.1.normal.js new file mode 100644 index 00000000000..df465257eb8 --- /dev/null +++ b/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.1.normal.js @@ -0,0 +1,6 @@ +//// [assignmentCompatWithEnumIndexer.ts] +var E; +(function(E) { + E[E["A"] = 0] = "A"; +})(E || (E = {})); +var foo = {}; diff --git a/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.2.minified.js b/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.2.minified.js new file mode 100644 index 00000000000..20fcd3eb09b --- /dev/null +++ b/crates/swc/tests/tsc-references/assignmentCompatWithEnumIndexer.2.minified.js @@ -0,0 +1,5 @@ +//// [assignmentCompatWithEnumIndexer.ts] +var E; +!function(E) { + E[E.A = 0] = "A"; +}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.1.normal.js deleted file mode 100644 index 9170b753179..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es2017.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.2.minified.js deleted file mode 100644 index 9170b753179..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es2017.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es2017.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.1.normal.js deleted file mode 100644 index b8bd92912e9..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es5.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.2.minified.js deleted file mode 100644 index b8bd92912e9..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es5.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es5.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.1.normal.js deleted file mode 100644 index b4e5d4dcf44..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es6.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.2.minified.js deleted file mode 100644 index b4e5d4dcf44..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction5_es6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction5_es6.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.1.normal.js deleted file mode 100644 index 7ba1ec9b82b..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es2017.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.2.minified.js deleted file mode 100644 index 7ba1ec9b82b..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es2017.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es2017.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.1.normal.js deleted file mode 100644 index ea392c28892..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es5.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.2.minified.js deleted file mode 100644 index ea392c28892..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es5.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es5.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.1.normal.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.1.normal.js deleted file mode 100644 index 8ca638d851e..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es6.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.2.minified.js b/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.2.minified.js deleted file mode 100644 index 8ca638d851e..00000000000 --- a/crates/swc/tests/tsc-references/asyncArrowFunction6_es6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [asyncArrowFunction6_es6.ts] -//! -//! x `await` cannot be used as an identifier in an async context -//! ,-[1:1] -//! 1 | -//! 2 | var foo = async (a = await): Promise => { -//! : ^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.1.normal.js deleted file mode 100644 index c10536cd221..00000000000 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.1.normal.js +++ /dev/null @@ -1,329 +0,0 @@ -//// [asyncFunctionDeclaration15_es5.ts] -import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; -function fn1() { - return _fn1.apply(this, arguments); -} -function _fn1() { - _fn1 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // valid: Promise - ); - return _fn1.apply(this, arguments); -} -function fn2() { - return _fn2.apply(this, arguments); -} -function _fn2() { - _fn2 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // error - ); - return _fn2.apply(this, arguments); -} -function fn3() { - return _fn3.apply(this, arguments); -} -function _fn3() { - _fn3 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // error - ); - return _fn3.apply(this, arguments); -} -function fn4() { - return _fn4.apply(this, arguments); -} -function _fn4() { - _fn4 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // error - ); - return _fn4.apply(this, arguments); -} -function fn5() { - return _fn5.apply(this, arguments); -} -function _fn5() { - _fn5 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // error - ); - return _fn5.apply(this, arguments); -} -function fn6() { - return _fn6.apply(this, arguments); -} -function _fn6() { - _fn6 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // error - ); - return _fn6.apply(this, arguments); -} -function fn7() { - return _fn7.apply(this, arguments); -} -function _fn7() { - _fn7 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - } // valid: Promise - ); - return _fn7.apply(this, arguments); -} -function fn8() { - return _fn8.apply(this, arguments); -} -function _fn8() { - _fn8 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - 1 - ]; - }); - } // valid: Promise - ); - return _fn8.apply(this, arguments); -} -function fn9() { - return _fn9.apply(this, arguments); -} -function _fn9() { - _fn9 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - null - ]; - }); - } // valid: Promise - ); - return _fn9.apply(this, arguments); -} -function fn10() { - return _fn10.apply(this, arguments); -} -function _fn10() { - _fn10 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - undefined - ]; - }); - } // valid: Promise - ); - return _fn10.apply(this, arguments); -} -function fn11() { - return _fn11.apply(this, arguments); -} -function _fn11() { - _fn11 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - a - ]; - }); - } // valid: Promise - ); - return _fn11.apply(this, arguments); -} -function fn12() { - return _fn12.apply(this, arguments); -} -function _fn12() { - _fn12 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - obj - ]; - }); - } // valid: Promise<{ then: string; }> - ); - return _fn12.apply(this, arguments); -} -function fn13() { - return _fn13.apply(this, arguments); -} -function _fn13() { - _fn13 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2, - thenable - ]; - }); - } // error - ); - return _fn13.apply(this, arguments); -} -function fn14() { - return _fn14.apply(this, arguments); -} -function _fn14() { - _fn14 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - 1 - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // valid: Promise - ); - return _fn14.apply(this, arguments); -} -function fn15() { - return _fn15.apply(this, arguments); -} -function _fn15() { - _fn15 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - null - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // valid: Promise - ); - return _fn15.apply(this, arguments); -} -function fn16() { - return _fn16.apply(this, arguments); -} -function _fn16() { - _fn16 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - undefined - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // valid: Promise - ); - return _fn16.apply(this, arguments); -} -function fn17() { - return _fn17.apply(this, arguments); -} -function _fn17() { - _fn17 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - a - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // valid: Promise - ); - return _fn17.apply(this, arguments); -} -function fn18() { - return _fn18.apply(this, arguments); -} -function _fn18() { - _fn18 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - obj - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // valid: Promise - ); - return _fn18.apply(this, arguments); -} -function fn19() { - return _fn19.apply(this, arguments); -} -function _fn19() { - _fn19 = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - switch(_state.label){ - case 0: - return [ - 4, - thenable - ]; - case 1: - _state.sent(); - return [ - 2 - ]; - } - }); - } // error - ); - return _fn19.apply(this, arguments); -} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.2.minified.js deleted file mode 100644 index d73240bcb9c..00000000000 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es5.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [asyncFunctionDeclaration15_es5.ts] -import "@swc/helpers/src/_async_to_generator.mjs"; -import "@swc/helpers/src/_ts_generator.mjs"; diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.1.normal.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.1.normal.js deleted file mode 100644 index 931354cc280..00000000000 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.1.normal.js +++ /dev/null @@ -1,180 +0,0 @@ -//// [asyncFunctionDeclaration15_es6.ts] -import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -function fn1() { - return _fn1.apply(this, arguments); -} -function _fn1() { - _fn1 = _async_to_generator(function*() {} // valid: Promise - ); - return _fn1.apply(this, arguments); -} -function fn2() { - return _fn2.apply(this, arguments); -} -function _fn2() { - _fn2 = _async_to_generator(function*() {} // error - ); - return _fn2.apply(this, arguments); -} -function fn3() { - return _fn3.apply(this, arguments); -} -function _fn3() { - _fn3 = _async_to_generator(function*() {} // error - ); - return _fn3.apply(this, arguments); -} -function fn4() { - return _fn4.apply(this, arguments); -} -function _fn4() { - _fn4 = _async_to_generator(function*() {} // error - ); - return _fn4.apply(this, arguments); -} -function fn5() { - return _fn5.apply(this, arguments); -} -function _fn5() { - _fn5 = _async_to_generator(function*() {} // error - ); - return _fn5.apply(this, arguments); -} -function fn6() { - return _fn6.apply(this, arguments); -} -function _fn6() { - _fn6 = _async_to_generator(function*() {} // error - ); - return _fn6.apply(this, arguments); -} -function fn7() { - return _fn7.apply(this, arguments); -} -function _fn7() { - _fn7 = _async_to_generator(function*() { - return; - } // valid: Promise - ); - return _fn7.apply(this, arguments); -} -function fn8() { - return _fn8.apply(this, arguments); -} -function _fn8() { - _fn8 = _async_to_generator(function*() { - return 1; - } // valid: Promise - ); - return _fn8.apply(this, arguments); -} -function fn9() { - return _fn9.apply(this, arguments); -} -function _fn9() { - _fn9 = _async_to_generator(function*() { - return null; - } // valid: Promise - ); - return _fn9.apply(this, arguments); -} -function fn10() { - return _fn10.apply(this, arguments); -} -function _fn10() { - _fn10 = _async_to_generator(function*() { - return undefined; - } // valid: Promise - ); - return _fn10.apply(this, arguments); -} -function fn11() { - return _fn11.apply(this, arguments); -} -function _fn11() { - _fn11 = _async_to_generator(function*() { - return a; - } // valid: Promise - ); - return _fn11.apply(this, arguments); -} -function fn12() { - return _fn12.apply(this, arguments); -} -function _fn12() { - _fn12 = _async_to_generator(function*() { - return obj; - } // valid: Promise<{ then: string; }> - ); - return _fn12.apply(this, arguments); -} -function fn13() { - return _fn13.apply(this, arguments); -} -function _fn13() { - _fn13 = _async_to_generator(function*() { - return thenable; - } // error - ); - return _fn13.apply(this, arguments); -} -function fn14() { - return _fn14.apply(this, arguments); -} -function _fn14() { - _fn14 = _async_to_generator(function*() { - yield 1; - } // valid: Promise - ); - return _fn14.apply(this, arguments); -} -function fn15() { - return _fn15.apply(this, arguments); -} -function _fn15() { - _fn15 = _async_to_generator(function*() { - yield null; - } // valid: Promise - ); - return _fn15.apply(this, arguments); -} -function fn16() { - return _fn16.apply(this, arguments); -} -function _fn16() { - _fn16 = _async_to_generator(function*() { - yield undefined; - } // valid: Promise - ); - return _fn16.apply(this, arguments); -} -function fn17() { - return _fn17.apply(this, arguments); -} -function _fn17() { - _fn17 = _async_to_generator(function*() { - yield a; - } // valid: Promise - ); - return _fn17.apply(this, arguments); -} -function fn18() { - return _fn18.apply(this, arguments); -} -function _fn18() { - _fn18 = _async_to_generator(function*() { - yield obj; - } // valid: Promise - ); - return _fn18.apply(this, arguments); -} -function fn19() { - return _fn19.apply(this, arguments); -} -function _fn19() { - _fn19 = _async_to_generator(function*() { - yield thenable; - } // error - ); - return _fn19.apply(this, arguments); -} diff --git a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.2.minified.js b/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.2.minified.js deleted file mode 100644 index 96ca80d1698..00000000000 --- a/crates/swc/tests/tsc-references/asyncFunctionDeclaration15_es6.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [asyncFunctionDeclaration15_es6.ts] -import "@swc/helpers/src/_async_to_generator.mjs"; diff --git a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6.1.normal.js b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6.1.normal.js index 745660227b4..c77e2a5737a 100644 --- a/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6.1.normal.js +++ b/crates/swc/tests/tsc-references/asyncMethodWithSuper_es6.1.normal.js @@ -236,3 +236,90 @@ class B extends A { })(); } } +// https://github.com/microsoft/TypeScript/issues/46828 +class Base { + set setter(x) {} + get getter() { + return; + } + method(x) {} + static set setter(x) {} + static get getter() { + return; + } + static method(x) {} +} +class Derived extends Base { + a() { + var _this = this, _superprop_get_method = ()=>super.method; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get_method().call(_this, ''); + }); + } + b() { + var _superprop_get_getter = ()=>super.getter; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get_getter(); + }); + } + c() { + var _superprop_set_setter = (_value)=>super.setter = _value; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_set_setter(''); + }); + } + d() { + var _this = this, _superprop_get = (_prop)=>super[_prop]; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get("method").call(_this, ''); + }); + } + e() { + var _superprop_get = (_prop)=>super[_prop]; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get("getter"); + }); + } + f() { + var _superprop_set = (_prop, _value)=>super[_prop] = _value; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_set("setter", ''); + }); + } + static a() { + var _this = this, _superprop_get_method = ()=>super.method; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get_method().call(_this, ''); + }); + } + static b() { + var _superprop_get_getter = ()=>super.getter; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get_getter(); + }); + } + static c() { + var _superprop_set_setter = (_value)=>super.setter = _value; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_set_setter(''); + }); + } + static d() { + var _this = this, _superprop_get = (_prop)=>super[_prop]; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get("method").call(_this, ''); + }); + } + static e() { + var _superprop_get = (_prop)=>super[_prop]; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_get("getter"); + }); + } + static f() { + var _superprop_set = (_prop, _value)=>super[_prop] = _value; + return /*#__PURE__*/ _async_to_generator(function*() { + return _superprop_set("setter", ''); + }); + } +} diff --git a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.1.normal.js b/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.1.normal.js deleted file mode 100644 index a677d675804..00000000000 --- a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.1.normal.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [asyncQualifiedReturnType_es5.ts] -import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _wrap_native_super from "@swc/helpers/src/_wrap_native_super.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; -var X; -(function(X) { - var MyPromise = /*#__PURE__*/ function(Promise1) { - "use strict"; - _inherits(MyPromise, Promise1); - var _super = _create_super(MyPromise); - function MyPromise() { - _class_call_check(this, MyPromise); - return _super.apply(this, arguments); - } - return MyPromise; - }(_wrap_native_super(Promise)); - X.MyPromise = MyPromise; -})(X || (X = {})); -function f() { - return _f.apply(this, arguments); -} -function _f() { - _f = _async_to_generator(function() { - return _ts_generator(this, function(_state) { - return [ - 2 - ]; - }); - }); - return _f.apply(this, arguments); -} diff --git a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.2.minified.js b/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.2.minified.js deleted file mode 100644 index 22fe65f60f7..00000000000 --- a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es5.2.minified.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [asyncQualifiedReturnType_es5.ts] -var X; -import "@swc/helpers/src/_async_to_generator.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _wrap_native_super from "@swc/helpers/src/_wrap_native_super.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import "@swc/helpers/src/_ts_generator.mjs"; -!function(X) { - var MyPromise = function(Promise1) { - "use strict"; - _inherits(MyPromise, Promise1); - var _super = _create_super(MyPromise); - function MyPromise() { - return _class_call_check(this, MyPromise), _super.apply(this, arguments); - } - return MyPromise; - }(_wrap_native_super(Promise)); - X.MyPromise = MyPromise; -}(X || (X = {})); diff --git a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.1.normal.js b/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.1.normal.js deleted file mode 100644 index 1654c73142a..00000000000 --- a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [asyncQualifiedReturnType_es6.ts] -import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; -var X; -(function(X) { - class MyPromise extends Promise { - } - X.MyPromise = MyPromise; -})(X || (X = {})); -function f() { - return _f.apply(this, arguments); -} -function _f() { - _f = _async_to_generator(function*() {}); - return _f.apply(this, arguments); -} diff --git a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.2.minified.js b/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.2.minified.js deleted file mode 100644 index bf80f2c165a..00000000000 --- a/crates/swc/tests/tsc-references/asyncQualifiedReturnType_es6.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [asyncQualifiedReturnType_es6.ts] -var X; -import "@swc/helpers/src/_async_to_generator.mjs"; -(X || (X = {})).MyPromise = class extends Promise { -}; diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).1.normal.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).2.minified.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).1.normal.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).2.minified.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es5).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es5).1.normal.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es5).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor1(target=es5).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor1(target=es5).2.minified.js new file mode 100644 index 00000000000..a6b9aa138d8 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor1(target=es5).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor1.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | accessor b = 1; +//! 5 | static accessor c: any; +//! 6 | static accessor d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor10.1.normal.js b/crates/swc/tests/tsc-references/autoAccessor10.1.normal.js new file mode 100644 index 00000000000..bca785f86aa --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor10.1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor10.ts] +//! +//! x Unexpected token `a0`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a0 = 1; +//! : ^^ +//! 4 | } +//! 5 | +//! 6 | class C2 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor10.2.minified.js b/crates/swc/tests/tsc-references/autoAccessor10.2.minified.js new file mode 100644 index 00000000000..bca785f86aa --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor10.2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor10.ts] +//! +//! x Unexpected token `a0`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a0 = 1; +//! : ^^ +//! 4 | } +//! 5 | +//! 6 | class C2 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).1.normal.js new file mode 100644 index 00000000000..3e537c0b157 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor #a: any; +//! : ^ +//! 4 | accessor #b = 1; +//! 5 | static accessor #c: any; +//! 6 | static accessor #d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).2.minified.js new file mode 100644 index 00000000000..3e537c0b157 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor2(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor #a: any; +//! : ^ +//! 4 | accessor #b = 1; +//! 5 | static accessor #c: any; +//! 6 | static accessor #d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).1.normal.js new file mode 100644 index 00000000000..3e537c0b157 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor #a: any; +//! : ^ +//! 4 | accessor #b = 1; +//! 5 | static accessor #c: any; +//! 6 | static accessor #d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).2.minified.js new file mode 100644 index 00000000000..3e537c0b157 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor2(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor #a: any; +//! : ^ +//! 4 | accessor #b = 1; +//! 5 | static accessor #c: any; +//! 6 | static accessor #d = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).1.normal.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).2.minified.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).1.normal.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).2.minified.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es5).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es5).1.normal.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es5).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor3(target=es5).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor3(target=es5).2.minified.js new file mode 100644 index 00000000000..dec1d68a225 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor3(target=es5).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor3.ts] +//! +//! x Unexpected token `string literal (w, "w")`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor "w": any; +//! : ^^^ +//! 4 | accessor "x" = 1; +//! 5 | static accessor "y": any; +//! 6 | static accessor "z" = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).1.normal.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).2.minified.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).1.normal.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).2.minified.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es5).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es5).1.normal.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es5).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor4(target=es5).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor4(target=es5).2.minified.js new file mode 100644 index 00000000000..46b1f1e88b9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor4(target=es5).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor4.ts] +//! +//! x Unexpected token `numeric literal (0, 0)`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor 0: any; +//! : ^ +//! 4 | accessor 1 = 1; +//! 5 | static accessor 2: any; +//! 6 | static accessor 3 = 2; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).1.normal.js new file mode 100644 index 00000000000..ba41ca13acb --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor6.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).2.minified.js new file mode 100644 index 00000000000..ba41ca13acb --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor6(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor6.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).1.normal.js new file mode 100644 index 00000000000..ba41ca13acb --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor6.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).2.minified.js new file mode 100644 index 00000000000..ba41ca13acb --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor6(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor6.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).1.normal.js new file mode 100644 index 00000000000..b52bcc0f57a --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor7.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | abstract accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).2.minified.js new file mode 100644 index 00000000000..b52bcc0f57a --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor7(target=es2015).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor7.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | abstract accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).1.normal.js new file mode 100644 index 00000000000..b52bcc0f57a --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessor7.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | abstract accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).2.minified.js new file mode 100644 index 00000000000..b52bcc0f57a --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor7(target=es2022).2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessor7.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | abstract accessor a: any; +//! : ^ +//! 4 | } +//! 5 | +//! 6 | class C2 extends C1 { +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor8.1.normal.js b/crates/swc/tests/tsc-references/autoAccessor8.1.normal.js new file mode 100644 index 00000000000..4e85190dcd9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor8.1.normal.js @@ -0,0 +1,11 @@ +//// [autoAccessor8.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | static accessor b: any; +//! 5 | } +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor8.2.minified.js b/crates/swc/tests/tsc-references/autoAccessor8.2.minified.js new file mode 100644 index 00000000000..4e85190dcd9 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor8.2.minified.js @@ -0,0 +1,11 @@ +//// [autoAccessor8.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | static accessor b: any; +//! 5 | } +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor9.1.normal.js b/crates/swc/tests/tsc-references/autoAccessor9.1.normal.js new file mode 100644 index 00000000000..02816687138 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor9.1.normal.js @@ -0,0 +1,13 @@ +//// [autoAccessor9.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[2:1] +//! 2 | // Auto-accessors do not use Set semantics themselves, so do not need to be transformed if there are no other +//! 3 | // initializers that need to be transformed: +//! 4 | class C1 { +//! 5 | accessor x = 1; +//! : ^ +//! 6 | } +//! 7 | +//! 8 | // If there are other field initializers to transform, we must transform auto-accessors so that we can preserve +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessor9.2.minified.js b/crates/swc/tests/tsc-references/autoAccessor9.2.minified.js new file mode 100644 index 00000000000..02816687138 --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessor9.2.minified.js @@ -0,0 +1,13 @@ +//// [autoAccessor9.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[2:1] +//! 2 | // Auto-accessors do not use Set semantics themselves, so do not need to be transformed if there are no other +//! 3 | // initializers that need to be transformed: +//! 4 | class C1 { +//! 5 | accessor x = 1; +//! : ^ +//! 6 | } +//! 7 | +//! 8 | // If there are other field initializers to transform, we must transform auto-accessors so that we can preserve +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.1.normal.js b/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.1.normal.js new file mode 100644 index 00000000000..ac66b02fd4b --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.1.normal.js @@ -0,0 +1,12 @@ +//// [autoAccessorAllowedModifiers.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | public accessor b: any; +//! 5 | private accessor c: any; +//! 6 | protected accessor d: any; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.2.minified.js b/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.2.minified.js new file mode 100644 index 00000000000..ac66b02fd4b --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessorAllowedModifiers.2.minified.js @@ -0,0 +1,12 @@ +//// [autoAccessorAllowedModifiers.ts] +//! +//! x Unexpected token `a`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | +//! 2 | abstract class C1 { +//! 3 | accessor a: any; +//! : ^ +//! 4 | public accessor b: any; +//! 5 | private accessor c: any; +//! 6 | protected accessor d: any; +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.1.normal.js b/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.1.normal.js new file mode 100644 index 00000000000..c70bc4c1a8f --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.1.normal.js @@ -0,0 +1,73 @@ +//// [autoAccessorNoUseDefineForClassFields.ts] +//// [file1.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | // https://github.com/microsoft/TypeScript/issues/51528 +//! 2 | class C1 { +//! 3 | static accessor x = 0; +//! : ^ +//! 4 | } +//! 5 | +//! `---- +//// [file2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C2 { +//! 2 | static accessor #x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file3.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C3 { +//! 2 | static accessor #x = 0; +//! : ^ +//! 3 | accessor #y = 0; +//! 4 | } +//! `---- +//// [file3.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C3 { +//! 2 | accessor x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file4.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C4 { +//! 2 | accessor #x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file5.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C5 { +//! 2 | x = 0; +//! 3 | accessor #x = 1; +//! : ^ +//! 4 | } +//! 5 | +//! `---- +//// [file6.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C6 { +//! 2 | accessor #x = 0; +//! : ^ +//! 3 | x = 1; +//! 4 | } +//! `---- diff --git a/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.2.minified.js b/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.2.minified.js new file mode 100644 index 00000000000..c70bc4c1a8f --- /dev/null +++ b/crates/swc/tests/tsc-references/autoAccessorNoUseDefineForClassFields.2.minified.js @@ -0,0 +1,73 @@ +//// [autoAccessorNoUseDefineForClassFields.ts] +//// [file1.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | // https://github.com/microsoft/TypeScript/issues/51528 +//! 2 | class C1 { +//! 3 | static accessor x = 0; +//! : ^ +//! 4 | } +//! 5 | +//! `---- +//// [file2.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C2 { +//! 2 | static accessor #x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file3.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C3 { +//! 2 | static accessor #x = 0; +//! : ^ +//! 3 | accessor #y = 0; +//! 4 | } +//! `---- +//// [file3.ts] +//! +//! x Unexpected token `x`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C3 { +//! 2 | accessor x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file4.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C4 { +//! 2 | accessor #x = 0; +//! : ^ +//! 3 | } +//! 4 | +//! `---- +//// [file5.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C5 { +//! 2 | x = 0; +//! 3 | accessor #x = 1; +//! : ^ +//! 4 | } +//! 5 | +//! `---- +//// [file6.ts] +//! +//! x Unexpected token `#`. Expected * for generator, private key, identifier or async +//! ,-[1:1] +//! 1 | class C6 { +//! 2 | accessor #x = 0; +//! : ^ +//! 3 | x = 1; +//! 4 | } +//! `---- diff --git a/crates/swc/tests/tsc-references/awaitAndYieldInProperty.1.normal.js b/crates/swc/tests/tsc-references/awaitAndYieldInProperty.1.normal.js deleted file mode 100644 index 2d59b6c93a3..00000000000 --- a/crates/swc/tests/tsc-references/awaitAndYieldInProperty.1.normal.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [awaitAndYieldInProperty.ts] -async function* test(x) { - let _ref, _ref1, _ref2, _ref3; - var _class; - let _ref4 = await x, _ref5 = await x, _ref6 = yield 1, _ref7 = yield 3; - class C { - constructor(){ - this[_ref4] = await x; - this[_ref6] = yield 2; - } - } - C[_ref5] = await x; - C[_ref7] = yield 4; - return _ref = await x, _ref1 = await x, _ref2 = yield 1, _ref3 = yield 3, _class = class { - constructor(){ - this[_ref] = await x; - this[_ref2] = yield 2; - } - }, _class[_ref1] = await x, _class[_ref3] = yield 4, _class; -} diff --git a/crates/swc/tests/tsc-references/awaitAndYieldInProperty.2.minified.js b/crates/swc/tests/tsc-references/awaitAndYieldInProperty.2.minified.js deleted file mode 100644 index 5ca5caf02c6..00000000000 --- a/crates/swc/tests/tsc-references/awaitAndYieldInProperty.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [awaitAndYieldInProperty.ts] diff --git a/crates/swc/tests/tsc-references/await_incorrectThisType.1.normal.js b/crates/swc/tests/tsc-references/await_incorrectThisType.1.normal.js deleted file mode 100644 index 951b95784d3..00000000000 --- a/crates/swc/tests/tsc-references/await_incorrectThisType.1.normal.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [await_incorrectThisType.ts] -// https://github.com/microsoft/TypeScript/issues/47711 -const mkLeft = (e)=>({ - tag: 'Left', - e - }); -const mkRight = (a)=>({ - tag: 'Right', - a - }); -class EPromise { - static succeed(a) { - return new EPromise(Promise.resolve(mkRight(a))); - } - static fail(e) { - return new EPromise(Promise.resolve(mkLeft(e))); - } - constructor(p){ - this.p = p; - } - then(onfulfilled, onrejected) { - return this.p.then(// Casting to `Right` is safe here because we've eliminated the possibility of `Left`. - (either)=>onfulfilled?.(either.a) ?? either.a, onrejected); - } -} -const withTypedFailure = EPromise.fail(1); -// Errors as expected: -// -// "The 'this' context of type 'EPromise' is not assignable to method's -// 'this' of type 'EPromise" -withTypedFailure.then((s)=>s.toUpperCase()).then(console.log); -async function test() { - await withTypedFailure; -} diff --git a/crates/swc/tests/tsc-references/await_incorrectThisType.2.minified.js b/crates/swc/tests/tsc-references/await_incorrectThisType.2.minified.js deleted file mode 100644 index b7453f2532c..00000000000 --- a/crates/swc/tests/tsc-references/await_incorrectThisType.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [await_incorrectThisType.ts] -const mkLeft = (e)=>({ - tag: 'Left', - e - }), mkRight = (a)=>({ - tag: 'Right', - a - }); -class EPromise { - static succeed(a) { - return new EPromise(Promise.resolve(mkRight(a))); - } - static fail(e) { - return new EPromise(Promise.resolve(mkLeft(e))); - } - constructor(p){ - this.p = p; - } - then(onfulfilled, onrejected) { - return this.p.then((either)=>onfulfilled?.(either.a) ?? either.a, onrejected); - } -} -const withTypedFailure = EPromise.fail(1); -withTypedFailure.then((s)=>s.toUpperCase()).then(console.log); diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.1.normal.js b/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.1.normal.js deleted file mode 100644 index d6a026bb334..00000000000 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.1.normal.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [await_unaryExpression_es2017_3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | -//! 2 | async function bar1() { -//! 3 | ++await 42; // Error -//! : ^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! 7 | --await 42; // Error -//! : ^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | async function bar3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.2.minified.js b/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.2.minified.js deleted file mode 100644 index d6a026bb334..00000000000 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es2017_3.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [await_unaryExpression_es2017_3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | -//! 2 | async function bar1() { -//! 3 | ++await 42; // Error -//! : ^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! 7 | --await 42; // Error -//! : ^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | async function bar3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.1.normal.js b/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.1.normal.js deleted file mode 100644 index 1dde96d6e29..00000000000 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.1.normal.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [await_unaryExpression_es6_3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | -//! 2 | async function bar1() { -//! 3 | ++await 42; // Error -//! : ^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! 7 | --await 42; // Error -//! : ^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | async function bar3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.2.minified.js b/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.2.minified.js deleted file mode 100644 index 1dde96d6e29..00000000000 --- a/crates/swc/tests/tsc-references/await_unaryExpression_es6_3.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [await_unaryExpression_es6_3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | -//! 2 | async function bar1() { -//! 3 | ++await 42; // Error -//! : ^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | async function bar2() { -//! 7 | --await 42; // Error -//! : ^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | async function bar3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/binaryIntegerLiteralError.1.normal.js b/crates/swc/tests/tsc-references/binaryIntegerLiteralError.1.normal.js deleted file mode 100644 index 80789bd2d25..00000000000 --- a/crates/swc/tests/tsc-references/binaryIntegerLiteralError.1.normal.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [binaryIntegerLiteralError.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var bin1 = 0B1102110; -//! : ^^^^ -//! 3 | var bin1 = 0b11023410; -//! 4 | -//! 5 | var obj1 = { -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var bin1 = 0B1102110; -//! 3 | var bin1 = 0b11023410; -//! : ^^^^^ -//! 4 | -//! 5 | var obj1 = { -//! 6 | 0b11010: "hi", -//! `---- diff --git a/crates/swc/tests/tsc-references/binaryIntegerLiteralError.2.minified.js b/crates/swc/tests/tsc-references/binaryIntegerLiteralError.2.minified.js deleted file mode 100644 index 80789bd2d25..00000000000 --- a/crates/swc/tests/tsc-references/binaryIntegerLiteralError.2.minified.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [binaryIntegerLiteralError.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var bin1 = 0B1102110; -//! : ^^^^ -//! 3 | var bin1 = 0b11023410; -//! 4 | -//! 5 | var obj1 = { -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var bin1 = 0B1102110; -//! 3 | var bin1 = 0b11023410; -//! : ^^^^^ -//! 4 | -//! 5 | var obj1 = { -//! 6 | 0b11010: "hi", -//! `---- diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.1.normal.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.1.normal.js deleted file mode 100644 index cde6ab668e7..00000000000 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.1.normal.js +++ /dev/null @@ -1,69 +0,0 @@ -//// [bitwiseNotOperatorWithAnyOtherType.ts] -// ~ operator on any type -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var ANY; -var ANY1; -var ANY2 = [ - "", - "" -]; -var obj; -var obj1 = { - x: "", - y: function() {} -}; -function foo() { - var a; - return a; -} -var A = /*#__PURE__*/ function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - A.foo = function foo() { - var a; - return a; - }; - return A; -}(); -var M; -(function(M) { - var n; - M.n = n; -})(M || (M = {})); -var objA = new A(); -// any other type var -var ResultIsNumber = ~ANY1; -var ResultIsNumber1 = ~ANY2; -var ResultIsNumber2 = ~A; -var ResultIsNumber3 = ~M; -var ResultIsNumber4 = ~obj; -var ResultIsNumber5 = ~obj1; -// any type literal -var ResultIsNumber6 = ~undefined; -var ResultIsNumber7 = ~null; -// any type expressions -var ResultIsNumber8 = ~ANY2[0]; -var ResultIsNumber9 = ~obj1.x; -var ResultIsNumber10 = ~obj1.y; -var ResultIsNumber11 = ~objA.a; -var ResultIsNumber12 = ~M.n; -var ResultIsNumber13 = ~foo(); -var ResultIsNumber14 = ~A.foo(); -var ResultIsNumber15 = ~(ANY + ANY1); -var ResultIsNumber16 = ~(null + undefined); -var ResultIsNumber17 = ~(null + null); -var ResultIsNumber18 = ~(undefined + undefined); -// multiple ~ operators -var ResultIsNumber19 = ~~ANY; -var ResultIsNumber20 = ~~~(ANY + ANY1); -//miss assignment operators -~ANY; -~ANY1; -~ANY2[0]; -~ANY, ANY1; -~obj1.y; -~objA.a; -~M.n; -~~obj1.x; diff --git a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.2.minified.js b/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.2.minified.js deleted file mode 100644 index c2e27fcf139..00000000000 --- a/crates/swc/tests/tsc-references/bitwiseNotOperatorWithAnyOtherType.2.minified.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [bitwiseNotOperatorWithAnyOtherType.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var M, obj1 = { - x: "", - y: function() {} -}, A = function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - return A.foo = function() {}, A; -}(); -!function(M) { - var n; - M.n = n; -}(M || (M = {})); -var objA = new A(); -obj1.x, obj1.y, objA.a, M.n, A.foo(), obj1.y, objA.a, M.n, obj1.x; diff --git a/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.1.normal.js b/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.1.normal.js new file mode 100644 index 00000000000..3b5bc4f68c8 --- /dev/null +++ b/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.1.normal.js @@ -0,0 +1,30 @@ +//// [bundlerSyntaxRestrictions.ts] +//// [/node_modules/@types/node/index.d.ts] +//// [/ambient.d.ts] +//// [/mainJs.js] +import "./a"; +import("./a"); +var _ = require("./a"); // No resolution +_.a; // any +//// [/main.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import {} from "./a"; +//! 2 | import _ = require("./a"); // Error +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 3 | export = {}; // Error +//! 4 | export {}; +//! `---- +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | import {} from "./a"; +//! 2 | import _ = require("./a"); // Error +//! 3 | export = {}; // Error +//! : ^^^^^^^^^^^^ +//! 4 | export {}; +//! 5 | +//! `---- +//// [/a.ts] +export var a = "a"; diff --git a/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.2.minified.js b/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.2.minified.js new file mode 100644 index 00000000000..1fd2bc72f5b --- /dev/null +++ b/crates/swc/tests/tsc-references/bundlerSyntaxRestrictions.2.minified.js @@ -0,0 +1,28 @@ +//// [bundlerSyntaxRestrictions.ts] +//// [/node_modules/@types/node/index.d.ts] +//// [/ambient.d.ts] +//// [/mainJs.js] +import "./a"; +import("./a"), require("./a").a; +//// [/main.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import {} from "./a"; +//! 2 | import _ = require("./a"); // Error +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 3 | export = {}; // Error +//! 4 | export {}; +//! `---- +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | import {} from "./a"; +//! 2 | import _ = require("./a"); // Error +//! 3 | export = {}; // Error +//! : ^^^^^^^^^^^^ +//! 4 | export {}; +//! 5 | +//! `---- +//// [/a.ts] +export var a = "a"; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js new file mode 100644 index 00000000000..180c4ff0454 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.1.normal.js @@ -0,0 +1,38 @@ +//// [checkJsdocSatisfiesTag1.ts] +//// [/a.js] +/** + * @typedef {Object} T1 + * @property {number} a + */ /** + * @typedef {Object} T2 + * @property {"a" | "b"} a + */ /** + * @typedef {(x: string) => string} T3 + */ /** + * @typedef {Object} T4 + * @property {string} a + */ var t1 = /** @satisfies {T1} */ { + a: 1 +}; +var t2 = /** @satisfies {T1} */ { + a: 1, + b: 1 +}; +var t3 = /** @satisfies {T1} */ {}; +/** @type {T2} */ var t4 = /** @satisfies {T2} */ { + a: "a" +}; +/** @type {(m: string) => string} */ var t5 = /** @satisfies {T3} */ function(m) { + return m.substring(0); +}; +var t6 = /** @satisfies {[number, number]} */ [ + 1, + 2 +]; +var t7 = /** @satisfies {T4} */ { + a: "test" +}; +var t8 = /** @satisfies {T4} */ { + a: "test", + b: "test" +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.2.minified.js new file mode 100644 index 00000000000..204a0743217 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag1.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag1.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.1.normal.js similarity index 61% rename from crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.1.normal.js rename to crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.1.normal.js index ce7f2fce2f3..7289f42c0a4 100644 --- a/crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.1.normal.js @@ -1,5 +1,6 @@ -//// [typeSatisfaction_propertyNameFulfillment.ts] -var p = { +//// [checkJsdocSatisfiesTag10.ts] +//// [/a.js] +/** @typedef {"a" | "b" | "c" | "d"} Keys */ var p = /** @satisfies {Partial>} */ { a: 0, b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.2.minified.js similarity index 64% rename from crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.2.minified.js rename to crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.2.minified.js index 07ef891322d..f88d793b76a 100644 --- a/crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag10.2.minified.js @@ -1,4 +1,5 @@ -//// [typeSatisfaction_propNameConstraining.ts] +//// [checkJsdocSatisfiesTag10.ts] +//// [/a.js] var p = { a: 0, b: "hello", diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.1.normal.js new file mode 100644 index 00000000000..fdb6f9bfae0 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.1.normal.js @@ -0,0 +1,17 @@ +//// [checkJsdocSatisfiesTag11.ts] +//// [/a.js] +/** + * @typedef {Object} T1 + * @property {number} a + */ /** + * @typedef {Object} T2 + * @property {number} a + */ /** + * @satisfies {T1} + * @satisfies {T2} + */ var t1 = { + a: 1 +}; +/** + * @satisfies {number} + */ var t2 = /** @satisfies {number} */ 1; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.2.minified.js new file mode 100644 index 00000000000..0e5ff1f2686 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag11.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag11.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js new file mode 100644 index 00000000000..42b601d83d9 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.1.normal.js @@ -0,0 +1,48 @@ +//// [checkJsdocSatisfiesTag12.ts] +//// [/a.js] +/** + * @typedef {Object} T1 + * @property {number} a + */ /** + * @typedef {Object} T2 + * @property {string} a + */ /** + * @typedef {Object} T3 + * @property {"a" | "b"} a + */ /** + * @satisfies {T1} + */ var t1 = { + a: 1 +}; +/** + * @satisfies {T1} + */ var t2 = { + a: 1, + b: 1 +}; +/** + * @satisfies {T1} + */ var t3 = {}; +/** + * @satisfies {Array.} + */ var t4 = [ + 1, + 2 +]; +/** + * @satisfies {T2} + */ var t5 = { + a: "test" +}; +/** + * @satisfies {T2} + */ var t6 = { + a: "test", + b: "test" +}; +/** + * @satisfies {T3} + */ var t7 = { + a: "a" +}; +/** @satisfies {string} */ var t8 = 1; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.2.minified.js new file mode 100644 index 00000000000..b818e83a3b7 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag12.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag12.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.1.normal.js new file mode 100644 index 00000000000..3698d5d33a0 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.1.normal.js @@ -0,0 +1,10 @@ +//// [checkJsdocSatisfiesTag13.ts] +//// [/a.js] +/** @satisfies {{ f: (x: string) => string }} */ var t1 = { + f: function(s) { + return s.toLowerCase(); + } +}; // should work +/** @satisfies {{ f: (x: string) => string }} */ var t2 = { + g: "oops" +}; // should error diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.2.minified.js new file mode 100644 index 00000000000..fb44281444b --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag13.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag13.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.1.normal.js new file mode 100644 index 00000000000..278fc1eba1a --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.1.normal.js @@ -0,0 +1,13 @@ +//// [checkJsdocSatisfiesTag14.ts] +//// [/a.js] +/** + * @typedef {Object} T1 + * @property {number} a + */ /** + * @satisfies T1 + */ var t1 = { + a: 1 +}; +var t2 = /** @satisfies T1 */ { + a: 1 +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.2.minified.js new file mode 100644 index 00000000000..2b6bdee0752 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag14.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag14.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.1.normal.js new file mode 100644 index 00000000000..5f6be7824be --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.1.normal.js @@ -0,0 +1,10 @@ +//// [checkJsdocSatisfiesTag2.ts] +//// [/a.js] +/** @typedef {Object. boolean>} Predicates */ var p = /** @satisfies {Predicates} */ { + isEven: function(n) { + return n % 2 === 0; + }, + isOdd: function(n) { + return n % 2 === 1; + } +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.2.minified.js new file mode 100644 index 00000000000..bd070d5fd3c --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag2.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag2.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.1.normal.js new file mode 100644 index 00000000000..3823fb24a49 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.1.normal.js @@ -0,0 +1,10 @@ +//// [checkJsdocSatisfiesTag3.ts] +//// [/a.js] +/** @type {{ f(s: string): void } & Record }} */ var obj = /** @satisfies {{ g(s: string): void } & Record} */ { + f: function f(s) {}, + g: function g(s) {} +}; +// This needs to not crash (outer node is not expression) +/** @satisfies {{ f(s: string): void }} */ ({ + f: function f(x) {} +}); diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.2.minified.js new file mode 100644 index 00000000000..8f4b3415128 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag3.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag3.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.1.normal.js new file mode 100644 index 00000000000..cc8f7dd0ce4 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.1.normal.js @@ -0,0 +1,13 @@ +//// [checkJsdocSatisfiesTag4.ts] +//// [/a.js] +/** + * @typedef {Object} Foo + * @property {number} a + */ export default /** @satisfies {Foo} */ {}; +//// [/b.js] +/** + * @typedef {Object} Foo + * @property {number} a + */ export default /** @satisfies {Foo} */ { + a: 1 +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.2.minified.js new file mode 100644 index 00000000000..21b5942bf60 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag4.2.minified.js @@ -0,0 +1,7 @@ +//// [checkJsdocSatisfiesTag4.ts] +//// [/a.js] +export default {}; +//// [/b.js] +export default { + a: 1 +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.1.normal.js new file mode 100644 index 00000000000..02f7080d486 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.1.normal.js @@ -0,0 +1,9 @@ +//// [checkJsdocSatisfiesTag5.ts] +//// [/a.js] +/** @typedef {{ move(distance: number): void }} Movable */ var car = /** @satisfies {Movable & Record} */ { + start: function start() {}, + move: function move(d) { + // d should be number + }, + stop: function stop() {} +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.2.minified.js new file mode 100644 index 00000000000..2ce17f6bcaa --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag5.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag5.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.1.normal.js new file mode 100644 index 00000000000..a1406105967 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.1.normal.js @@ -0,0 +1,14 @@ +//// [checkJsdocSatisfiesTag6.ts] +//// [/a.js] +/** + * @typedef {Object} Point2d + * @property {number} x + * @property {number} y + */ // Undesirable behavior today with type annotation +var a = /** @satisfies {Partial} */ { + x: 10 +}; +// Should OK +console.log(a.x.toFixed()); +// Should error +var p = a.y; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.2.minified.js new file mode 100644 index 00000000000..1460aa4e75e --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag6.2.minified.js @@ -0,0 +1,6 @@ +//// [checkJsdocSatisfiesTag6.ts] +//// [/a.js] +var a = { + x: 10 +}; +console.log(a.x.toFixed()), a.y; diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.1.normal.js similarity index 63% rename from crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.1.normal.js rename to crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.1.normal.js index 2df22f0a1a9..854747ef8da 100644 --- a/crates/swc/tests/tsc-references/typeSatisfaction_propNameConstraining.1.normal.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.1.normal.js @@ -1,5 +1,6 @@ -//// [typeSatisfaction_propNameConstraining.ts] -var p = { +//// [checkJsdocSatisfiesTag7.ts] +//// [/a.js] +/** @typedef {"a" | "b" | "c" | "d"} Keys */ var p = /** @satisfies {Record} */ { a: 0, b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.2.minified.js similarity index 62% rename from crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.2.minified.js rename to crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.2.minified.js index ef7db6eccf4..47cab0f6724 100644 --- a/crates/swc/tests/tsc-references/typeSatisfaction_propertyNameFulfillment.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag7.2.minified.js @@ -1,4 +1,5 @@ -//// [typeSatisfaction_propertyNameFulfillment.ts] +//// [checkJsdocSatisfiesTag7.ts] +//// [/a.js] var p = { a: 0, b: "hello", diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.1.normal.js new file mode 100644 index 00000000000..59cd456c4fd --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.1.normal.js @@ -0,0 +1,7 @@ +//// [checkJsdocSatisfiesTag8.ts] +//// [/a.js] +/** @typedef {Object.} Facts */ // Should be able to detect a failure here +var x = /** @satisfies {Facts} */ { + m: true, + s: "false" +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.2.minified.js new file mode 100644 index 00000000000..c8c3228ede4 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag8.2.minified.js @@ -0,0 +1,2 @@ +//// [checkJsdocSatisfiesTag8.ts] +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.1.normal.js new file mode 100644 index 00000000000..57c4db77c1a --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.1.normal.js @@ -0,0 +1,25 @@ +//// [checkJsdocSatisfiesTag9.ts] +//// [/a.js] +/** + * @typedef {Object} Color + * @property {number} r + * @property {number} g + * @property {number} b + */ // All of these should be Colors, but I only use some of them here. +export var Palette = /** @satisfies {Record} */ { + white: { + r: 255, + g: 255, + b: 255 + }, + black: { + r: 0, + g: 0, + d: 0 + }, + blue: { + r: 0, + g: 0, + b: 255 + } +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.2.minified.js new file mode 100644 index 00000000000..f3b5b51b9a4 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocSatisfiesTag9.2.minified.js @@ -0,0 +1,19 @@ +//// [checkJsdocSatisfiesTag9.ts] +//// [/a.js] +export var Palette = { + white: { + r: 255, + g: 255, + b: 255 + }, + black: { + r: 0, + g: 0, + d: 0 + }, + blue: { + r: 0, + g: 0, + b: 255 + } +}; diff --git a/crates/swc/tests/tsc-references/checkJsdocTypeTag7.1.normal.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag7.1.normal.js new file mode 100644 index 00000000000..41a20b3bea4 --- /dev/null +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag7.1.normal.js @@ -0,0 +1,14 @@ +//// [test.js] +/** + * @typedef {(a: string, b: number) => void} Foo + */ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +var C = /*#__PURE__*/ function() { + "use strict"; + function C() { + _class_call_check(this, C); + } + var _proto = C.prototype; + /** @type {Foo} */ _proto.foo = function foo(a, b) {}; + /** @type {(optional?) => void} */ _proto.methodWithOptionalParameters = function methodWithOptionalParameters() {}; + return C; +}(); diff --git a/crates/swc/tests/tsc-references/parser553699.2.minified.js b/crates/swc/tests/tsc-references/checkJsdocTypeTag7.2.minified.js similarity index 75% rename from crates/swc/tests/tsc-references/parser553699.2.minified.js rename to crates/swc/tests/tsc-references/checkJsdocTypeTag7.2.minified.js index 94591e37b7e..1ffa4e09013 100644 --- a/crates/swc/tests/tsc-references/parser553699.2.minified.js +++ b/crates/swc/tests/tsc-references/checkJsdocTypeTag7.2.minified.js @@ -1,2 +1,2 @@ -//// [parser553699.ts] +//// [test.js] import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/classAbstractAccessor.1.normal.js b/crates/swc/tests/tsc-references/classAbstractAccessor.1.normal.js deleted file mode 100644 index e99ee596444..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractAccessor.1.normal.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [classAbstractAccessor.ts] -//! -//! x Abstract method cannot have an implementation. -//! ,-[1:1] -//! 1 | -//! 2 | abstract class A { -//! 3 | abstract get a(); -//! 4 | abstract get aa() { return 1; } // error -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 5 | abstract set b(x: string); -//! 6 | abstract set bb(x: string) {} // error -//! 7 | } -//! `---- -//! -//! x Abstract method cannot have an implementation. -//! ,-[3:1] -//! 3 | abstract get a(); -//! 4 | abstract get aa() { return 1; } // error -//! 5 | abstract set b(x: string); -//! 6 | abstract set bb(x: string) {} // error -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractAccessor.2.minified.js b/crates/swc/tests/tsc-references/classAbstractAccessor.2.minified.js deleted file mode 100644 index e99ee596444..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractAccessor.2.minified.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [classAbstractAccessor.ts] -//! -//! x Abstract method cannot have an implementation. -//! ,-[1:1] -//! 1 | -//! 2 | abstract class A { -//! 3 | abstract get a(); -//! 4 | abstract get aa() { return 1; } // error -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 5 | abstract set b(x: string); -//! 6 | abstract set bb(x: string) {} // error -//! 7 | } -//! `---- -//! -//! x Abstract method cannot have an implementation. -//! ,-[3:1] -//! 3 | abstract get a(); -//! 4 | abstract get aa() { return 1; } // error -//! 5 | abstract set b(x: string); -//! 6 | abstract set bb(x: string) {} // error -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractConstructor.1.normal.js b/crates/swc/tests/tsc-references/classAbstractConstructor.1.normal.js deleted file mode 100644 index 4def23b2ae7..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractConstructor.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [classAbstractConstructor.ts] -//! -//! x `abstract` modifier can only appear on a class or method declaration -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract constructor() {} -//! : ^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractConstructor.2.minified.js b/crates/swc/tests/tsc-references/classAbstractConstructor.2.minified.js deleted file mode 100644 index 4def23b2ae7..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractConstructor.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [classAbstractConstructor.ts] -//! -//! x `abstract` modifier can only appear on a class or method declaration -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract constructor() {} -//! : ^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractDeclarations.d.1.normal.js b/crates/swc/tests/tsc-references/classAbstractDeclarations.d.1.normal.js deleted file mode 100644 index c56c758f7ff..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractDeclarations.d.1.normal.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [classAbstractDeclarations.d.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare abstract class A { -//! 2 | abstract constructor() {} -//! : ^ -//! 3 | } -//! 4 | -//! 5 | declare abstract class AA { -//! `---- -//! -//! x `abstract` modifier can only appear on a class or method declaration -//! ,-[1:1] -//! 1 | declare abstract class A { -//! 2 | abstract constructor() {} -//! : ^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | declare abstract class AA { -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractDeclarations.d.2.minified.js b/crates/swc/tests/tsc-references/classAbstractDeclarations.d.2.minified.js deleted file mode 100644 index c56c758f7ff..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractDeclarations.d.2.minified.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [classAbstractDeclarations.d.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare abstract class A { -//! 2 | abstract constructor() {} -//! : ^ -//! 3 | } -//! 4 | -//! 5 | declare abstract class AA { -//! `---- -//! -//! x `abstract` modifier can only appear on a class or method declaration -//! ,-[1:1] -//! 1 | declare abstract class A { -//! 2 | abstract constructor() {} -//! : ^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | declare abstract class AA { -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations2.1.normal.js b/crates/swc/tests/tsc-references/classAbstractInstantiations2.1.normal.js deleted file mode 100644 index 04298607637..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractInstantiations2.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classAbstractInstantiations2.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[47:1] -//! 47 | } -//! 48 | -//! 49 | class H { // error -- not declared abstract -//! 50 | abstract baz() : number; -//! : ^^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractInstantiations2.2.minified.js b/crates/swc/tests/tsc-references/classAbstractInstantiations2.2.minified.js deleted file mode 100644 index 04298607637..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractInstantiations2.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classAbstractInstantiations2.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[47:1] -//! 47 | } -//! 48 | -//! 49 | class H { // error -- not declared abstract -//! 50 | abstract baz() : number; -//! : ^^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.1.normal.js b/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.1.normal.js deleted file mode 100644 index 28fec7130f0..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.1.normal.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [classAbstractMethodInNonAbstractClass.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[1:1] -//! 1 | class A { -//! 2 | abstract foo(); -//! : ^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | class B { -//! `---- -//! -//! x Abstract method cannot have an implementation. -//! ,-[3:1] -//! 3 | } -//! 4 | -//! 5 | class B { -//! 6 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[3:1] -//! 3 | } -//! 4 | -//! 5 | class B { -//! 6 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.2.minified.js b/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.2.minified.js deleted file mode 100644 index 28fec7130f0..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractMethodInNonAbstractClass.2.minified.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [classAbstractMethodInNonAbstractClass.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[1:1] -//! 1 | class A { -//! 2 | abstract foo(); -//! : ^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | class B { -//! `---- -//! -//! x Abstract method cannot have an implementation. -//! ,-[3:1] -//! 3 | } -//! 4 | -//! 5 | class B { -//! 6 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[3:1] -//! 3 | } -//! 4 | -//! 5 | class B { -//! 6 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.1.normal.js b/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.1.normal.js deleted file mode 100644 index bfd336fedfb..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [classAbstractMethodWithImplementation.ts] -//! -//! x Abstract method cannot have an implementation. -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.2.minified.js b/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.2.minified.js deleted file mode 100644 index bfd336fedfb..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractMethodWithImplementation.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [classAbstractMethodWithImplementation.ts] -//! -//! x Abstract method cannot have an implementation. -//! ,-[1:1] -//! 1 | abstract class A { -//! 2 | abstract foo() {} -//! : ^^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractProperties.1.normal.js b/crates/swc/tests/tsc-references/classAbstractProperties.1.normal.js deleted file mode 100644 index 876ed86c1ce..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractProperties.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [classAbstractProperties.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var A = function A() { - "use strict"; - _class_call_check(this, A); -}; diff --git a/crates/swc/tests/tsc-references/classAbstractProperties.2.minified.js b/crates/swc/tests/tsc-references/classAbstractProperties.2.minified.js deleted file mode 100644 index 88cf1b87dc2..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractProperties.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [classAbstractProperties.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.1.normal.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.1.normal.js deleted file mode 100644 index 7332235d475..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classAbstractUsingAbstractMethods2.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[1:1] -//! 1 | class A { -//! 2 | abstract foo(); -//! : ^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | class B extends A {} -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.2.minified.js b/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.2.minified.js deleted file mode 100644 index 7332235d475..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractUsingAbstractMethods2.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classAbstractUsingAbstractMethods2.ts] -//! -//! x Abstract methods can only appear within an abstract class. -//! ,-[1:1] -//! 1 | class A { -//! 2 | abstract foo(); -//! : ^^^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | class B extends A {} -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractWithInterface.1.normal.js b/crates/swc/tests/tsc-references/classAbstractWithInterface.1.normal.js deleted file mode 100644 index 5152a9386e7..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractWithInterface.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [classAbstractWithInterface.ts] -//! -//! x interface name is invalid -//! ,---- -//! 1 | abstract interface I {} -//! : ^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/classAbstractWithInterface.2.minified.js b/crates/swc/tests/tsc-references/classAbstractWithInterface.2.minified.js deleted file mode 100644 index 5152a9386e7..00000000000 --- a/crates/swc/tests/tsc-references/classAbstractWithInterface.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [classAbstractWithInterface.ts] -//! -//! x interface name is invalid -//! ,---- -//! 1 | abstract interface I {} -//! : ^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/classStaticBlock19.1.normal.js b/crates/swc/tests/tsc-references/classStaticBlock19.1.normal.js deleted file mode 100644 index 43aff4c9cc4..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock19.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classStaticBlock19.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | class C { -//! 2 | @decorator -//! : ^ -//! 3 | static { -//! 4 | // something -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classStaticBlock19.2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock19.2.minified.js deleted file mode 100644 index 43aff4c9cc4..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock19.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classStaticBlock19.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | class C { -//! 2 | @decorator -//! : ^ -//! 3 | static { -//! 4 | // something -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/classStaticBlock23.1.normal.js b/crates/swc/tests/tsc-references/classStaticBlock23.1.normal.js deleted file mode 100644 index 4a745ee1acb..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock23.1.normal.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [classStaticBlock23.ts] -const nums = [ - 1, - 2, - 3 -].map((n)=>Promise.resolve(n)); -class C { - static{ - for await (const nn of nums){ - console.log(nn); - } - } -} -async function foo() { - class C { - static{ - for await (const nn of nums){ - console.log(nn); - } - } - } -} diff --git a/crates/swc/tests/tsc-references/classStaticBlock23.2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock23.2.minified.js deleted file mode 100644 index 9c5a5115b29..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock23.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [classStaticBlock23.ts] -const nums = [ - 1, - 2, - 3 -].map((n)=>Promise.resolve(n)); -class C { - static{ - for await (let nn of nums)console.log(nn); - } -} diff --git a/crates/swc/tests/tsc-references/classStaticBlock8.1.normal.js b/crates/swc/tests/tsc-references/classStaticBlock8.1.normal.js deleted file mode 100644 index 43826058f0b..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock8.1.normal.js +++ /dev/null @@ -1,59 +0,0 @@ -//// [classStaticBlock8.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -function foo(v) { - label: while(v){ - var C = function C() { - "use strict"; - _class_call_check(this, C); - }; - var __ = { - writable: true, - value: function() { - if (v === 1) { - break label; - } - if (v === 2) { - continue label; - } - if (v === 3) { - break; - } - if (v === 4) { - continue; - } - }() - }; - if (v === 5) { - break label; - } - if (v === 6) { - continue label; - } - if (v === 7) { - break; - } - if (v === 8) { - continue; - } - } - var C1 = function C() { - "use strict"; - _class_call_check(this, C); - }; - var __1 = { - writable: true, - value: function() { - outer: break outer; // valid - loop: while(v){ - if (v === 1) break loop; // valid - if (v === 2) continue loop; // valid - if (v === 3) break; // valid - if (v === 4) continue; // valid - } - switch(v){ - default: - break; // valid - } - }() - }; -} diff --git a/crates/swc/tests/tsc-references/classStaticBlock8.2.minified.js b/crates/swc/tests/tsc-references/classStaticBlock8.2.minified.js deleted file mode 100644 index e5adc0453ff..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlock8.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [classStaticBlock8.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.1.normal.js b/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.1.normal.js deleted file mode 100644 index 9fadd536d3d..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [classStaticBlockUseBeforeDef1.ts] -class C { - static{ - this.x = 1; - } - static y = this.x; - static{ - this.z = this.y; - } -} diff --git a/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.2.minified.js b/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.2.minified.js deleted file mode 100644 index 9fadd536d3d..00000000000 --- a/crates/swc/tests/tsc-references/classStaticBlockUseBeforeDef1.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [classStaticBlockUseBeforeDef1.ts] -class C { - static{ - this.x = 1; - } - static y = this.x; - static{ - this.z = this.y; - } -} diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.1.normal.js deleted file mode 100644 index d322be5c891..00000000000 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.1.normal.js +++ /dev/null @@ -1,76 +0,0 @@ -//// [comparisonOperatorWithIdenticalPrimitiveType.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -var a; -var b; -var c; -var d; -var e; -// operator < -var ra1 = a < a; -var ra2 = b < b; -var ra3 = c < c; -var ra4 = d < d; -var ra5 = e < e; -var ra6 = null < null; -var ra7 = undefined < undefined; -// operator > -var rb1 = a > a; -var rb2 = b > b; -var rb3 = c > c; -var rb4 = d > d; -var rb5 = e > e; -var rb6 = null > null; -var rb7 = undefined > undefined; -// operator <= -var rc1 = a <= a; -var rc2 = b <= b; -var rc3 = c <= c; -var rc4 = d <= d; -var rc5 = e <= e; -var rc6 = null <= null; -var rc7 = undefined <= undefined; -// operator >= -var rd1 = a >= a; -var rd2 = b >= b; -var rd3 = c >= c; -var rd4 = d >= d; -var rd5 = e >= e; -var rd6 = null >= null; -var rd7 = undefined >= undefined; -// operator == -var re1 = a == a; -var re2 = b == b; -var re3 = c == c; -var re4 = d == d; -var re5 = e == e; -var re6 = null == null; -var re7 = undefined == undefined; -// operator != -var rf1 = a != a; -var rf2 = b != b; -var rf3 = c != c; -var rf4 = d != d; -var rf5 = e != e; -var rf6 = null != null; -var rf7 = undefined != undefined; -// operator === -var rg1 = a === a; -var rg2 = b === b; -var rg3 = c === c; -var rg4 = d === d; -var rg5 = e === e; -var rg6 = null === null; -var rg7 = undefined === undefined; -// operator !== -var rh1 = a !== a; -var rh2 = b !== b; -var rh3 = c !== c; -var rh4 = d !== d; -var rh5 = e !== e; -var rh6 = null !== null; -var rh7 = undefined !== undefined; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.2.minified.js deleted file mode 100644 index c8579361c56..00000000000 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithIdenticalPrimitiveType.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [comparisonOperatorWithIdenticalPrimitiveType.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js new file mode 100644 index 00000000000..4f5b0ecbbe7 --- /dev/null +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.1.normal.js @@ -0,0 +1,4 @@ +//// [comparisonOperatorWithNumberOperand.ts] +// repro #52036 +t1 >= 0 // error +; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js new file mode 100644 index 00000000000..30d6f81e34a --- /dev/null +++ b/crates/swc/tests/tsc-references/comparisonOperatorWithNumberOperand.2.minified.js @@ -0,0 +1,2 @@ +//// [comparisonOperatorWithNumberOperand.ts] +t1; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.1.normal.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.1.normal.js deleted file mode 100644 index 7be79d06b00..00000000000 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.1.normal.js +++ /dev/null @@ -1,152 +0,0 @@ -//// [comparisonOperatorWithOneOperandIsNull.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -function foo(t) { - var foo_r1 = t < null; - var foo_r2 = t > null; - var foo_r3 = t <= null; - var foo_r4 = t >= null; - var foo_r5 = t == null; - var foo_r6 = t != null; - var foo_r7 = t === null; - var foo_r8 = t !== null; - var foo_r1 = null < t; - var foo_r2 = null > t; - var foo_r3 = null <= t; - var foo_r4 = null >= t; - var foo_r5 = null == t; - var foo_r6 = null != t; - var foo_r7 = null === t; - var foo_r8 = null !== t; -} -var a; -var b; -var c; -var d; -var e; -var f; -var g; -// operator < -var r1a1 = null < a; -var r1a2 = null < b; -var r1a3 = null < c; -var r1a4 = null < d; -var r1a5 = null < e; -var r1a6 = null < f; -var r1a7 = null < g; -var r1b1 = a < null; -var r1b2 = b < null; -var r1b3 = c < null; -var r1b4 = d < null; -var r1b5 = e < null; -var r1b6 = f < null; -var r1b7 = g < null; -// operator > -var r2a1 = null > a; -var r2a2 = null > b; -var r2a3 = null > c; -var r2a4 = null > d; -var r2a5 = null > e; -var r2a6 = null > f; -var r2a7 = null > g; -var r2b1 = a > null; -var r2b2 = b > null; -var r2b3 = c > null; -var r2b4 = d > null; -var r2b5 = e > null; -var r2b6 = f > null; -var r2b7 = g > null; -// operator <= -var r3a1 = null <= a; -var r3a2 = null <= b; -var r3a3 = null <= c; -var r3a4 = null <= d; -var r3a5 = null <= e; -var r3a6 = null <= f; -var r3a7 = null <= g; -var r3b1 = a <= null; -var r3b2 = b <= null; -var r3b3 = c <= null; -var r3b4 = d <= null; -var r3b5 = e <= null; -var r3b6 = f <= null; -var r3b7 = g <= null; -// operator >= -var r4a1 = null >= a; -var r4a2 = null >= b; -var r4a3 = null >= c; -var r4a4 = null >= d; -var r4a5 = null >= e; -var r4a6 = null >= f; -var r4a7 = null >= g; -var r4b1 = a >= null; -var r4b2 = b >= null; -var r4b3 = c >= null; -var r4b4 = d >= null; -var r4b5 = e >= null; -var r4b6 = f >= null; -var r4b7 = g >= null; -// operator == -var r5a1 = null == a; -var r5a2 = null == b; -var r5a3 = null == c; -var r5a4 = null == d; -var r5a5 = null == e; -var r5a6 = null == f; -var r5a7 = null == g; -var r5b1 = a == null; -var r5b2 = b == null; -var r5b3 = c == null; -var r5b4 = d == null; -var r5b5 = e == null; -var r5b6 = f == null; -var r5b7 = g == null; -// operator != -var r6a1 = null != a; -var r6a2 = null != b; -var r6a3 = null != c; -var r6a4 = null != d; -var r6a5 = null != e; -var r6a6 = null != f; -var r6a7 = null != g; -var r6b1 = a != null; -var r6b2 = b != null; -var r6b3 = c != null; -var r6b4 = d != null; -var r6b5 = e != null; -var r6b6 = f != null; -var r6b7 = g != null; -// operator === -var r7a1 = null === a; -var r7a2 = null === b; -var r7a3 = null === c; -var r7a4 = null === d; -var r7a5 = null === e; -var r7a6 = null === f; -var r7a7 = null === g; -var r7b1 = a === null; -var r7b2 = b === null; -var r7b3 = c === null; -var r7b4 = d === null; -var r7b5 = e === null; -var r7b6 = f === null; -var r7b7 = g === null; -// operator !== -var r8a1 = null !== a; -var r8a2 = null !== b; -var r8a3 = null !== c; -var r8a4 = null !== d; -var r8a5 = null !== e; -var r8a6 = null !== f; -var r8a7 = null !== g; -var r8b1 = a !== null; -var r8b2 = b !== null; -var r8b3 = c !== null; -var r8b4 = d !== null; -var r8b5 = e !== null; -var r8b6 = f !== null; -var r8b7 = g !== null; diff --git a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.2.minified.js b/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.2.minified.js deleted file mode 100644 index dc9e36588c2..00000000000 --- a/crates/swc/tests/tsc-references/comparisonOperatorWithOneOperandIsNull.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [comparisonOperatorWithOneOperandIsNull.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.1.normal.js deleted file mode 100644 index 358e91df739..00000000000 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.1.normal.js +++ /dev/null @@ -1,28 +0,0 @@ -//// [compoundArithmeticAssignmentLHSCanBeAssigned.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -var a; -var b; -var c; -var x1; -x1 *= a; -x1 *= b; -x1 *= c; -x1 *= null; -x1 *= undefined; -var x2; -x2 *= a; -x2 *= b; -x2 *= c; -x2 *= null; -x2 *= undefined; -var x3; -x3 *= a; -x3 *= b; -x3 *= c; -x3 *= null; -x3 *= undefined; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.2.minified.js deleted file mode 100644 index 48114687327..00000000000 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentLHSCanBeAssigned.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [compoundArithmeticAssignmentLHSCanBeAssigned.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.1.normal.js deleted file mode 100644 index ea9141ea6b4..00000000000 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.1.normal.js +++ /dev/null @@ -1,58 +0,0 @@ -//// [compoundArithmeticAssignmentWithInvalidOperands.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -var x1; -x1 *= a; -x1 *= b; -x1 *= true; -x1 *= 0; -x1 *= ""; -x1 *= E.a; -x1 *= {}; -x1 *= null; -x1 *= undefined; -var x2; -x2 *= a; -x2 *= b; -x2 *= true; -x2 *= 0; -x2 *= ""; -x2 *= E.a; -x2 *= {}; -x2 *= null; -x2 *= undefined; -var x3; -x3 *= a; -x3 *= b; -x3 *= true; -x3 *= 0; -x3 *= ""; -x3 *= E.a; -x3 *= {}; -x3 *= null; -x3 *= undefined; -var x4; -x4 *= a; -x4 *= b; -x4 *= true; -x4 *= 0; -x4 *= ""; -x4 *= E.a; -x4 *= {}; -x4 *= null; -x4 *= undefined; -var x5; -x5 *= b; -x5 *= true; -x5 *= ""; -x5 *= {}; -var x6; -x6 *= b; -x6 *= true; -x6 *= ""; -x6 *= {}; diff --git a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.2.minified.js deleted file mode 100644 index bd2c3407ae1..00000000000 --- a/crates/swc/tests/tsc-references/compoundArithmeticAssignmentWithInvalidOperands.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [compoundArithmeticAssignmentWithInvalidOperands.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), E.a, E.a, E.a, E.a; diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.1.normal.js deleted file mode 100644 index 442958dd0b8..00000000000 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.1.normal.js +++ /dev/null @@ -1,28 +0,0 @@ -//// [compoundExponentiationAssignmentLHSCanBeAssigned1.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -var a; -var b; -var c; -var x1; -x1 = Math.pow(x1, a); -x1 = Math.pow(x1, b); -x1 = Math.pow(x1, c); -x1 = Math.pow(x1, null); -x1 = Math.pow(x1, undefined); -var x2; -x2 = Math.pow(x2, a); -x2 = Math.pow(x2, b); -x2 = Math.pow(x2, c); -x2 = Math.pow(x2, null); -x2 = Math.pow(x2, undefined); -var x3; -x3 = Math.pow(x3, a); -x3 = Math.pow(x3, b); -x3 = Math.pow(x3, c); -x3 = Math.pow(x3, null); -x3 = Math.pow(x3, undefined); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.2.minified.js deleted file mode 100644 index 00377112b50..00000000000 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCanBeAssigned1.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [compoundExponentiationAssignmentLHSCanBeAssigned1.ts] -var E, a, b, c, x1, x2, x3; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})), x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1, a), b), c), null), void 0), x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2, a), b), c), null), void 0), x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3, a), b), c), null), void 0); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.1.normal.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.1.normal.js deleted file mode 100644 index afc200bfe78..00000000000 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.1.normal.js +++ /dev/null @@ -1,58 +0,0 @@ -//// [compoundExponentiationAssignmentLHSCannotBeAssigned.ts] -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -var x1; -x1 = Math.pow(x1, a); -x1 = Math.pow(x1, b); -x1 = Math.pow(x1, true); -x1 = Math.pow(x1, 0); -x1 = Math.pow(x1, ""); -x1 = Math.pow(x1, E.a); -x1 = Math.pow(x1, {}); -x1 = Math.pow(x1, null); -x1 = Math.pow(x1, undefined); -var x2; -x2 = Math.pow(x2, a); -x2 = Math.pow(x2, b); -x2 = Math.pow(x2, true); -x2 = Math.pow(x2, 0); -x2 = Math.pow(x2, ""); -x2 = Math.pow(x2, E.a); -x2 = Math.pow(x2, {}); -x2 = Math.pow(x2, null); -x2 = Math.pow(x2, undefined); -var x3; -x3 = Math.pow(x3, a); -x3 = Math.pow(x3, b); -x3 = Math.pow(x3, true); -x3 = Math.pow(x3, 0); -x3 = Math.pow(x3, ""); -x3 = Math.pow(x3, E.a); -x3 = Math.pow(x3, {}); -x3 = Math.pow(x3, null); -x3 = Math.pow(x3, undefined); -var x4; -x4 = Math.pow(x4, a); -x4 = Math.pow(x4, b); -x4 = Math.pow(x4, true); -x4 = Math.pow(x4, 0); -x4 = Math.pow(x4, ""); -x4 = Math.pow(x4, E.a); -x4 = Math.pow(x4, {}); -x4 = Math.pow(x4, null); -x4 = Math.pow(x4, undefined); -var x5; -x5 = Math.pow(x5, b); -x5 = Math.pow(x5, true); -x5 = Math.pow(x5, ""); -x5 = Math.pow(x5, {}); -var x6; -x6 = Math.pow(x6, b); -x6 = Math.pow(x6, true); -x6 = Math.pow(x6, ""); -x6 = Math.pow(x6, {}); diff --git a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.2.minified.js b/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.2.minified.js deleted file mode 100644 index 3ee1677269f..00000000000 --- a/crates/swc/tests/tsc-references/compoundExponentiationAssignmentLHSCannotBeAssigned.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [compoundExponentiationAssignmentLHSCannotBeAssigned.ts] -var E, a, b, x1, x2, x3, x4, x5, x6; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1 = Math.pow(x1, a), b), !0), 0), ""), E.a), {}), null), void 0), x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2 = Math.pow(x2, a), b), !0), 0), ""), E.a), {}), null), void 0), x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3 = Math.pow(x3, a), b), !0), 0), ""), E.a), {}), null), void 0), x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4 = Math.pow(x4, a), b), !0), 0), ""), E.a), {}), null), void 0), x5 = Math.pow(x5 = Math.pow(x5 = Math.pow(x5 = Math.pow(x5, b), !0), ""), {}), x6 = Math.pow(x6 = Math.pow(x6 = Math.pow(x6 = Math.pow(x6, b), !0), ""), {}); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.1.normal.js deleted file mode 100644 index 2136c4297af..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [computedPropertyNames12_ES5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var s; -var n; -var a; -var _n = n, _ref = s + n, _ref1 = "hello ".concat(a, " bye"); -var C = function C() { - "use strict"; - _class_call_check(this, C); - this[_n] = n; - this[_ref] = 2; - this["hello bye"] = 0; -}; -C[_ref1] = 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.2.minified.js deleted file mode 100644 index fddb4553c6d..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames12_ES5.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [computedPropertyNames12_ES5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.1.normal.js deleted file mode 100644 index aa1a9c8bb19..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames12_ES6.ts] -var s; -var n; -var a; -let _n = n, _ref = s + n, _ref1 = `hello ${a} bye`; -class C { - constructor(){ - this[_n] = n; - this[_ref] = 2; - this[`hello bye`] = 0; - } -} -C[_ref1] = 0; diff --git a/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.2.minified.js deleted file mode 100644 index 2476c54faba..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames12_ES6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNames12_ES6.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.1.normal.js deleted file mode 100644 index d7721b84185..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.1.normal.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [computedPropertyNames35_ES5.ts] -function foo() { - return ""; -} diff --git a/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.2.minified.js deleted file mode 100644 index d6ff4a5c2de..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames35_ES5.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNames35_ES5.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.1.normal.js deleted file mode 100644 index 462a5d8bffc..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.1.normal.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [computedPropertyNames35_ES6.ts] -function foo() { - return ''; -} diff --git a/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.2.minified.js deleted file mode 100644 index ce136d81f32..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames35_ES6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNames35_ES6.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.1.normal.js deleted file mode 100644 index 8c142444651..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.1.normal.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [computedPropertyNames3_ES5.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.2.minified.js deleted file mode 100644 index 8c142444651..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames3_ES5.2.minified.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [computedPropertyNames3_ES5.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.1.normal.js deleted file mode 100644 index c9fa76a737d..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.1.normal.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [computedPropertyNames3_ES6.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.2.minified.js deleted file mode 100644 index c9fa76a737d..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames3_ES6.2.minified.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [computedPropertyNames3_ES6.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | class C { -//! 3 | [0 + 1]() { } -//! 4 | static [() => { }]() { } -//! 5 | get [delete id]() { } -//! : ^^ -//! 6 | set [[0, 1]](v) { } -//! 7 | static get [""]() { } -//! 8 | static set [id.toString()](v) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.1.normal.js deleted file mode 100644 index 944cf959123..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames49_ES5.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[7:1] -//! 7 | get [1 + 1]() { -//! 8 | return 10; -//! 9 | }, -//! 10 | set [1 + 1]() { -//! : ^^^^^^^ -//! 11 | // just throw -//! 12 | throw 10; -//! 13 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.2.minified.js deleted file mode 100644 index 944cf959123..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames49_ES5.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames49_ES5.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[7:1] -//! 7 | get [1 + 1]() { -//! 8 | return 10; -//! 9 | }, -//! 10 | set [1 + 1]() { -//! : ^^^^^^^ -//! 11 | // just throw -//! 12 | throw 10; -//! 13 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.1.normal.js deleted file mode 100644 index c78940403f4..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames49_ES6.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[7:1] -//! 7 | get [1 + 1]() { -//! 8 | return 10; -//! 9 | }, -//! 10 | set [1 + 1]() { -//! : ^^^^^^^ -//! 11 | // just throw -//! 12 | throw 10; -//! 13 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.2.minified.js deleted file mode 100644 index c78940403f4..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames49_ES6.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames49_ES6.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[7:1] -//! 7 | get [1 + 1]() { -//! 8 | return 10; -//! 9 | }, -//! 10 | set [1 + 1]() { -//! : ^^^^^^^ -//! 11 | // just throw -//! 12 | throw 10; -//! 13 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.1.normal.js deleted file mode 100644 index 8c4105b6e88..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames50_ES5.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[9:1] -//! 9 | get [1 + 1]() { -//! 10 | throw 10; -//! 11 | }, -//! 12 | set [1 + 1]() { -//! : ^^^^^^^ -//! 13 | // just throw -//! 14 | throw 10; -//! 15 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.2.minified.js deleted file mode 100644 index 8c4105b6e88..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames50_ES5.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames50_ES5.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[9:1] -//! 9 | get [1 + 1]() { -//! 10 | throw 10; -//! 11 | }, -//! 12 | set [1 + 1]() { -//! : ^^^^^^^ -//! 13 | // just throw -//! 14 | throw 10; -//! 15 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.1.normal.js deleted file mode 100644 index 53186d58eaf..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames50_ES6.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[9:1] -//! 9 | get [1 + 1]() { -//! 10 | throw 10; -//! 11 | }, -//! 12 | set [1 + 1]() { -//! : ^^^^^^^ -//! 13 | // just throw -//! 14 | throw 10; -//! 15 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.2.minified.js deleted file mode 100644 index 53186d58eaf..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames50_ES6.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNames50_ES6.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[9:1] -//! 9 | get [1 + 1]() { -//! 10 | throw 10; -//! 11 | }, -//! 12 | set [1 + 1]() { -//! : ^^^^^^^ -//! 13 | // just throw -//! 14 | throw 10; -//! 15 | }, -//! `---- diff --git a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).1.normal.js deleted file mode 100644 index 75d53a8cb5f..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [computedPropertyNames52.js] -const array = []; -for(let i = 0; i < 10; ++i){ - let _i, _i1; - var _C; - array.push((_i = i, _i1 = i, _C = class C { - constructor(){ - this[_i] = ()=>C; - } - }, _C[_i1] = 100, _C)); -} diff --git a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).2.minified.js deleted file mode 100644 index f8d6fa6fcf9..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es2015).2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [computedPropertyNames52.js] -const array = []; -for(let i = 0; i < 10; ++i){ - var _C; - let _i, _i1; - array.push((_i = i, _i1 = i, (_C = class C { - constructor(){ - this[_i] = ()=>C; - } - })[_i1] = 100, _C)); -} diff --git a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).1.normal.js deleted file mode 100644 index 2d3781f6fc8..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [computedPropertyNames52.js] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var _loop = function(i) { - var _i = void 0, _i1 = void 0; - var _C; - array.push((_i = i, _i1 = i, _C = function C() { - "use strict"; - _class_call_check(this, C); - this[_i] = function() { - return C; - }; - }, _C[_i1] = 100, _C)); -}; -var array = []; -for(var i = 0; i < 10; ++i)_loop(i); diff --git a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).2.minified.js deleted file mode 100644 index e09aa71b490..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNames52(target=es5).2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [computedPropertyNames52.js] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -for(var array = [], i = 0; i < 10; ++i)!function(i) { - var _C, _i = void 0, _i1 = void 0; - array.push((_i = i, _i1 = i, (_C = function C() { - "use strict"; - _class_call_check(this, C), this[_i] = function() { - return C; - }; - })[_i1] = 100, _C)); -}(i); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.1.normal.js deleted file mode 100644 index 1ec8bd4804d..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit3_ES5.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.2.minified.js deleted file mode 100644 index 1ec8bd4804d..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES5.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit3_ES5.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.1.normal.js deleted file mode 100644 index a35b811d0f0..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit3_ES6.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.2.minified.js deleted file mode 100644 index a35b811d0f0..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit3_ES6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit3_ES6.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.1.normal.js deleted file mode 100644 index 2a1c6d48856..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit4_ES5.ts] -var v; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.2.minified.js deleted file mode 100644 index c7ef654627f..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES5.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit4_ES5.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.1.normal.js deleted file mode 100644 index b8dc6c9a710..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit4_ES6.ts] -var v; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.2.minified.js deleted file mode 100644 index d05cd89d28b..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesDeclarationEmit4_ES6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesDeclarationEmit4_ES6.ts] diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.1.normal.js deleted file mode 100644 index fc2c0b59eb6..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [computedPropertyNamesOnOverloads_ES5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var methodName = "method"; -var accessorName = "accessor"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - var _proto = C.prototype; - _proto[methodName] = function(v) {}; - return C; -}(); diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.2.minified.js deleted file mode 100644 index 1d0b3566143..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES5.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [computedPropertyNamesOnOverloads_ES5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.1.normal.js b/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.1.normal.js deleted file mode 100644 index 3f3056589f7..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [computedPropertyNamesOnOverloads_ES6.ts] -var methodName = "method"; -var accessorName = "accessor"; -class C { - [methodName](v) {} -} diff --git a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.2.minified.js b/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.2.minified.js deleted file mode 100644 index 5c0f2ff163b..00000000000 --- a/crates/swc/tests/tsc-references/computedPropertyNamesOnOverloads_ES6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [computedPropertyNamesOnOverloads_ES6.ts] diff --git a/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.1.normal.js b/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.1.normal.js deleted file mode 100644 index d22184c3168..00000000000 --- a/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.1.normal.js +++ /dev/null @@ -1,85 +0,0 @@ -//// [conditionalOperatorConditionIsObjectType.ts] -//Cond ? Expr1 : Expr2, Cond is of object type, Expr1 and Expr2 have the same type -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var condObject; -var exprAny1; -var exprBoolean1; -var exprNumber1; -var exprString1; -var exprIsObject1; -var exprAny2; -var exprBoolean2; -var exprNumber2; -var exprString2; -var exprIsObject2; -function foo() {} -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; -//Cond is an object type variable -condObject ? exprAny1 : exprAny2; -condObject ? exprBoolean1 : exprBoolean2; -condObject ? exprNumber1 : exprNumber2; -condObject ? exprString1 : exprString2; -condObject ? exprIsObject1 : exprIsObject2; -condObject ? exprString1 : exprBoolean1; // union -//Cond is an object type literal -(function(a) { - return a.length; -}) ? exprAny1 : exprAny2; -(function(a) { - return a.length; -}) ? exprBoolean1 : exprBoolean2; -({}) ? exprNumber1 : exprNumber2; -({ - a: 1, - b: "s" -}) ? exprString1 : exprString2; -({ - a: 1, - b: "s" -}) ? exprIsObject1 : exprIsObject2; -({ - a: 1, - b: "s" -}) ? exprString1 : exprBoolean1; // union -//Cond is an object type expression -foo() ? exprAny1 : exprAny2; -new Date() ? exprBoolean1 : exprBoolean2; -new C() ? exprNumber1 : exprNumber2; -C.doIt() ? exprString1 : exprString2; -condObject.valueOf() ? exprIsObject1 : exprIsObject2; -new Date() ? exprString1 : exprBoolean1; // union -//Results shoud be same as Expr1 and Expr2 -var resultIsAny1 = condObject ? exprAny1 : exprAny2; -var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; -var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; -var resultIsString1 = condObject ? exprString1 : exprString2; -var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean1 = condObject ? exprString1 : exprBoolean1; // union -var resultIsAny2 = function(a) { - return a.length; -} ? exprAny1 : exprAny2; -var resultIsBoolean2 = function(a) { - return a.length; -} ? exprBoolean1 : exprBoolean2; -var resultIsNumber2 = {} ? exprNumber1 : exprNumber2; -var resultIsString2 = { - a: 1, - b: "s" -} ? exprString1 : exprString2; -var resultIsObject2 = { - a: 1, - b: "s" -} ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean2 = { - a: 1, - b: "s" -} ? exprString1 : exprBoolean1; // union -var resultIsAny3 = foo() ? exprAny1 : exprAny2; -var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; -var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; -var resultIsString3 = C.doIt() ? exprString1 : exprString2; -var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union diff --git a/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.2.minified.js b/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.2.minified.js deleted file mode 100644 index ab279c5ef6e..00000000000 --- a/crates/swc/tests/tsc-references/conditionalOperatorConditionIsObjectType.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [conditionalOperatorConditionIsObjectType.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var condObject, C = function C() { - "use strict"; - _class_call_check(this, C); -}; -new C(), C.doIt(), condObject.valueOf(), new C(), C.doIt(), condObject.valueOf(), C.doIt(); diff --git a/crates/swc/tests/tsc-references/constAssertions.1.normal.js b/crates/swc/tests/tsc-references/constAssertions.1.normal.js deleted file mode 100644 index 8bdd40a0ed0..00000000000 --- a/crates/swc/tests/tsc-references/constAssertions.1.normal.js +++ /dev/null @@ -1,170 +0,0 @@ -//// [constAssertions.ts] -let v1 = 'abc'; -let v2 = `abc`; -let v3 = 10; -let v4 = -10; -let v5 = +10; -let v6 = 10n; -let v7 = -10n; -let v8 = true; -let v9 = false; -let c1 = 'abc'; -let c2 = `abc`; -let c3 = 10; -let c4 = -10; -let c5 = +10; -let c6 = 10n; -let c7 = -10n; -let c8 = true; -let c9 = false; -let vv1 = v1; -let vc1 = c1; -let a1 = []; -let a2 = [ - 1, - 2, - 3 -]; -let a3 = [ - 10, - 'hello', - true -]; -let a4 = [ - ...[ - 1, - 2, - 3 - ] -]; -let a5 = [ - 1, - 2, - 3 -]; -let a6 = [ - ...a5 -]; -let a7 = [ - ...a6 -]; -let a8 = [ - 'abc', - ...a7 -]; -let a9 = [ - ...a8 -]; -let o1 = { - x: 10, - y: 20 -}; -let o2 = { - a: 1, - 'b': 2, - ['c']: 3, - d () {}, - ['e' + '']: 4 -}; -let o3 = { - ...o1, - ...o2 -}; -let o4 = { - a: 1, - b: 2 -}; -let o5 = { - ...o4 -}; -let o6 = { - ...o5 -}; -let o7 = { - ...d -}; -let o8 = { - ...o7 -}; -let o9 = { - x: 10, - foo () { - this.x = 20; - } -}; // Error -let p1 = 10; -let p2 = -10; -let p3 = [ - 10 -]; -let p4 = [ - [ - [ - [ - 10 - ] - ] - ] -]; -let x1 = { - x: 10, - y: [ - 20, - 30 - ], - z: { - a: { - b: 42 - } - } -}; -let q1 = 10; -let q2 = 'abc'; -let q3 = true; -let q4 = [ - 1, - 2, - 3 -]; -let q5 = { - x: 10, - y: 20 -}; -let e1 = v1; // Error -let e2 = true ? 1 : 0; // Error -let e3 = id(1); // Error -let t1 = 'foo'; -let t2 = 'bar'; -let t3 = `${t1}-${t2}`; -let t4 = `${`(${t1})`}-${`(${t2})`}`; -function ff1(x, y) { - return `${x}-${y}`; -} -function ff2(x, y) { - return `${x}-${y}`; -} -const ts1 = ff2('foo', 'bar'); -const ts2 = ff2('foo', !!true ? '0' : '1'); -const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); -function ff3(x, y) { - return `${x}${y}`; -} -function ff4(verify, contentMatches) { - const action = verify ? `verify` : `write`; - const contentMatch = contentMatches ? `match` : `nonMatch`; - const outcome = `${action}_${contentMatch}`; - return outcome; -} -function ff5(verify, contentMatches) { - const action = verify ? `verify` : `write`; - const contentMatch = contentMatches ? `match` : `nonMatch`; - const outcome = `${action}_${contentMatch}`; - return outcome; -} -function accessorNames(propName) { - return [ - `get-${propName}`, - `set-${propName}` - ]; -} -const ns1 = accessorNames('foo'); diff --git a/crates/swc/tests/tsc-references/constAssertions.2.minified.js b/crates/swc/tests/tsc-references/constAssertions.2.minified.js deleted file mode 100644 index 28d76367b15..00000000000 --- a/crates/swc/tests/tsc-references/constAssertions.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [constAssertions.ts] -function ff2(x, y) { - return `${x}-${y}`; -} -d, id(1), ff2('foo', 'bar'), ff2('foo', '0'), ff2('top', 'left'); diff --git a/crates/swc/tests/tsc-references/constEnum2.1.normal.js b/crates/swc/tests/tsc-references/constEnum2.1.normal.js new file mode 100644 index 00000000000..72e6c34f7d3 --- /dev/null +++ b/crates/swc/tests/tsc-references/constEnum2.1.normal.js @@ -0,0 +1,13 @@ +//// [constEnum2.ts] +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. +// Error : not a constant enum expression +var CONST = 9000 % 2; +var D; +(function(D) { + D[D["d"] = 10] = "d"; + D[D["e"] = 199 * Math.floor(Math.random() * 1000)] = "e"; + D[D["f"] = 10 - 100 * Math.floor(Math.random() % 8)] = "f"; + D[D["g"] = CONST] = "g"; +})(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/constEnum2.2.minified.js b/crates/swc/tests/tsc-references/constEnum2.2.minified.js new file mode 100644 index 00000000000..18d3688a8bb --- /dev/null +++ b/crates/swc/tests/tsc-references/constEnum2.2.minified.js @@ -0,0 +1,5 @@ +//// [constEnum2.ts] +var D; +!function(D) { + D[D.d = 10] = "d", D[D.e = 199 * Math.floor(1000 * Math.random())] = "e", D[D.f = 10 - 100 * Math.floor(Math.random() % 8)] = "f", D[D.g = 0] = "g"; +}(D || (D = {})); diff --git a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js new file mode 100644 index 00000000000..833edcb16d5 --- /dev/null +++ b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.1.normal.js @@ -0,0 +1,26 @@ +//// [constructorFunctionMethodTypeParameters.js] +/** + * @template {string} T + * @param {T} t + */ function Cls(t) { + this.t = t; +} +/** + * @template {string} V + * @param {T} t + * @param {V} v + * @return {V} + */ Cls.prototype.topLevelComment = function(t, v) { + return v; +}; +Cls.prototype.nestedComment = /** + * @template {string} U + * @param {T} t + * @param {U} u + * @return {T} + */ function(t, u) { + return t; +}; +var c = new Cls("a"); +var s = c.topLevelComment("a", "b"); +var t = c.nestedComment("a", "b"); diff --git a/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js new file mode 100644 index 00000000000..8adfba6d3df --- /dev/null +++ b/crates/swc/tests/tsc-references/constructorFunctionMethodTypeParameters.2.minified.js @@ -0,0 +1,11 @@ +//// [constructorFunctionMethodTypeParameters.js] +function Cls(t) { + this.t = t; +} +Cls.prototype.topLevelComment = function(t, v) { + return v; +}, Cls.prototype.nestedComment = function(t, u) { + return t; +}; +var c = new Cls("a"); +c.topLevelComment("a", "b"), c.nestedComment("a", "b"); diff --git a/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js b/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js new file mode 100644 index 00000000000..02bd4c9b963 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowBindingElement.1.normal.js @@ -0,0 +1,72 @@ +//// [controlFlowBindingElement.ts] +{ + var data = { + param: "value" + }; + var _data_param = data.param, param = _data_param === void 0 ? function() { + throw new Error("param is not defined"); + }() : _data_param; + console.log(param); // should not trigger 'Unreachable code detected.' +}{ + var data1 = { + param: "value" + }; + var foo = ""; + var _data_param1 = data1.param, param1 = _data_param1 === void 0 ? function() { + throw new Error("param is not defined"); + }() : _data_param1; + foo; // should be string +}{ + var data2 = { + param: "value" + }; + var foo1 = ""; + var _data_param2 = data2.param, param2 = _data_param2 === void 0 ? function() { + foo1 = undefined; + }() : _data_param2; + foo1; // should be string | undefined +}{ + var data3 = { + param: "value" + }; + var foo2 = ""; + var _data_param3 = data3.param, param3 = _data_param3 === void 0 ? function() { + return "" + 1; + }() : _data_param3; + foo2; // should be string +}{ + var foo3; + var window = {}; + window.window = window; + var _window_ = window[function() { + foo3 = ""; + return "window"; + }()], bar = _window_[function() { + return "window"; + }()]; + foo3; // should be string +}{ + var foo4; + var window1 = {}; + window1.window = window1; + var _window_1 = window1[function() { + return "window"; + }()], bar1 = _window_1[function() { + foo4 = ""; + return "window"; + }()]; + foo4; // should be string +}{ + var foo5; + var window2 = {}; + window2.window = window2; + var _window_2 = window2[function() { + return "window"; + }()], tmp = _window_2[function() { + return "window"; + }()], bar2 = tmp === void 0 ? function() { + foo5 = ""; + return window2; + }() : tmp; + foo5; // should be string | undefined +} diff --git a/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js b/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js new file mode 100644 index 00000000000..6195e8b0441 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowBindingElement.2.minified.js @@ -0,0 +1,11 @@ +//// [controlFlowBindingElement.ts] +var _data_param = "value"; +console.log(void 0 === _data_param ? function() { + throw Error("param is not defined"); +}() : _data_param); +var window = {}; +window.window = window, window.window.window; +var window1 = {}; +window1.window = window1, window1.window.window; +var window2 = {}; +window2.window = window2, window2.window.window; diff --git a/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js b/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js index fdffc92de61..b04be1e832f 100644 --- a/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowGenericTypes.1.normal.js @@ -154,3 +154,6 @@ function update(control, key, value) { control[key] = value; } } +function getColumnProperty(column, key) { + return column[key]; +} diff --git a/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.1.normal.js b/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.1.normal.js new file mode 100644 index 00000000000..53e269d2e33 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.1.normal.js @@ -0,0 +1,434 @@ +//// [controlFlowIterationErrorsAsync.ts] +import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; +import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; +var cond; +function len(s) { + return _len.apply(this, arguments); +} +function _len() { + _len = _async_to_generator(function(s) { + return _ts_generator(this, function(_state) { + return [ + 2, + s.length + ]; + }); + }); + return _len.apply(this, arguments); +} +function f1() { + return _f1.apply(this, arguments); +} +function _f1() { + _f1 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = ""; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + return [ + 4, + len(x) + ]; + case 2: + x = _state.sent(); + x; + return [ + 3, + 1 + ]; + case 3: + x; + return [ + 2 + ]; + } + }); + }); + return _f1.apply(this, arguments); +} +function f2() { + return _f2.apply(this, arguments); +} +function _f2() { + _f2 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = ""; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + x; + return [ + 4, + len(x) + ]; + case 2: + x = _state.sent(); + return [ + 3, + 1 + ]; + case 3: + x; + return [ + 2 + ]; + } + }); + }); + return _f2.apply(this, arguments); +} +function g1() { + return _g1.apply(this, arguments); +} +function _g1() { + _g1 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = ""; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + return [ + 4, + foo(x) + ]; + case 2: + x = _state.sent(); + x; + return [ + 3, + 1 + ]; + case 3: + x; + return [ + 2 + ]; + } + }); + }); + return _g1.apply(this, arguments); +} +function g2() { + return _g2.apply(this, arguments); +} +function _g2() { + _g2 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = ""; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + x; + return [ + 4, + foo(x) + ]; + case 2: + x = _state.sent(); + return [ + 3, + 1 + ]; + case 3: + x; + return [ + 2 + ]; + } + }); + }); + return _g2.apply(this, arguments); +} +function asNumber(x) { + return _asNumber.apply(this, arguments); +} +function _asNumber() { + _asNumber = _async_to_generator(function(x) { + return _ts_generator(this, function(_state) { + return [ + 2, + +x + ]; + }); + }); + return _asNumber.apply(this, arguments); +} +function h1() { + return _h1.apply(this, arguments); +} +function _h1() { + _h1 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + x = "0"; + while(cond){ + x = +x + 1; + x; + } + return [ + 2 + ]; + }); + }); + return _h1.apply(this, arguments); +} +function h2() { + return _h2.apply(this, arguments); +} +function _h2() { + _h2 = _async_to_generator(function() { + var x; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = "0"; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + return [ + 4, + asNumber(x) + ]; + case 2: + x = _state.sent() + 1; + x; + return [ + 3, + 1 + ]; + case 3: + return [ + 2 + ]; + } + }); + }); + return _h2.apply(this, arguments); +} +function h3() { + return _h3.apply(this, arguments); +} +function _h3() { + _h3 = _async_to_generator(function() { + var x, y; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = "0"; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + return [ + 4, + asNumber(x) + ]; + case 2: + y = _state.sent(); + x = y + 1; + x; + return [ + 3, + 1 + ]; + case 3: + return [ + 2 + ]; + } + }); + }); + return _h3.apply(this, arguments); +} +function h4() { + return _h4.apply(this, arguments); +} +function _h4() { + _h4 = _async_to_generator(function() { + var x, y; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + x = "0"; + _state.label = 1; + case 1: + if (!cond) return [ + 3, + 3 + ]; + x; + return [ + 4, + asNumber(x) + ]; + case 2: + y = _state.sent(); + x = y + 1; + x; + return [ + 3, + 1 + ]; + case 3: + return [ + 2 + ]; + } + }); + }); + return _h4.apply(this, arguments); +} +function get_things(_) { + return _get_things.apply(this, arguments); +} +function _get_things() { + _get_things = // repro #51115 + _async_to_generator(function(_) { + return _ts_generator(this, function(_state) { + return [ + 2, + [ + 0 + ] + ]; + }); + }); + return _get_things.apply(this, arguments); +} +function foobar() { + return _foobar.apply(this, arguments); +} +function _foobar() { + _foobar = _async_to_generator(function() { + var before, i, results; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + before = undefined; + i = 0; + _state.label = 1; + case 1: + if (!(i < 2)) return [ + 3, + 4 + ]; + return [ + 4, + get_things(before) + ]; + case 2: + results = _state.sent(); + before = results[0]; + _state.label = 3; + case 3: + i++; + return [ + 3, + 1 + ]; + case 4: + return [ + 2 + ]; + } + }); + }); + return _foobar.apply(this, arguments); +} +/*#__PURE__*/ _async_to_generator(function() { + var bar, baz; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + bar = undefined; + _state.label = 1; + case 1: + return [ + 4, + foox(bar) + ]; + case 2: + baz = _state.sent(); + bar = baz; + _state.label = 3; + case 3: + if (bar) return [ + 3, + 1 + ]; + _state.label = 4; + case 4: + return [ + 2 + ]; + } + }); +}); +function myFunc() { + return _myFunc.apply(this, arguments); +} +function _myFunc() { + _myFunc = _async_to_generator(function() { + var lastId, entities; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + lastId = undefined; + _state.label = 1; + case 1: + if (!true) return [ + 3, + 3 + ]; + return [ + 4, + myQuery({ + lastId: lastId + }) + ]; + case 2: + entities = _state.sent().entities; + lastId = entities[entities.length - 1]; + return [ + 3, + 1 + ]; + case 3: + return [ + 2 + ]; + } + }); + }); + return _myFunc.apply(this, arguments); +} diff --git a/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.2.minified.js b/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.2.minified.js new file mode 100644 index 00000000000..41e55226cd4 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowIterationErrorsAsync.2.minified.js @@ -0,0 +1,3 @@ +//// [controlFlowIterationErrorsAsync.ts] +import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; +import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; diff --git a/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js b/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js index 3042390257f..57c7d1ea0fc 100644 --- a/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js +++ b/crates/swc/tests/tsc-references/controlFlowOptionalChain.1.normal.js @@ -480,3 +480,12 @@ while(((_arr_i = arr[i]) === null || _arr_i === void 0 ? void 0 : _arr_i.tag) == console.log("I should ALSO be reachable"); } } +function f50(obj) { + var _obj_main; + for(var key in (_obj_main = obj.main) === null || _obj_main === void 0 ? void 0 : _obj_main.childs){ + if (obj.main.childs[key] === obj) { + return obj; + } + } + return null; +} diff --git a/crates/swc/tests/tsc-references/controlFlowParameter.1.normal.js b/crates/swc/tests/tsc-references/controlFlowParameter.1.normal.js new file mode 100644 index 00000000000..f1fcd88dd50 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowParameter.1.normal.js @@ -0,0 +1,23 @@ +//// [controlFlowParameter.ts] +function f1() { + var required = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() { + throw new Error("bad"); + }(); + console.log("ok"); // should not trigger 'Unreachable code detected.' +} +function f2(a) { + var required = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { + a = 1; + }(); + a; // should be number | string | undefined +} +function f3() { + var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, required = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { + a = ""; + }(); + a; // should be number | string +} +function f4() { + var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, b = _ref[a = ""]; + a; // should be string +} diff --git a/crates/swc/tests/tsc-references/controlFlowParameter.2.minified.js b/crates/swc/tests/tsc-references/controlFlowParameter.2.minified.js new file mode 100644 index 00000000000..f621c3d32b6 --- /dev/null +++ b/crates/swc/tests/tsc-references/controlFlowParameter.2.minified.js @@ -0,0 +1 @@ +//// [controlFlowParameter.ts] diff --git a/crates/swc/tests/tsc-references/declarationFileForJsonImport.1.normal.js b/crates/swc/tests/tsc-references/declarationFileForJsonImport.1.normal.js new file mode 100644 index 00000000000..0e58e34e67e --- /dev/null +++ b/crates/swc/tests/tsc-references/declarationFileForJsonImport.1.normal.js @@ -0,0 +1,6 @@ +//// [main.ts] +import data from "./data.json"; +var x = data; +//// [data.json] +{}//// [data.d.json.ts] +export default val; diff --git a/crates/swc/tests/tsc-references/declarationFileForJsonImport.2.minified.js b/crates/swc/tests/tsc-references/declarationFileForJsonImport.2.minified.js new file mode 100644 index 00000000000..4df3819b3cb --- /dev/null +++ b/crates/swc/tests/tsc-references/declarationFileForJsonImport.2.minified.js @@ -0,0 +1,5 @@ +//// [main.ts] +import "./data.json"; +//// [data.json] +//// [data.d.json.ts] +export default val; diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.1.normal.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.1.normal.js deleted file mode 100644 index 98be2456721..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.1.normal.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [a.ts] -define([ - "require", - "exports", - "@swc/helpers/src/_ts_decorate.mjs" -], function(require, exports, _tsDecorate) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>Foo - }); - _tsDecorate = _tsDecorate.default; - var decorator; - let Foo = class Foo { - }; - Foo = _tsDecorate([ - decorator - ], Foo); -}); -//// [b.ts] -define([ - "require", - "exports", - "@swc/helpers/src/_ts_decorate.mjs" -], function(require, exports, _tsDecorate) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>_class - }); - _tsDecorate = _tsDecorate.default; - var decorator; - let _class = class _class { - }; - _class = _tsDecorate([ - decorator - ], _class); -}); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.2.minified.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.2.minified.js deleted file mode 100644 index 1d95ee9484f..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedAmd.2.minified.js +++ /dev/null @@ -1,40 +0,0 @@ -//// [a.ts] -define([ - "require", - "exports", - "@swc/helpers/src/_ts_decorate.mjs" -], function(require, exports, _tsDecorate) { - "use strict"; - var decorator; - Object.defineProperty(exports, "__esModule", { - value: !0 - }), Object.defineProperty(exports, "default", { - enumerable: !0, - get: ()=>Foo - }), _tsDecorate = _tsDecorate.default; - let Foo = class { - }; - Foo = _tsDecorate([ - decorator - ], Foo); -}); -//// [b.ts] -define([ - "require", - "exports", - "@swc/helpers/src/_ts_decorate.mjs" -], function(require, exports, _tsDecorate) { - "use strict"; - var decorator; - Object.defineProperty(exports, "__esModule", { - value: !0 - }), Object.defineProperty(exports, "default", { - enumerable: !0, - get: ()=>_class - }), _tsDecorate = _tsDecorate.default; - let _class = class { - }; - _class = _tsDecorate([ - decorator - ], _class); -}); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.1.normal.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.1.normal.js deleted file mode 100644 index 7a8c6ce9eb3..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.1.normal.js +++ /dev/null @@ -1,32 +0,0 @@ -//// [a.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>Foo -}); -const _tsDecorate = require("@swc/helpers/lib/_ts_decorate.js").default; -var decorator; -let Foo = class Foo { -}; -Foo = _tsDecorate([ - decorator -], Foo); -//// [b.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>_class -}); -const _tsDecorate = require("@swc/helpers/lib/_ts_decorate.js").default; -var decorator; -let _class = class _class { -}; -_class = _tsDecorate([ - decorator -], _class); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.2.minified.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.2.minified.js deleted file mode 100644 index f5bee64fbf7..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedCommonjs.2.minified.js +++ /dev/null @@ -1,30 +0,0 @@ -//// [a.ts] -"use strict"; -var decorator; -Object.defineProperty(exports, "__esModule", { - value: !0 -}), Object.defineProperty(exports, "default", { - enumerable: !0, - get: ()=>Foo -}); -const _tsDecorate = require("@swc/helpers/lib/_ts_decorate.js").default; -let Foo = class { -}; -Foo = _tsDecorate([ - decorator -], Foo); -//// [b.ts] -"use strict"; -var decorator; -Object.defineProperty(exports, "__esModule", { - value: !0 -}), Object.defineProperty(exports, "default", { - enumerable: !0, - get: ()=>_class -}); -const _tsDecorate = require("@swc/helpers/lib/_ts_decorate.js").default; -let _class = class { -}; -_class = _tsDecorate([ - decorator -], _class); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.1.normal.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.1.normal.js deleted file mode 100644 index 2d525325468..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [a.ts] -System.register([ - "@swc/helpers/src/_ts_decorate.mjs" -], function(_export, _context) { - "use strict"; - var _ts_decorate, decorator, Foo; - return { - setters: [ - function(_tsDecorate) { - _ts_decorate = _tsDecorate.default; - } - ], - execute: function() { - _export("default", Foo = class Foo { - }); - _export("default", Foo = _ts_decorate([ - decorator - ], Foo)); - } - }; -}); -//// [b.ts] -System.register([ - "@swc/helpers/src/_ts_decorate.mjs" -], function(_export, _context) { - "use strict"; - var _ts_decorate, decorator, _class; - return { - setters: [ - function(_tsDecorate) { - _ts_decorate = _tsDecorate.default; - } - ], - execute: function() { - _export("default", _class = class _class { - }); - _export("default", _class = _ts_decorate([ - decorator - ], _class)); - } - }; -}); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.2.minified.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.2.minified.js deleted file mode 100644 index 0818b0c1432..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedSystem.2.minified.js +++ /dev/null @@ -1,40 +0,0 @@ -//// [a.ts] -System.register([ - "@swc/helpers/src/_ts_decorate.mjs" -], function(_export, _context) { - "use strict"; - var _ts_decorate, decorator, Foo; - return { - setters: [ - function(_tsDecorate) { - _ts_decorate = _tsDecorate.default; - } - ], - execute: function() { - _export("default", Foo = class { - }), _export("default", Foo = _ts_decorate([ - decorator - ], Foo)); - } - }; -}); -//// [b.ts] -System.register([ - "@swc/helpers/src/_ts_decorate.mjs" -], function(_export, _context) { - "use strict"; - var _ts_decorate, decorator, _class; - return { - setters: [ - function(_tsDecorate) { - _ts_decorate = _tsDecorate.default; - } - ], - execute: function() { - _export("default", _class = class { - }), _export("default", _class = _ts_decorate([ - decorator - ], _class)); - } - }; -}); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.1.normal.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.1.normal.js deleted file mode 100644 index 256265970f9..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.1.normal.js +++ /dev/null @@ -1,50 +0,0 @@ -//// [a.ts] -(function(global, factory) { - if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("@swc/helpers/src/_ts_decorate.mjs")); - else if (typeof define === "function" && define.amd) define([ - "exports", - "@swc/helpers/src/_ts_decorate.mjs" - ], factory); - else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(global.aTs = {}, global.tsDecorateMjs); -})(this, function(exports, _tsDecorate) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>Foo - }); - _tsDecorate = _tsDecorate.default; - var decorator; - let Foo = class Foo { - }; - Foo = _tsDecorate([ - decorator - ], Foo); -}); -//// [b.ts] -(function(global, factory) { - if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("@swc/helpers/src/_ts_decorate.mjs")); - else if (typeof define === "function" && define.amd) define([ - "exports", - "@swc/helpers/src/_ts_decorate.mjs" - ], factory); - else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(global.bTs = {}, global.tsDecorateMjs); -})(this, function(exports, _tsDecorate) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "default", { - enumerable: true, - get: ()=>_class - }); - _tsDecorate = _tsDecorate.default; - var decorator; - let _class = class _class { - }; - _class = _tsDecorate([ - decorator - ], _class); -}); diff --git a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.2.minified.js b/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.2.minified.js deleted file mode 100644 index 5edded9efe5..00000000000 --- a/crates/swc/tests/tsc-references/decoratedDefaultExportsGetExportedUmd.2.minified.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [a.ts] -!function(global, factory) { - "object" == typeof module && "object" == typeof module.exports ? factory(exports, require("@swc/helpers/src/_ts_decorate.mjs")) : "function" == typeof define && define.amd ? define([ - "exports", - "@swc/helpers/src/_ts_decorate.mjs" - ], factory) : (global = "undefined" != typeof globalThis ? globalThis : global || self) && factory(global.aTs = {}, global.tsDecorateMjs); -}(this, function(exports1, _tsDecorate) { - "use strict"; - var decorator; - Object.defineProperty(exports1, "__esModule", { - value: !0 - }), Object.defineProperty(exports1, "default", { - enumerable: !0, - get: ()=>Foo - }), _tsDecorate = _tsDecorate.default; - let Foo = class { - }; - Foo = _tsDecorate([ - decorator - ], Foo); -}); -//// [b.ts] -!function(global, factory) { - "object" == typeof module && "object" == typeof module.exports ? factory(exports, require("@swc/helpers/src/_ts_decorate.mjs")) : "function" == typeof define && define.amd ? define([ - "exports", - "@swc/helpers/src/_ts_decorate.mjs" - ], factory) : (global = "undefined" != typeof globalThis ? globalThis : global || self) && factory(global.bTs = {}, global.tsDecorateMjs); -}(this, function(exports1, _tsDecorate) { - "use strict"; - var decorator; - Object.defineProperty(exports1, "__esModule", { - value: !0 - }), Object.defineProperty(exports1, "default", { - enumerable: !0, - get: ()=>_class - }), _tsDecorate = _tsDecorate.default; - let _class = class { - }; - _class = _tsDecorate([ - decorator - ], _class); -}); diff --git a/crates/swc/tests/tsc-references/decoratorCallGeneric.1.normal.js b/crates/swc/tests/tsc-references/decoratorCallGeneric.1.normal.js deleted file mode 100644 index 9adf2ceba44..00000000000 --- a/crates/swc/tests/tsc-references/decoratorCallGeneric.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [decoratorCallGeneric.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -function dec(c) {} -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - C.m = function m() {}; - return C; -}(); -C = _ts_decorate([ - dec -], C); diff --git a/crates/swc/tests/tsc-references/decoratorCallGeneric.2.minified.js b/crates/swc/tests/tsc-references/decoratorCallGeneric.2.minified.js deleted file mode 100644 index 1eeef06a20a..00000000000 --- a/crates/swc/tests/tsc-references/decoratorCallGeneric.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [decoratorCallGeneric.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var C = function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - return C.m = function() {}, C; -}(); -C = _ts_decorate([ - function(c) {} -], C); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass1.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass1.es6.1.normal.js deleted file mode 100644 index 0fa0129f10d..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass1.es6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [decoratorOnClass1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class C { -}; -C = _ts_decorate([ - dec -], C); -let c = new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass1.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass1.es6.2.minified.js deleted file mode 100644 index 1ee8eb6f2ac..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass1.es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [decoratorOnClass1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class { -}; -new (C = _ts_decorate([ - dec -], C))(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass2.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass2.es6.1.normal.js deleted file mode 100644 index 1b9d470d279..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass2.es6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [decoratorOnClass2.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -export let C = class C { -}; -C = _ts_decorate([ - dec -], C); -let c = new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass2.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass2.es6.2.minified.js deleted file mode 100644 index 165c4ba5c79..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass2.es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [decoratorOnClass2.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -export let C = class { -}; -C = _ts_decorate([ - dec -], C), new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass3.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass3.es6.1.normal.js deleted file mode 100644 index a4548a2e098..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass3.es6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [decoratorOnClass3.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class C { -}; -C = _ts_decorate([ - dec -], C); -let c = new C(); -export { C as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass3.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass3.es6.2.minified.js deleted file mode 100644 index a2432134e5e..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass3.es6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [decoratorOnClass3.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class { -}; -C = _ts_decorate([ - dec -], C), new C(); -export { C as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass4.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass4.es6.1.normal.js deleted file mode 100644 index 2e4e8f5ba37..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass4.es6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [decoratorOnClass4.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let _class = class _class { -}; -_class = _ts_decorate([ - dec -], _class); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass4.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass4.es6.2.minified.js deleted file mode 100644 index 1ef5e679a36..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass4.es6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [decoratorOnClass4.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let _class = class { -}; -_class = _ts_decorate([ - dec -], _class); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass5.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass5.es6.1.normal.js deleted file mode 100644 index 14163cc5a03..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass5.es6.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [decoratorOnClass5.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C; -let C = (_C = class C1 { - static x() { - return C.y; - } -}, _C.y = 1, _C); -C = _ts_decorate([ - dec -], C); -let c = new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass5.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass5.es6.2.minified.js deleted file mode 100644 index 1b52fddab14..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass5.es6.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [decoratorOnClass5.es6.ts] -var _C; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = ((_C = class { - static x() { - return C.y; - } -}).y = 1, _C); -new (C = _ts_decorate([ - dec -], C))(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass6.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass6.es6.1.normal.js deleted file mode 100644 index 5719c09dc8a..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass6.es6.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [decoratorOnClass6.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C; -export let C = (_C = class C1 { - static x() { - return C.y; - } -}, _C.y = 1, _C); -C = _ts_decorate([ - dec -], C); -let c = new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass6.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass6.es6.2.minified.js deleted file mode 100644 index 4bed23224cb..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass6.es6.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [decoratorOnClass6.es6.ts] -var _C; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -export let C = ((_C = class { - static x() { - return C.y; - } -}).y = 1, _C); -C = _ts_decorate([ - dec -], C), new C(); diff --git a/crates/swc/tests/tsc-references/decoratorOnClass7.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass7.es6.1.normal.js deleted file mode 100644 index 41d75dbc747..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass7.es6.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [decoratorOnClass7.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C; -let C = (_C = class C1 { - static x() { - return C.y; - } -}, _C.y = 1, _C); -C = _ts_decorate([ - dec -], C); -let c = new C(); -export { C as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass7.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass7.es6.2.minified.js deleted file mode 100644 index fbd125f9df2..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass7.es6.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [decoratorOnClass7.es6.ts] -var _C; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = ((_C = class { - static x() { - return C.y; - } -}).y = 1, _C); -C = _ts_decorate([ - dec -], C), new C(); -export { C as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass8.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClass8.es6.1.normal.js deleted file mode 100644 index 5eed8a5bc52..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass8.es6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [decoratorOnClass8.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var __class; -let _class = (__class = class _class { -}, __class.y = 1, __class); -_class = _ts_decorate([ - dec -], _class); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClass8.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClass8.es6.2.minified.js deleted file mode 100644 index 88d9db9a79d..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClass8.es6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [decoratorOnClass8.es6.ts] -var __class; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let _class = ((__class = class { -}).y = 1, __class); -_class = _ts_decorate([ - dec -], _class); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.1.normal.js deleted file mode 100644 index 2e6c181ce70..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [decoratorOnClassAccessor1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -class _class { - get accessor() { - return 1; - } -} -export { _class as default }; -_ts_decorate([ - dec -], _class.prototype, "accessor", null); diff --git a/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.2.minified.js deleted file mode 100644 index c0421db84a4..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassAccessor1.es6.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [decoratorOnClassAccessor1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -class _class { - get accessor() { - return 1; - } -} -_ts_decorate([ - dec -], _class.prototype, "accessor", null); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.1.normal.js deleted file mode 100644 index de46999b7f2..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [decoratorOnClassMethod1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -class _class { - method() {} -} -export { _class as default }; -_ts_decorate([ - dec -], _class.prototype, "method", null); diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.2.minified.js deleted file mode 100644 index eca2218739b..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassMethod1.es6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [decoratorOnClassMethod1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -class _class { - method() {} -} -_ts_decorate([ - dec -], _class.prototype, "method", null); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.1.normal.js deleted file mode 100644 index f2273320ff3..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [decoratorOnClassMethodParameter1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -import _ts_param from "@swc/helpers/src/_ts_param.mjs"; -class _class { - method(p) {} -} -export { _class as default }; -_ts_decorate([ - _ts_param(0, dec) -], _class.prototype, "method", null); diff --git a/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.2.minified.js deleted file mode 100644 index 5eecf3be621..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassMethodParameter1.es6.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [decoratorOnClassMethodParameter1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -import _ts_param from "@swc/helpers/src/_ts_param.mjs"; -class _class { - method(p) {} -} -_ts_decorate([ - _ts_param(0, dec) -], _class.prototype, "method", null); -export { _class as default }; diff --git a/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.1.normal.js b/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.1.normal.js deleted file mode 100644 index 55b32dc2d11..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [decoratorOnClassProperty1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -export default class _class { -} -_ts_decorate([ - dec -], _class.prototype, "prop", void 0); diff --git a/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.2.minified.js b/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.2.minified.js deleted file mode 100644 index 55b32dc2d11..00000000000 --- a/crates/swc/tests/tsc-references/decoratorOnClassProperty1.es6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [decoratorOnClassProperty1.es6.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -export default class _class { -} -_ts_decorate([ - dec -], _class.prototype, "prop", void 0); diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js deleted file mode 100644 index 51fda06876c..00000000000 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js +++ /dev/null @@ -1,231 +0,0 @@ -//// [decrementOperatorWithAnyOtherTypeInvalidOperations.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[34:1] -//! 34 | var ResultIsNumber10 = obj1--; -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = --{}; -//! : ^^ -//! 38 | var ResultIsNumber12 = --null; -//! 39 | var ResultIsNumber13 = --undefined; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[35:1] -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = --{}; -//! 38 | var ResultIsNumber12 = --null; -//! : ^^^^ -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[38:1] -//! 38 | var ResultIsNumber12 = --null; -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! : ^^^^ -//! 42 | var ResultIsNumber15 = {}--; -//! 43 | var ResultIsNumber16 = undefined--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[39:1] -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! 42 | var ResultIsNumber15 = {}--; -//! : ^^ -//! 43 | var ResultIsNumber16 = undefined--; -//! 44 | -//! 45 | // any type expressions -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[43:1] -//! 43 | var ResultIsNumber16 = undefined--; -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! : ^^^^^ -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[44:1] -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! : ^^^^^^^ -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[45:1] -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! : ^^^^^^^^^^^^^^^^^^ -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! 51 | var ResultIsNumber22 = --obj1.x; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[46:1] -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! : ^^^^^^^^^^^^^ -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[47:1] -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[51:1] -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! : ^^^^^ -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[52:1] -//! 52 | var ResultIsNumber23 = --obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! : ^^^^^^^ -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[53:1] -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! : ^^^^^^^^^^^^^^^^^^ -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! 59 | var ResultIsNumber29 = obj1.x--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[54:1] -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! : ^^^^^^^^^^^^^ -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! 59 | var ResultIsNumber29 = obj1.x--; -//! 60 | var ResultIsNumber30 = obj1.y--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[55:1] -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 59 | var ResultIsNumber29 = obj1.x--; -//! 60 | var ResultIsNumber30 = obj1.y--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[64:1] -//! 64 | -//! 65 | ANY2--; -//! 66 | -//! 67 | --ANY1--; -//! : ^^^^^^ -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[65:1] -//! 65 | ANY2--; -//! 66 | -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! : ^^^^^^ -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[66:1] -//! 66 | -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! : ^^^^^^ -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[67:1] -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! : ^^^^^^^^^ -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[68:1] -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! : ^^^^^^^^^ -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[69:1] -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js deleted file mode 100644 index 51fda06876c..00000000000 --- a/crates/swc/tests/tsc-references/decrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js +++ /dev/null @@ -1,231 +0,0 @@ -//// [decrementOperatorWithAnyOtherTypeInvalidOperations.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[34:1] -//! 34 | var ResultIsNumber10 = obj1--; -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = --{}; -//! : ^^ -//! 38 | var ResultIsNumber12 = --null; -//! 39 | var ResultIsNumber13 = --undefined; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[35:1] -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = --{}; -//! 38 | var ResultIsNumber12 = --null; -//! : ^^^^ -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[38:1] -//! 38 | var ResultIsNumber12 = --null; -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! : ^^^^ -//! 42 | var ResultIsNumber15 = {}--; -//! 43 | var ResultIsNumber16 = undefined--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[39:1] -//! 39 | var ResultIsNumber13 = --undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null--; -//! 42 | var ResultIsNumber15 = {}--; -//! : ^^ -//! 43 | var ResultIsNumber16 = undefined--; -//! 44 | -//! 45 | // any type expressions -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[43:1] -//! 43 | var ResultIsNumber16 = undefined--; -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! : ^^^^^ -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[44:1] -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! : ^^^^^^^ -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[45:1] -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! : ^^^^^^^^^^^^^^^^^^ -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! 51 | var ResultIsNumber22 = --obj1.x; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[46:1] -//! 46 | var ResultIsNumber17 = --foo(); -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! : ^^^^^^^^^^^^^ -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[47:1] -//! 47 | var ResultIsNumber18 = --A.foo(); -//! 48 | var ResultIsNumber19 = --(null + undefined); -//! 49 | var ResultIsNumber20 = --(null + null); -//! 50 | var ResultIsNumber21 = --(undefined + undefined); -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[51:1] -//! 51 | var ResultIsNumber22 = --obj1.x; -//! 52 | var ResultIsNumber23 = --obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! : ^^^^^ -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[52:1] -//! 52 | var ResultIsNumber23 = --obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! : ^^^^^^^ -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[53:1] -//! 53 | -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! : ^^^^^^^^^^^^^^^^^^ -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! 59 | var ResultIsNumber29 = obj1.x--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[54:1] -//! 54 | var ResultIsNumber24 = foo()--; -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! : ^^^^^^^^^^^^^ -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! 59 | var ResultIsNumber29 = obj1.x--; -//! 60 | var ResultIsNumber30 = obj1.y--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[55:1] -//! 55 | var ResultIsNumber25 = A.foo()--; -//! 56 | var ResultIsNumber26 = (null + undefined)--; -//! 57 | var ResultIsNumber27 = (null + null)--; -//! 58 | var ResultIsNumber28 = (undefined + undefined)--; -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 59 | var ResultIsNumber29 = obj1.x--; -//! 60 | var ResultIsNumber30 = obj1.y--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[64:1] -//! 64 | -//! 65 | ANY2--; -//! 66 | -//! 67 | --ANY1--; -//! : ^^^^^^ -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[65:1] -//! 65 | ANY2--; -//! 66 | -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! : ^^^^^^ -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[66:1] -//! 66 | -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! : ^^^^^^ -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[67:1] -//! 67 | --ANY1--; -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! : ^^^^^^^^^ -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[68:1] -//! 68 | --ANY1++; -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! : ^^^^^^^^^ -//! 72 | ++ANY2[0]--; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[69:1] -//! 69 | ++ANY1--; -//! 70 | --ANY2[0]--; -//! 71 | --ANY2[0]++; -//! 72 | ++ANY2[0]--; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.1.normal.js deleted file mode 100644 index 5aec0e84e9f..00000000000 --- a/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.1.normal.js +++ /dev/null @@ -1,83 +0,0 @@ -//// [deleteOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^^^^^^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x Expression expected -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x Expression expected -//! ,-[5:1] -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! : ^ -//! 9 | -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[5:1] -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! : ^ -//! 9 | -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! `---- -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[10:1] -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! 12 | constructor(public s: () => {}) { -//! 13 | delete s; //expect error -//! : ^ -//! 14 | } -//! 15 | } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[10:1] -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! 12 | constructor(public s: () => {}) { -//! 13 | delete s; //expect error -//! : ^ -//! 14 | } -//! 15 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.2.minified.js deleted file mode 100644 index 5aec0e84e9f..00000000000 --- a/crates/swc/tests/tsc-references/deleteOperatorInvalidOperations.2.minified.js +++ /dev/null @@ -1,83 +0,0 @@ -//// [deleteOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^^^^^^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x Expression expected -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[2:1] -//! 2 | var ANY; -//! 3 | -//! 4 | // operand before delete operator -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! : ^ -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! `---- -//! -//! x Expression expected -//! ,-[5:1] -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! : ^ -//! 9 | -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[5:1] -//! 5 | var BOOLEAN1 = ANY delete ; //expect error -//! 6 | -//! 7 | // miss an operand -//! 8 | var BOOLEAN2 = delete ; -//! : ^ -//! 9 | -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! `---- -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[10:1] -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! 12 | constructor(public s: () => {}) { -//! 13 | delete s; //expect error -//! : ^ -//! 14 | } -//! 15 | } -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[10:1] -//! 10 | // delete global variable s -//! 11 | class testADelx { -//! 12 | constructor(public s: () => {}) { -//! 13 | delete s; //expect error -//! : ^ -//! 14 | } -//! 15 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/dependentDestructuredVariables.1.normal.js b/crates/swc/tests/tsc-references/dependentDestructuredVariables.1.normal.js index fb784805065..3ff6b1b5da0 100644 --- a/crates/swc/tests/tsc-references/dependentDestructuredVariables.1.normal.js +++ b/crates/swc/tests/tsc-references/dependentDestructuredVariables.1.normal.js @@ -30,6 +30,24 @@ function f12({ kind , payload }) { payload; // never } } +// repro #50206 +function f13({ kind , payload }) { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } +} +function f14(t) { + const { kind , payload } = t; + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } +} function f20({ kind , payload }) { if (payload) { if (kind === 'A') { @@ -260,3 +278,6 @@ const fa3 = (guard, value)=>{ } } }; +const bot = new Client(); +bot.on("shardDisconnect", (event, shard)=>console.log(`Shard ${shard} disconnected (${event.code},${event.wasClean}): ${event.reason}`)); +bot.on("shardDisconnect", (event)=>console.log(`${event.code} ${event.wasClean} ${event.reason}`)); diff --git a/crates/swc/tests/tsc-references/dependentDestructuredVariables.2.minified.js b/crates/swc/tests/tsc-references/dependentDestructuredVariables.2.minified.js index 4c49a38b42a..ab3208e1b9d 100644 --- a/crates/swc/tests/tsc-references/dependentDestructuredVariables.2.minified.js +++ b/crates/swc/tests/tsc-references/dependentDestructuredVariables.2.minified.js @@ -29,3 +29,5 @@ reducer("add", { 4 ] }); +let bot = new Client(); +bot.on("shardDisconnect", (event, shard)=>console.log(`Shard ${shard} disconnected (${event.code},${event.wasClean}): ${event.reason}`)), bot.on("shardDisconnect", (event)=>console.log(`${event.code} ${event.wasClean} ${event.reason}`)); diff --git a/crates/swc/tests/tsc-references/derivedClassParameterProperties.1.normal.js b/crates/swc/tests/tsc-references/derivedClassParameterProperties.1.normal.js deleted file mode 100644 index d2572b1bb48..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassParameterProperties.1.normal.js +++ /dev/null @@ -1,155 +0,0 @@ -//// [derivedClassParameterProperties.ts] -// ordering of super calls in derived constructors matters depending on other class contents -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Base = function Base() { - "use strict"; - _class_call_check(this, Base); -}; -var Derived = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived, Base); - var _super = _create_super(Derived); - function Derived(y) { - _class_call_check(this, Derived); - var a = 1; - return _super.call(this); - } - return Derived; -}(Base); -var Derived2 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived2, Base); - var _super = _create_super(Derived2); - function Derived2(y) { - _class_call_check(this, Derived2); - var _this; - var a = 1; - _this = _super.call(this); - _this.y = y; - return _this; - } - return Derived2; -}(Base); -var Derived3 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived3, Base); - var _super = _create_super(Derived3); - function Derived3(y) { - _class_call_check(this, Derived3); - var _this; - _this = _super.call(this); - _this.y = y; - var a = 1; - return _this; - } - return Derived3; -}(Base); -var Derived4 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived4, Base); - var _super = _create_super(Derived4); - function Derived4(y) { - _class_call_check(this, Derived4); - var _this; - var b = 2; - _this = _super.call(this); - _this.a = 1; - return _this; - } - return Derived4; -}(Base); -var Derived5 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived5, Base); - var _super = _create_super(Derived5); - function Derived5(y) { - _class_call_check(this, Derived5); - var _this; - _this = _super.call(this); - _this.a = 1; - var b = 2; - return _this; - } - return Derived5; -}(Base); -var Derived6 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived6, Base); - var _super = _create_super(Derived6); - function Derived6(y) { - _class_call_check(this, Derived6); - var _this; - _this.a = 1; - var b = 2; - _this = _super.call(this); - return _this; - } - return Derived6; -}(Base); -var Derived7 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived7, Base); - var _super = _create_super(Derived7); - function Derived7(y) { - _class_call_check(this, Derived7); - var _this; - _this.a = 3; - _this.b = 3; - _this = _super.call(this); - _this.a = 1; - return _this; - } - return Derived7; -}(Base); -var Derived8 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived8, Base); - var _super = _create_super(Derived8); - function Derived8(y) { - _class_call_check(this, Derived8); - var _this; - _this = _super.call(this); - _this.a = 1; - _this.a = 3; - _this.b = 3; - return _this; - } - return Derived8; -}(Base); -// generic cases of Derived7 and Derived8 -var Base2 = function Base2() { - "use strict"; - _class_call_check(this, Base2); -}; -var Derived9 = /*#__PURE__*/ function(Base2) { - "use strict"; - _inherits(Derived9, Base2); - var _super = _create_super(Derived9); - function Derived9(y) { - _class_call_check(this, Derived9); - var _this; - _this.a = 3; - _this.b = 3; - _this = _super.call(this); - _this.a = 1; - return _this; - } - return Derived9; -}(Base2); -var Derived10 = /*#__PURE__*/ function(Base2) { - "use strict"; - _inherits(Derived10, Base2); - var _super = _create_super(Derived10); - function Derived10(y) { - _class_call_check(this, Derived10); - var _this; - _this = _super.call(this); - _this.a = 1; - _this.a = 3; - _this.b = 3; - return _this; - } - return Derived10; -}(Base2); diff --git a/crates/swc/tests/tsc-references/derivedClassParameterProperties.2.minified.js b/crates/swc/tests/tsc-references/derivedClassParameterProperties.2.minified.js deleted file mode 100644 index 867b728b80e..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassParameterProperties.2.minified.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [derivedClassParameterProperties.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.1.normal.js b/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.1.normal.js deleted file mode 100644 index bbfb6eb5517..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.1.normal.js +++ /dev/null @@ -1,64 +0,0 @@ -//// [derivedClassSuperCallsWithThisArg.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Base = function Base(a) { - "use strict"; - _class_call_check(this, Base); -}; -var Derived = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived, Base); - var _super = _create_super(Derived); - function Derived() { - _class_call_check(this, Derived); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); // ok - return _this; - } - return Derived; -}(Base); -var Derived2 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived2, Base); - var _super = _create_super(Derived2); - function Derived2(a) { - _class_call_check(this, Derived2); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); // error - _this.a = a; - return _this; - } - return Derived2; -}(Base); -var Derived3 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived3, Base); - var _super = _create_super(Derived3); - function Derived3(a) { - _class_call_check(this, Derived3); - var _this; - _this = _super.call(this, function() { - return _assert_this_initialized(_this); - }); // error - _this.a = a; - return _this; - } - return Derived3; -}(Base); -var Derived4 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived4, Base); - var _super = _create_super(Derived4); - function Derived4(a) { - _class_call_check(this, Derived4); - var _this; - _this = _super.call(this, function() { - return this; - }); // ok - _this.a = a; - return _this; - } - return Derived4; -}(Base); diff --git a/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.2.minified.js b/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.2.minified.js deleted file mode 100644 index f8589b1b612..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperCallsWithThisArg.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [derivedClassSuperCallsWithThisArg.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/derivedClassSuperProperties.1.normal.js b/crates/swc/tests/tsc-references/derivedClassSuperProperties.1.normal.js deleted file mode 100644 index d7fdacc710f..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperProperties.1.normal.js +++ /dev/null @@ -1,732 +0,0 @@ -//// [derivedClassSuperProperties.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_enumerable_properties from "@swc/helpers/src/_define_enumerable_properties.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var Base = /*#__PURE__*/ function() { - "use strict"; - function Base(a) { - _class_call_check(this, Base); - } - var _proto = Base.prototype; - _proto.receivesAnything = function receivesAnything(param1) {}; - return Base; -}(); -var Derived1 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived1, Base); - var _super = _create_super(Derived1); - function Derived1() { - _class_call_check(this, Derived1); - var _this; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived1.prototype)), "receivesAnything", _this).call(_this); - _this = _super.call(this); - _this.prop = true; - return _possible_constructor_return(_this); - } - return Derived1; -}(Base); -var Derived2 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived2, Base); - var _super = _create_super(Derived2); - function Derived2() { - _class_call_check(this, Derived2); - var _this; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived2.prototype)), "receivesAnything", _this).call(_this, _assert_this_initialized(_this)); - _this = _super.call(this); - _this.prop = true; - return _possible_constructor_return(_this); - } - return Derived2; -}(Base); -var Derived3 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived3, Base); - var _super = _create_super(Derived3); - function Derived3() { - _class_call_check(this, Derived3); - var _this; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived3.prototype)), "receivesAnything", _this).call(_this); - _this = _super.call(this, _assert_this_initialized(_this)); - _this.prop = true; - return _possible_constructor_return(_this); - } - return Derived3; -}(Base); -var Derived4 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived4, Base); - var _super = _create_super(Derived4); - function Derived4() { - _class_call_check(this, Derived4); - var _this; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived4.prototype)), "receivesAnything", _this).call(_this, _assert_this_initialized(_this)); - _this = _super.call(this, _assert_this_initialized(_this)); - _this.prop = true; - return _possible_constructor_return(_this); - } - return Derived4; -}(Base); -var Derived5 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived5, Base); - var _super = _create_super(Derived5); - function Derived5() { - _class_call_check(this, Derived5); - var _this; - _this = _super.call(this); - _this.prop = true; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived5.prototype)), "receivesAnything", _this).call(_this); - return _this; - } - return Derived5; -}(Base); -var Derived6 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived6, Base); - var _super = _create_super(Derived6); - function Derived6() { - _class_call_check(this, Derived6); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); - _this.prop = true; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived6.prototype)), "receivesAnything", _this).call(_this); - return _this; - } - return Derived6; -}(Base); -var Derived7 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived7, Base); - var _super = _create_super(Derived7); - function Derived7() { - _class_call_check(this, Derived7); - var _this; - _this = _super.call(this); - _this.prop = true; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived7.prototype)), "receivesAnything", _this).call(_this, _assert_this_initialized(_this)); - return _this; - } - return Derived7; -}(Base); -var Derived8 = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(Derived8, Base); - var _super = _create_super(Derived8); - function Derived8() { - _class_call_check(this, Derived8); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); - _this.prop = true; - _get((_assert_this_initialized(_this), _get_prototype_of(Derived8.prototype)), "receivesAnything", _this).call(_this, _assert_this_initialized(_this)); - return _this; - } - return Derived8; -}(Base); -var DerivedWithArrowFunction = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithArrowFunction, Base); - var _super = _create_super(DerivedWithArrowFunction); - function DerivedWithArrowFunction() { - _class_call_check(this, DerivedWithArrowFunction); - var _this; - (function() { - return _assert_this_initialized(_this); - })(); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithArrowFunction; -}(Base); -var DerivedWithArrowFunctionParameter = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithArrowFunctionParameter, Base); - var _super = _create_super(DerivedWithArrowFunctionParameter); - function DerivedWithArrowFunctionParameter() { - _class_call_check(this, DerivedWithArrowFunctionParameter); - var _this; - var lambda = function() { - var param1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _assert_this_initialized(_this); - }; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithArrowFunctionParameter; -}(Base); -var DerivedWithDecoratorOnClass = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithDecoratorOnClass, Base); - var _super = _create_super(DerivedWithDecoratorOnClass); - function DerivedWithDecoratorOnClass() { - _class_call_check(this, DerivedWithDecoratorOnClass); - var _this; - var InnerClass = function InnerClass() { - _class_call_check(this, InnerClass); - }; - InnerClass = _ts_decorate([ - decorate(_assert_this_initialized(_this)) - ], InnerClass); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithDecoratorOnClass; -}(Base); -var DerivedWithDecoratorOnClassMethod = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithDecoratorOnClassMethod, Base); - var _super = _create_super(DerivedWithDecoratorOnClassMethod); - function DerivedWithDecoratorOnClassMethod() { - _class_call_check(this, DerivedWithDecoratorOnClassMethod); - var _this; - var InnerClass = /*#__PURE__*/ function() { - function InnerClass() { - _class_call_check(this, InnerClass); - } - var _proto = InnerClass.prototype; - _proto.innerMethod = function innerMethod() {}; - return InnerClass; - }(); - _ts_decorate([ - decorate(_assert_this_initialized(_this)) - ], InnerClass.prototype, "innerMethod", null); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithDecoratorOnClassMethod; -}(Base); -var DerivedWithDecoratorOnClassProperty = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithDecoratorOnClassProperty, Base); - var _super = _create_super(DerivedWithDecoratorOnClassProperty); - function DerivedWithDecoratorOnClassProperty() { - _class_call_check(this, DerivedWithDecoratorOnClassProperty); - var _this; - var InnerClass = function InnerClass() { - _class_call_check(this, InnerClass); - this.innerProp = true; - }; - _ts_decorate([ - decorate(_assert_this_initialized(_this)) - ], InnerClass.prototype, "innerProp", void 0); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithDecoratorOnClassProperty; -}(Base); -var DerivedWithFunctionDeclaration = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithFunctionDeclaration, Base); - var _super = _create_super(DerivedWithFunctionDeclaration); - function DerivedWithFunctionDeclaration() { - _class_call_check(this, DerivedWithFunctionDeclaration); - var _this; - var declaration = function declaration() { - return this; - }; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithFunctionDeclaration; -}(Base); -var DerivedWithFunctionDeclarationAndThisParam = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithFunctionDeclarationAndThisParam, Base); - var _super = _create_super(DerivedWithFunctionDeclarationAndThisParam); - function DerivedWithFunctionDeclarationAndThisParam() { - _class_call_check(this, DerivedWithFunctionDeclarationAndThisParam); - var _this; - var declaration = function declaration() { - var param1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this; - return param1; - }; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithFunctionDeclarationAndThisParam; -}(Base); -var DerivedWithFunctionExpression = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithFunctionExpression, Base); - var _super = _create_super(DerivedWithFunctionExpression); - function DerivedWithFunctionExpression() { - _class_call_check(this, DerivedWithFunctionExpression); - var _this; - (function() { - return this; - })(); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithFunctionExpression; -}(Base); -var DerivedWithParenthesis = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithParenthesis, Base); - var _super = _create_super(DerivedWithParenthesis); - function DerivedWithParenthesis() { - _class_call_check(this, DerivedWithParenthesis); - var _this; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithParenthesis; -}(Base); -var DerivedWithParenthesisAfterStatement = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithParenthesisAfterStatement, Base); - var _super = _create_super(DerivedWithParenthesisAfterStatement); - function DerivedWithParenthesisAfterStatement() { - _class_call_check(this, DerivedWithParenthesisAfterStatement); - var _this; - _this.prop; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithParenthesisAfterStatement; -}(Base); -var DerivedWithParenthesisBeforeStatement = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithParenthesisBeforeStatement, Base); - var _super = _create_super(DerivedWithParenthesisBeforeStatement); - function DerivedWithParenthesisBeforeStatement() { - _class_call_check(this, DerivedWithParenthesisBeforeStatement); - var _this; - _this = _super.call(this); - _this.prop = true; - _this.prop; - return _this; - } - return DerivedWithParenthesisBeforeStatement; -}(Base); -var DerivedWithClassDeclaration = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithClassDeclaration, Base); - var _super = _create_super(DerivedWithClassDeclaration); - function DerivedWithClassDeclaration() { - _class_call_check(this, DerivedWithClassDeclaration); - var _this; - var InnerClass = /*#__PURE__*/ function() { - function InnerClass() { - _class_call_check(this, InnerClass); - this.property = 7; - this.property; - this.method(); - } - var _proto = InnerClass.prototype; - _proto.method = function method() { - return this; - }; - return InnerClass; - }(); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithClassDeclaration; -}(Base); -var DerivedWithClassDeclarationExtendingMember = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithClassDeclarationExtendingMember, Base); - var _super = _create_super(DerivedWithClassDeclarationExtendingMember); - function DerivedWithClassDeclarationExtendingMember() { - _class_call_check(this, DerivedWithClassDeclarationExtendingMember); - var _this; - var InnerClass = /*#__PURE__*/ function(_this_memberClass) { - _inherits(InnerClass, _this_memberClass); - var _super = _create_super(InnerClass); - function InnerClass() { - _class_call_check(this, InnerClass); - var _this; - _this = _super.call(this); - _this.property = 7; - _this.property; - _this.method(); - return _this; - } - var _proto = InnerClass.prototype; - _proto.method = function method() { - return this; - }; - return InnerClass; - }(_this.memberClass); - _this = _super.call(this); - _this.memberClass = function _class() { - _class_call_check(this, _class); - }; - return _possible_constructor_return(_this); - } - return DerivedWithClassDeclarationExtendingMember; -}(Base); -var DerivedWithClassExpression = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithClassExpression, Base); - var _super = _create_super(DerivedWithClassExpression); - function DerivedWithClassExpression() { - _class_call_check(this, DerivedWithClassExpression); - var _this; - console.log(/*#__PURE__*/ function() { - function _class() { - _class_call_check(this, _class); - this.property = 7; - this.property; - this.method(); - } - var _proto = _class.prototype; - _proto.method = function method() { - return this; - }; - return _class; - }()); - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithClassExpression; -}(Base); -var DerivedWithClassExpressionExtendingMember = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithClassExpressionExtendingMember, Base); - var _super = _create_super(DerivedWithClassExpressionExtendingMember); - function DerivedWithClassExpressionExtendingMember() { - _class_call_check(this, DerivedWithClassExpressionExtendingMember); - var _this; - console.log(/*#__PURE__*/ function(_this_memberClass) { - _inherits(_class, _this_memberClass); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - return _super.apply(this, arguments); - } - return _class; - }(_this.memberClass)); - _this = _super.call(this); - _this.memberClass = function _class() { - _class_call_check(this, _class); - }; - return _this; - } - return DerivedWithClassExpressionExtendingMember; -}(Base); -var DerivedWithDerivedClassExpression = /*#__PURE__*/ function(Base1) { - "use strict"; - _inherits(DerivedWithDerivedClassExpression, Base1); - var _super = _create_super(DerivedWithDerivedClassExpression); - function DerivedWithDerivedClassExpression() { - _class_call_check(this, DerivedWithDerivedClassExpression); - var _this; - console.log(/*#__PURE__*/ function(Base) { - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - _this = _super.call(this); - _this.bar = function() { - return _assert_this_initialized(_this); - }; - return _this; - } - var _proto = _class.prototype; - _proto.foo = function foo() { - return this; - }; - return _class; - }(Base)); - _this = _super.call(this); - _this.prop = true; - return _possible_constructor_return(_this); - } - return DerivedWithDerivedClassExpression; -}(Base); -var DerivedWithNewDerivedClassExpression = /*#__PURE__*/ function(Base1) { - "use strict"; - _inherits(DerivedWithNewDerivedClassExpression, Base1); - var _super = _create_super(DerivedWithNewDerivedClassExpression); - function DerivedWithNewDerivedClassExpression() { - _class_call_check(this, DerivedWithNewDerivedClassExpression); - var _this; - console.log(new /*#__PURE__*/ (function(Base) { - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - return _super.call(this); - } - return _class; - }(Base))()); - _this = _super.call(this); - _this.prop = true; - return _possible_constructor_return(_this); - } - return DerivedWithNewDerivedClassExpression; -}(Base); -var DerivedWithObjectAccessors = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectAccessors, Base); - var _super = _create_super(DerivedWithObjectAccessors); - function DerivedWithObjectAccessors() { - _class_call_check(this, DerivedWithObjectAccessors); - var _this; - var obj = { - get prop () { - return true; - }, - set prop (param){ - _this._prop = param; - } - }; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithObjectAccessors; -}(Base); -var DerivedWithObjectAccessorsUsingThisInKeys = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectAccessorsUsingThisInKeys, Base); - var _super = _create_super(DerivedWithObjectAccessorsUsingThisInKeys); - function DerivedWithObjectAccessorsUsingThisInKeys() { - _class_call_check(this, DerivedWithObjectAccessorsUsingThisInKeys); - var _this; - var _obj, _mutatorMap = {}; - var obj = (_obj = { - _prop: "prop" - }, _mutatorMap[_this.propName] = _mutatorMap[_this.propName] || {}, _mutatorMap[_this.propName].get = function() { - return true; - }, _mutatorMap[_this.propName] = _mutatorMap[_this.propName] || {}, _mutatorMap[_this.propName].set = function(param1) { - _this._prop = param1; - }, _define_enumerable_properties(_obj, _mutatorMap), _obj); - _this = _super.call(this); - _this.propName = "prop"; - return _this; - } - return DerivedWithObjectAccessorsUsingThisInKeys; -}(Base); -var DerivedWithObjectAccessorsUsingThisInBodies = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectAccessorsUsingThisInBodies, Base); - var _super = _create_super(DerivedWithObjectAccessorsUsingThisInBodies); - function DerivedWithObjectAccessorsUsingThisInBodies() { - _class_call_check(this, DerivedWithObjectAccessorsUsingThisInBodies); - var _this; - var obj = { - _prop: "prop", - get prop () { - return _this._prop; - }, - set prop (param){ - _this._prop = param; - } - }; - _this = _super.call(this); - _this.propName = "prop"; - return _this; - } - return DerivedWithObjectAccessorsUsingThisInBodies; -}(Base); -var DerivedWithObjectComputedPropertyBody = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectComputedPropertyBody, Base); - var _super = _create_super(DerivedWithObjectComputedPropertyBody); - function DerivedWithObjectComputedPropertyBody() { - _class_call_check(this, DerivedWithObjectComputedPropertyBody); - var _this; - var obj = { - prop: _this.propName - }; - _this = _super.call(this); - _this.propName = "prop"; - return _this; - } - return DerivedWithObjectComputedPropertyBody; -}(Base); -var DerivedWithObjectComputedPropertyName = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectComputedPropertyName, Base); - var _super = _create_super(DerivedWithObjectComputedPropertyName); - function DerivedWithObjectComputedPropertyName() { - _class_call_check(this, DerivedWithObjectComputedPropertyName); - var _this; - var obj = _define_property({}, _this.propName, true); - _this = _super.call(this); - _this.propName = "prop"; - return _this; - } - return DerivedWithObjectComputedPropertyName; -}(Base); -var DerivedWithObjectMethod = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(DerivedWithObjectMethod, Base); - var _super = _create_super(DerivedWithObjectMethod); - function DerivedWithObjectMethod() { - _class_call_check(this, DerivedWithObjectMethod); - var _this; - var obj = { - getProp: function getProp() { - return this; - } - }; - _this = _super.call(this); - _this.prop = true; - return _this; - } - return DerivedWithObjectMethod; -}(Base); -var a, b; -var DerivedWithLoops = [ - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - for(_temp = _this = _super.call(this), _this.prop = true, _temp;;){} - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - for(a; _temp = _this = _super.call(this), _this.prop = true, _temp;){} - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - for(a; b; _temp = _this = _super.call(this), _this.prop = true, _temp){} - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - for(;; _temp = _this = _super.call(this), _this.prop = true, _temp){ - break; - } - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; - try { - for(var _iterator = (_temp = _this = _super.call(this), _this.prop = true, _temp)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ - var x = _step.value; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally{ - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally{ - if (_didIteratorError) { - throw _iteratorError; - } - } - } - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - while(_temp = _this = _super.call(this), _this.prop = true, _temp){} - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - do {}while (_temp = _this = _super.call(this), _this.prop = true, _temp); - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - if (_temp = _this = _super.call(this), _this.prop = true, _temp) {} - return _possible_constructor_return(_this); - } - return _class; - }(Base), - /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(_class, Base); - var _super = _create_super(_class); - function _class() { - _class_call_check(this, _class); - var _this; - var _temp; - switch(_temp = _this = _super.call(this), _this.prop = true, _temp){ - } - return _possible_constructor_return(_this); - } - return _class; - }(Base) -]; diff --git a/crates/swc/tests/tsc-references/derivedClassSuperProperties.2.minified.js b/crates/swc/tests/tsc-references/derivedClassSuperProperties.2.minified.js deleted file mode 100644 index 00a44e23d0e..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperProperties.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [derivedClassSuperProperties.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_enumerable_properties from "@swc/helpers/src/_define_enumerable_properties.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; diff --git a/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.1.normal.js b/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.1.normal.js deleted file mode 100644 index fab225309b1..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.1.normal.js +++ /dev/null @@ -1,154 +0,0 @@ -//// [derivedClassSuperStatementPosition.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _wrap_native_super from "@swc/helpers/src/_wrap_native_super.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var DerivedBasic = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedBasic, Object1); - var _super = _create_super(DerivedBasic); - function DerivedBasic() { - _class_call_check(this, DerivedBasic); - var _this; - _this = _super.call(this); - _this.prop = 1; - return _this; - } - return DerivedBasic; -}(_wrap_native_super(Object)); -var DerivedAfterParameterDefault = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedAfterParameterDefault, Object1); - var _super = _create_super(DerivedAfterParameterDefault); - function DerivedAfterParameterDefault() { - var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; - _class_call_check(this, DerivedAfterParameterDefault); - var _this; - _this.x1 = x; - _this = _super.call(this, x); - _this.x2 = x; - return _this; - } - return DerivedAfterParameterDefault; -}(_wrap_native_super(Object)); -var DerivedAfterRestParameter = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedAfterRestParameter, Object1); - var _super = _create_super(DerivedAfterRestParameter); - function DerivedAfterRestParameter() { - for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++){ - x[_key] = arguments[_key]; - } - _class_call_check(this, DerivedAfterRestParameter); - var _this; - _this.x1 = x; - _this = _super.call(this, x); - _this.x2 = x; - return _this; - } - return DerivedAfterRestParameter; -}(_wrap_native_super(Object)); -var DerivedComments = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedComments, Object1); - var _super = _create_super(DerivedComments); - function DerivedComments() { - _class_call_check(this, DerivedComments); - var _this; - // c1 - console.log(); // c2 - _this = _super.call(this); // c4 - // c5 - _this.x = null; // c6 - return _this; - } - return DerivedComments; -}(_wrap_native_super(Object)); -var DerivedCommentsInvalidThis = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedCommentsInvalidThis, Object1); - var _super = _create_super(DerivedCommentsInvalidThis); - function DerivedCommentsInvalidThis() { - _class_call_check(this, DerivedCommentsInvalidThis); - var _this; - _assert_this_initialized(_this); - // c1 - console.log(); // c2 - _this = _super.call(this); // c4 - // c5 - _this.x = null; // c6 - return _this; - } - return DerivedCommentsInvalidThis; -}(_wrap_native_super(Object)); -var DerivedInConditional = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedInConditional, Object1); - var _super = _create_super(DerivedInConditional); - function DerivedInConditional() { - _class_call_check(this, DerivedInConditional); - var _this; - var _temp; - Math.random() ? (_temp = _this = _super.call(this, 1), _this.prop = 1, _temp) : (_temp = _this = _super.call(this, 0), _this.prop = 1, _temp); - return _possible_constructor_return(_this); - } - return DerivedInConditional; -}(_wrap_native_super(Object)); -var DerivedInIf = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedInIf, Object1); - var _super = _create_super(DerivedInIf); - function DerivedInIf() { - _class_call_check(this, DerivedInIf); - var _this; - if (Math.random()) { - _this = _super.call(this, 1); - _this.prop = 1; - } else { - _this = _super.call(this, 0); - _this.prop = 1; - } - return _possible_constructor_return(_this); - } - return DerivedInIf; -}(_wrap_native_super(Object)); -var DerivedInBlockWithProperties = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedInBlockWithProperties, Object1); - var _super = _create_super(DerivedInBlockWithProperties); - function DerivedInBlockWithProperties() { - var paramProp = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 2; - _class_call_check(this, DerivedInBlockWithProperties); - var _this; - { - _this = _super.call(this); - _this.paramProp = paramProp; - _this.prop = 1; - } - return _possible_constructor_return(_this); - } - return DerivedInBlockWithProperties; -}(_wrap_native_super(Object)); -var DerivedInConditionalWithProperties = /*#__PURE__*/ function(Object1) { - "use strict"; - _inherits(DerivedInConditionalWithProperties, Object1); - var _super = _create_super(DerivedInConditionalWithProperties); - function DerivedInConditionalWithProperties() { - var paramProp = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 2; - _class_call_check(this, DerivedInConditionalWithProperties); - var _this; - if (Math.random()) { - _this = _super.call(this, 1); - _this.paramProp = paramProp; - _this.prop = 1; - } else { - _this = _super.call(this, 0); - _this.paramProp = paramProp; - _this.prop = 1; - } - return _possible_constructor_return(_this); - } - return DerivedInConditionalWithProperties; -}(_wrap_native_super(Object)); diff --git a/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.2.minified.js b/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.2.minified.js deleted file mode 100644 index f63f008f9ee..00000000000 --- a/crates/swc/tests/tsc-references/derivedClassSuperStatementPosition.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [derivedClassSuperStatementPosition.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _wrap_native_super from "@swc/helpers/src/_wrap_native_super.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -_wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object), _wrap_native_super(Object); diff --git a/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.1.normal.js b/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.1.normal.js deleted file mode 100644 index 8ef10fa2679..00000000000 --- a/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [derivedUninitializedPropertyDeclaration.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[12:1] -//! 12 | declare property!: any; // ! is not allowed, this is an ambient declaration -//! 13 | } -//! 14 | class BOther extends A { -//! 15 | declare m() { return 2 } // not allowed on methods -//! : ^^^^^^^ -//! 16 | declare nonce: any; // ok, even though it's not in the base -//! 17 | declare property = 'y' // initialiser not allowed with declare -//! 18 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.2.minified.js b/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.2.minified.js deleted file mode 100644 index 8ef10fa2679..00000000000 --- a/crates/swc/tests/tsc-references/derivedUninitializedPropertyDeclaration.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [derivedUninitializedPropertyDeclaration.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[12:1] -//! 12 | declare property!: any; // ! is not allowed, this is an ambient declaration -//! 13 | } -//! 14 | class BOther extends A { -//! 15 | declare m() { return 2 } // not allowed on methods -//! : ^^^^^^^ -//! 16 | declare nonce: any; // ok, even though it's not in the base -//! 17 | declare property = 'y' // initialiser not allowed with declare -//! 18 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/duplicatePropertyNames.1.normal.js b/crates/swc/tests/tsc-references/duplicatePropertyNames.1.normal.js deleted file mode 100644 index c4813da1400..00000000000 --- a/crates/swc/tests/tsc-references/duplicatePropertyNames.1.normal.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [duplicatePropertyNames.ts] -// duplicate property names are an error in all types -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - this.baz = function() {}; - this.baz = function() {}; - } - var _proto = C.prototype; - _proto.bar = function bar(x) {}; - return C; -}(); -var a; -var _obj; -var b = (_obj = { - foo: "" -}, _define_property(_obj, "foo", ""), _define_property(_obj, "bar", function() {}), _define_property(_obj, "bar", function() {}), _obj); diff --git a/crates/swc/tests/tsc-references/duplicatePropertyNames.2.minified.js b/crates/swc/tests/tsc-references/duplicatePropertyNames.2.minified.js deleted file mode 100644 index 440152da0c3..00000000000 --- a/crates/swc/tests/tsc-references/duplicatePropertyNames.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [duplicatePropertyNames.ts] -var _obj; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -_define_property(_obj = { - foo: "" -}, "foo", ""), _define_property(_obj, "bar", function() {}), _define_property(_obj, "bar", function() {}); diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.1.normal.js deleted file mode 100644 index 31fb59fc4a5..00000000000 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [emitArrowFunctionWhenUsingArguments12.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | -//! 2 | class C { -//! 3 | f(arguments) { -//! : ^^^^^^^^^ -//! 4 | var a = () => arguments; -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.2.minified.js deleted file mode 100644 index 31fb59fc4a5..00000000000 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [emitArrowFunctionWhenUsingArguments12.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | -//! 2 | class C { -//! 3 | f(arguments) { -//! : ^^^^^^^^^ -//! 4 | var a = () => arguments; -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.1.normal.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.1.normal.js deleted file mode 100644 index a5c41f87571..00000000000 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [emitArrowFunctionWhenUsingArguments12_ES6.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | -//! 2 | class C { -//! 3 | f(arguments) { -//! : ^^^^^^^^^ -//! 4 | var a = () => arguments; -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.2.minified.js b/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.2.minified.js deleted file mode 100644 index a5c41f87571..00000000000 --- a/crates/swc/tests/tsc-references/emitArrowFunctionWhenUsingArguments12_ES6.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [emitArrowFunctionWhenUsingArguments12_ES6.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | -//! 2 | class C { -//! 3 | f(arguments) { -//! : ^^^^^^^^^ -//! 4 | var a = () => arguments; -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/enums.1.normal.js b/crates/swc/tests/tsc-references/enums.1.normal.js new file mode 100644 index 00000000000..1fdb0cc491b --- /dev/null +++ b/crates/swc/tests/tsc-references/enums.1.normal.js @@ -0,0 +1,21 @@ +//// [/a.ts] +var SyntaxKind; +(function(SyntaxKind) { + SyntaxKind[SyntaxKind["ImportClause"] = 0] = "ImportClause"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 1] = "ExportDeclaration"; +})(SyntaxKind || (SyntaxKind = {})); +var SymbolFlags; +(function(SymbolFlags) { + SymbolFlags["Type"] = "Type"; + SymbolFlags["Value"] = "Value"; +})(SymbolFlags || (SymbolFlags = {})); +export { SymbolFlags }; +//// [/b.ts] +SyntaxKind.ImportClause; +SymbolFlags.Type; +var kind; +var flags; +export { }; +//// [/c.ts] +import { SymbolFlags } from "./a"; +var flags = SymbolFlags.Type; diff --git a/crates/swc/tests/tsc-references/enums.2.minified.js b/crates/swc/tests/tsc-references/enums.2.minified.js new file mode 100644 index 00000000000..33589f184ef --- /dev/null +++ b/crates/swc/tests/tsc-references/enums.2.minified.js @@ -0,0 +1,14 @@ +//// [/a.ts] +var SyntaxKind, SymbolFlags; +!function(SyntaxKind) { + SyntaxKind[SyntaxKind.ImportClause = 0] = "ImportClause", SyntaxKind[SyntaxKind.ExportDeclaration = 1] = "ExportDeclaration"; +}(SyntaxKind || (SyntaxKind = {})), function(SymbolFlags) { + SymbolFlags.Type = "Type", SymbolFlags.Value = "Value"; +}(SymbolFlags || (SymbolFlags = {})); +export { SymbolFlags }; +//// [/b.ts] +SyntaxKind.ImportClause, SymbolFlags.Type; +export { }; +//// [/c.ts] +import { SymbolFlags } from "./a"; +SymbolFlags.Type; diff --git a/crates/swc/tests/tsc-references/equalityStrictNulls.1.normal.js b/crates/swc/tests/tsc-references/equalityStrictNulls.1.normal.js deleted file mode 100644 index f9cca043858..00000000000 --- a/crates/swc/tests/tsc-references/equalityStrictNulls.1.normal.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [equalityStrictNulls.ts] -function f1(x) { - if (x == undefined) {} - if (x != undefined) {} - if (x === undefined) {} - if (x !== undefined) {} - if (x == null) {} - if (x != null) {} - if (x === null) {} - if (x !== null) {} - if (undefined == x) {} - if (undefined != x) {} - if (undefined === x) {} - if (undefined !== x) {} - if (null == x) {} - if (null != x) {} - if (null === x) {} - if (null !== x) {} -} -function f2() { - if (undefined == undefined) {} - if (undefined == null) {} - if (null == undefined) {} - if (null == null) {} -} -function f3(a, b, c, d) { - if (a == null) {} - if (b == null) {} - if (c == null) {} - if (d == null) {} -} -function f4(x) { - if (x > undefined) {} - if (x < undefined) {} - if (x >= undefined) {} - if (x <= undefined) {} -} -function f5(x) { - switch(x){ - case null: - break; - case undefined: - break; - default: - return; - } -} diff --git a/crates/swc/tests/tsc-references/equalityStrictNulls.2.minified.js b/crates/swc/tests/tsc-references/equalityStrictNulls.2.minified.js deleted file mode 100644 index 30a66ff322a..00000000000 --- a/crates/swc/tests/tsc-references/equalityStrictNulls.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [equalityStrictNulls.ts] diff --git a/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.1.normal.js b/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.1.normal.js new file mode 100644 index 00000000000..e86f02fbb52 --- /dev/null +++ b/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.1.normal.js @@ -0,0 +1,15 @@ +//// [equalityWithtNullishCoalescingAssignment.ts] +function f1(a) { + a !== null && a !== void 0 ? a : a = true; + if (a === false) { + console.log(a); + } +} +f1(false); +function f2() { + var x = 0; + x !== null && x !== void 0 ? x : x = 1; + if (x === 0) { + console.log(x); + } +} diff --git a/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.2.minified.js b/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.2.minified.js new file mode 100644 index 00000000000..80630c28aa8 --- /dev/null +++ b/crates/swc/tests/tsc-references/equalityWithtNullishCoalescingAssignment.2.minified.js @@ -0,0 +1,4 @@ +//// [equalityWithtNullishCoalescingAssignment.ts] +!function(a) { + null != a || (a = !0), !1 === a && console.log(a); +}(!1); diff --git a/crates/swc/tests/tsc-references/es2022SharedMemory.1.normal.js b/crates/swc/tests/tsc-references/es2022SharedMemory.1.normal.js index 1fc61272c96..001116dbd11 100644 --- a/crates/swc/tests/tsc-references/es2022SharedMemory.1.normal.js +++ b/crates/swc/tests/tsc-references/es2022SharedMemory.1.normal.js @@ -1,11 +1,17 @@ //// [es2022SharedMemory.ts] const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024); const int32 = new Int32Array(sab); +const sab64 = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 1024); +const int64 = new BigInt64Array(sab64); const waitValue = Atomics.wait(int32, 0, 0); -const { async , value } = Atomics.waitAsync(int32, 0, BigInt(0)); +const { async , value } = Atomics.waitAsync(int32, 0, 0); +const { async: async64 , value: value64 } = Atomics.waitAsync(int64, 0, BigInt(0)); const main = async ()=>{ if (async) { await value; } + if (async64) { + await value64; + } }; main(); diff --git a/crates/swc/tests/tsc-references/es2022SharedMemory.2.minified.js b/crates/swc/tests/tsc-references/es2022SharedMemory.2.minified.js index 5be7eb0abde..ad1fbde3c9b 100644 --- a/crates/swc/tests/tsc-references/es2022SharedMemory.2.minified.js +++ b/crates/swc/tests/tsc-references/es2022SharedMemory.2.minified.js @@ -1,7 +1,7 @@ //// [es2022SharedMemory.ts] -const sab = new SharedArrayBuffer(1024 * Int32Array.BYTES_PER_ELEMENT), int32 = new Int32Array(sab); +const sab = new SharedArrayBuffer(1024 * Int32Array.BYTES_PER_ELEMENT), int32 = new Int32Array(sab), sab64 = new SharedArrayBuffer(1024 * BigInt64Array.BYTES_PER_ELEMENT), int64 = new BigInt64Array(sab64); Atomics.wait(int32, 0, 0); -const { async , value } = Atomics.waitAsync(int32, 0, BigInt(0)), main = async ()=>{ - async && await value; +const { async , value } = Atomics.waitAsync(int32, 0, 0), { async: async64 , value: value64 } = Atomics.waitAsync(int64, 0, BigInt(0)), main = async ()=>{ + async && await value, async64 && await value64; }; main(); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.1.normal.js deleted file mode 100644 index 424e668b67a..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [exponentiationOperatorWithNullValueAndInvalidOperands.ts] -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. -var a; -var b; -var c; -// operator ** -var r1a1 = Math.pow(null, a); -var r1a2 = Math.pow(null, b); -var r1a3 = Math.pow(null, c); -var r1b1 = Math.pow(a, null); -var r1b2 = Math.pow(b, null); -var r1b3 = Math.pow(c, null); -var r1c1 = Math.pow(null, true); -var r1c2 = Math.pow(null, ""); -var r1c3 = Math.pow(null, {}); -var r1d1 = Math.pow(true, null); -var r1d2 = Math.pow("", null); -var r1d3 = Math.pow({}, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.2.minified.js deleted file mode 100644 index 38376051889..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndInvalidOperands.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [exponentiationOperatorWithNullValueAndInvalidOperands.ts] diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.1.normal.js deleted file mode 100644 index f47f44959e9..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [exponentiationOperatorWithNullValueAndValidOperands.ts] -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -// operator ** -var r1 = Math.pow(null, a); -var r2 = Math.pow(null, b); -var r3 = Math.pow(null, 1); -var r4 = Math.pow(null, E.a); -var r5 = Math.pow(a, null); -var r6 = Math.pow(b, null); -var r7 = Math.pow(0, null); -var r8 = Math.pow(E.b, null); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.2.minified.js deleted file mode 100644 index 4a630d6730a..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithNullValueAndValidOperands.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [exponentiationOperatorWithNullValueAndValidOperands.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), E.a, E.b; diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js deleted file mode 100644 index b10d189aaab..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts] -// operator ** -var r1 = Math.pow(null, null); -var r2 = Math.pow(null, undefined); -var r3 = Math.pow(undefined, null); -var r4 = Math.pow(undefined, undefined); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js deleted file mode 100644 index c69689bc768..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts] diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.1.normal.js deleted file mode 100644 index 20a17c3faf0..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts] -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. -var a; -var b; -var c; -// operator ** -var r1a1 = Math.pow(undefined, a); -var r1a2 = Math.pow(undefined, b); -var r1a3 = Math.pow(undefined, c); -var r1b1 = Math.pow(a, undefined); -var r1b2 = Math.pow(b, undefined); -var r1b3 = Math.pow(c, undefined); -var r1c1 = Math.pow(undefined, true); -var r1c2 = Math.pow(undefined, ""); -var r1c3 = Math.pow(undefined, {}); -var r1d1 = Math.pow(true, undefined); -var r1d2 = Math.pow("", undefined); -var r1d3 = Math.pow({}, undefined); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.2.minified.js deleted file mode 100644 index 5d1ff3eeb0b..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndInvalidOperands.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts] diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.1.normal.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.1.normal.js deleted file mode 100644 index c86ef240c19..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [exponentiationOperatorWithUndefinedValueAndValidOperands.ts] -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -var a; -var b; -// operator * -var rk1 = Math.pow(undefined, a); -var rk2 = Math.pow(undefined, b); -var rk3 = Math.pow(undefined, 1); -var rk4 = Math.pow(undefined, E.a); -var rk5 = Math.pow(a, undefined); -var rk6 = Math.pow(b, undefined); -var rk7 = Math.pow(0, undefined); -var rk8 = Math.pow(E.b, undefined); diff --git a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.2.minified.js b/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.2.minified.js deleted file mode 100644 index d581420d312..00000000000 --- a/crates/swc/tests/tsc-references/exponentiationOperatorWithUndefinedValueAndValidOperands.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [exponentiationOperatorWithUndefinedValueAndValidOperands.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b"; -}(E || (E = {})), E.a, E.b; diff --git a/crates/swc/tests/tsc-references/exportDefaultExpressionComments.1.normal.js b/crates/swc/tests/tsc-references/exportDefaultExpressionComments.1.normal.js new file mode 100644 index 00000000000..58deae20ae4 --- /dev/null +++ b/crates/swc/tests/tsc-references/exportDefaultExpressionComments.1.normal.js @@ -0,0 +1,4 @@ +//// [exportDefaultExpressionComments.ts] +/** + * JSDoc Comments + */ export default null; diff --git a/crates/swc/tests/tsc-references/exportDefaultExpressionComments.2.minified.js b/crates/swc/tests/tsc-references/exportDefaultExpressionComments.2.minified.js new file mode 100644 index 00000000000..9a5a1886e9a --- /dev/null +++ b/crates/swc/tests/tsc-references/exportDefaultExpressionComments.2.minified.js @@ -0,0 +1,2 @@ +//// [exportDefaultExpressionComments.ts] +export default null; diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_js.1.normal.js b/crates/swc/tests/tsc-references/exportSpecifiers_js.1.normal.js new file mode 100644 index 00000000000..9e7786961dc --- /dev/null +++ b/crates/swc/tests/tsc-references/exportSpecifiers_js.1.normal.js @@ -0,0 +1,4 @@ +//// [exportSpecifiers_js.ts] +//// [./a.js] +var foo = 0; +export { }; diff --git a/crates/swc/tests/tsc-references/exportSpecifiers_js.2.minified.js b/crates/swc/tests/tsc-references/exportSpecifiers_js.2.minified.js new file mode 100644 index 00000000000..06e074bc5dd --- /dev/null +++ b/crates/swc/tests/tsc-references/exportSpecifiers_js.2.minified.js @@ -0,0 +1,3 @@ +//// [exportSpecifiers_js.ts] +//// [./a.js] +export { }; diff --git a/crates/swc/tests/tsc-references/extensionLoadingPriority.1.normal.js b/crates/swc/tests/tsc-references/extensionLoadingPriority.1.normal.js new file mode 100644 index 00000000000..830d541e054 --- /dev/null +++ b/crates/swc/tests/tsc-references/extensionLoadingPriority.1.normal.js @@ -0,0 +1,11 @@ +//// [extensionLoadingPriority.ts] +//// [/project/a.js] +export default "a.js"; +//// [/project/a.js.js] +export default "a.js.js"; +//// [/project/dir/index.ts] +export default "dir/index.ts"; +//// [/project/dir.js] +export default "dir.js"; +//// [/project/b.ts] +export { }; diff --git a/crates/swc/tests/tsc-references/extensionLoadingPriority.2.minified.js b/crates/swc/tests/tsc-references/extensionLoadingPriority.2.minified.js new file mode 100644 index 00000000000..830d541e054 --- /dev/null +++ b/crates/swc/tests/tsc-references/extensionLoadingPriority.2.minified.js @@ -0,0 +1,11 @@ +//// [extensionLoadingPriority.ts] +//// [/project/a.js] +export default "a.js"; +//// [/project/a.js.js] +export default "a.js.js"; +//// [/project/dir/index.ts] +export default "dir/index.ts"; +//// [/project/dir.js] +export default "dir.js"; +//// [/project/b.ts] +export { }; diff --git a/crates/swc/tests/tsc-references/for-of2.1.normal.js b/crates/swc/tests/tsc-references/for-of2.1.normal.js deleted file mode 100644 index a10f990017f..00000000000 --- a/crates/swc/tests/tsc-references/for-of2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [for-of2.ts] -//! -//! x 'const' declarations must be initialized -//! ,-[1:1] -//! 1 | const v; -//! : ^ -//! 2 | for (v of []) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/for-of2.2.minified.js b/crates/swc/tests/tsc-references/for-of2.2.minified.js deleted file mode 100644 index a10f990017f..00000000000 --- a/crates/swc/tests/tsc-references/for-of2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [for-of2.ts] -//! -//! x 'const' declarations must be initialized -//! ,-[1:1] -//! 1 | const v; -//! : ^ -//! 2 | for (v of []) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.1.normal.js b/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.1.normal.js new file mode 100644 index 00000000000..745015881f6 --- /dev/null +++ b/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.1.normal.js @@ -0,0 +1,162 @@ +//// [forAwaitPerIterationBindingDownlevel.ts] +import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; +import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; +import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; +import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; +import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; +var sleep = function(tm) { + return new Promise(function(resolve) { + return setTimeout(resolve, tm); + }); +}; +function gen() { + return _gen.apply(this, arguments); +} +function _gen() { + _gen = _wrap_async_generator(function() { + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + return [ + 4, + 1 + ]; + case 1: + _state.sent(); + return [ + 4, + _await_async_generator(sleep(1000)) + ]; + case 2: + _state.sent(); + return [ + 4, + 2 + ]; + case 3: + _state.sent(); + return [ + 2 + ]; + } + }); + }); + return _gen.apply(this, arguments); +} +var log = console.log; +_async_to_generator(function() { + var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, err; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + _iteratorAbruptCompletion = false, _didIteratorError = false; + _state.label = 1; + case 1: + _state.trys.push([ + 1, + 6, + 7, + 12 + ]); + _loop = function() { + var _value = _step.value; + var outer = _value; + log("I'm loop ".concat(outer)); + _async_to_generator(function() { + var inner; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + inner = outer; + return [ + 4, + sleep(2000) + ]; + case 1: + _state.sent(); + if (inner === outer) { + log("I'm loop ".concat(inner, " and I know I'm loop ").concat(outer)); + } else { + log("I'm loop ".concat(inner, ", but I think I'm loop ").concat(outer)); + } + return [ + 2 + ]; + } + }); + })(); + }; + _iterator = _async_iterator(gen()); + _state.label = 2; + case 2: + return [ + 4, + _iterator.next() + ]; + case 3: + if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [ + 3, + 5 + ]; + _loop(); + _state.label = 4; + case 4: + _iteratorAbruptCompletion = false; + return [ + 3, + 2 + ]; + case 5: + return [ + 3, + 12 + ]; + case 6: + err = _state.sent(); + _didIteratorError = true; + _iteratorError = err; + return [ + 3, + 12 + ]; + case 7: + _state.trys.push([ + 7, + , + 10, + 11 + ]); + if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [ + 3, + 9 + ]; + return [ + 4, + _iterator.return() + ]; + case 8: + _state.sent(); + _state.label = 9; + case 9: + return [ + 3, + 11 + ]; + case 10: + if (_didIteratorError) { + throw _iteratorError; + } + return [ + 7 + ]; + case 11: + return [ + 7 + ]; + case 12: + return [ + 2 + ]; + } + }); +})(); diff --git a/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.2.minified.js b/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.2.minified.js new file mode 100644 index 00000000000..b5e68f07fd9 --- /dev/null +++ b/crates/swc/tests/tsc-references/forAwaitPerIterationBindingDownlevel.2.minified.js @@ -0,0 +1,135 @@ +//// [forAwaitPerIterationBindingDownlevel.ts] +import _async_iterator from "@swc/helpers/src/_async_iterator.mjs"; +import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs"; +import _await_async_generator from "@swc/helpers/src/_await_async_generator.mjs"; +import _wrap_async_generator from "@swc/helpers/src/_wrap_async_generator.mjs"; +import _ts_generator from "@swc/helpers/src/_ts_generator.mjs"; +var sleep = function(tm) { + return new Promise(function(resolve) { + return setTimeout(resolve, tm); + }); +}; +function _gen() { + return (_gen = _wrap_async_generator(function() { + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + return [ + 4, + 1 + ]; + case 1: + return _state.sent(), [ + 4, + _await_async_generator(sleep(1000)) + ]; + case 2: + return _state.sent(), [ + 4, + 2 + ]; + case 3: + return _state.sent(), [ + 2 + ]; + } + }); + })).apply(this, arguments); +} +var log = console.log; +_async_to_generator(function() { + var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step, err; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + _iteratorAbruptCompletion = !1, _didIteratorError = !1, _state.label = 1; + case 1: + _state.trys.push([ + 1, + 6, + 7, + 12 + ]), _loop = function() { + var _value = _step.value; + log("I'm loop ".concat(_value)), _async_to_generator(function() { + var inner; + return _ts_generator(this, function(_state) { + switch(_state.label){ + case 0: + return inner = _value, [ + 4, + sleep(2000) + ]; + case 1: + return _state.sent(), inner === _value ? log("I'm loop ".concat(inner, " and I know I'm loop ").concat(_value)) : log("I'm loop ".concat(inner, ", but I think I'm loop ").concat(_value)), [ + 2 + ]; + } + }); + })(); + }, _iterator = _async_iterator(function() { + return _gen.apply(this, arguments); + }()), _state.label = 2; + case 2: + return [ + 4, + _iterator.next() + ]; + case 3: + if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [ + 3, + 5 + ]; + _loop(), _state.label = 4; + case 4: + return _iteratorAbruptCompletion = !1, [ + 3, + 2 + ]; + case 5: + return [ + 3, + 12 + ]; + case 6: + return err = _state.sent(), _didIteratorError = !0, _iteratorError = err, [ + 3, + 12 + ]; + case 7: + if (_state.trys.push([ + 7, + , + 10, + 11 + ]), !(_iteratorAbruptCompletion && null != _iterator.return)) return [ + 3, + 9 + ]; + return [ + 4, + _iterator.return() + ]; + case 8: + _state.sent(), _state.label = 9; + case 9: + return [ + 3, + 11 + ]; + case 10: + if (_didIteratorError) throw _iteratorError; + return [ + 7 + ]; + case 11: + return [ + 7 + ]; + case 12: + return [ + 2 + ]; + } + }); +})(); diff --git a/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.1.normal.js b/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.1.normal.js deleted file mode 100644 index 895b92fa15e..00000000000 --- a/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [functionOverloadErrorsSyntax.ts] -//! -//! x A rest parameter must be last in a parameter list -//! ,-[6:1] -//! 6 | function fn4b() { } -//! 7 | -//! 8 | //Function overload signature with rest param followed by non-optional parameter -//! 9 | function fn5(x: string, ...y: any[], z: string); -//! : ^^^^^^^^^^^ -//! 10 | function fn5() { } -//! `---- diff --git a/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.2.minified.js b/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.2.minified.js deleted file mode 100644 index 895b92fa15e..00000000000 --- a/crates/swc/tests/tsc-references/functionOverloadErrorsSyntax.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [functionOverloadErrorsSyntax.ts] -//! -//! x A rest parameter must be last in a parameter list -//! ,-[6:1] -//! 6 | function fn4b() { } -//! 7 | -//! 8 | //Function overload signature with rest param followed by non-optional parameter -//! 9 | function fn5(x: string, ...y: any[], z: string); -//! : ^^^^^^^^^^^ -//! 10 | function fn5() { } -//! `---- diff --git a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.1.normal.js b/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.1.normal.js deleted file mode 100644 index 0ff881181df..00000000000 --- a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.1.normal.js +++ /dev/null @@ -1,105 +0,0 @@ -//// [functionWithUseStrictAndSimpleParameterList.ts] -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[1:1] -//! 1 | function a(a = 10) { -//! 2 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | export var foo = 10; -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[13:1] -//! 13 | } -//! 14 | -//! 15 | function rest(...args: any[]) { -//! 16 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 17 | } -//! 18 | -//! 19 | function rest1(a = 1, ...args) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[17:1] -//! 17 | } -//! 18 | -//! 19 | function rest1(a = 1, ...args) { -//! 20 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 21 | } -//! 22 | -//! 23 | function paramDefault(param = 1) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[21:1] -//! 21 | } -//! 22 | -//! 23 | function paramDefault(param = 1) { -//! 24 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 25 | } -//! 26 | -//! 27 | function objectBindingPattern({foo}: any) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[25:1] -//! 25 | } -//! 26 | -//! 27 | function objectBindingPattern({foo}: any) { -//! 28 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 29 | } -//! 30 | -//! 31 | function arrayBindingPattern([foo]: any[]) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[29:1] -//! 29 | } -//! 30 | -//! 31 | function arrayBindingPattern([foo]: any[]) { -//! 32 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 33 | } -//! 34 | -//! 35 | function manyParameter(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[33:1] -//! 33 | } -//! 34 | -//! 35 | function manyParameter(a = 10, b = 20) { -//! 36 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 37 | } -//! 38 | -//! 39 | function manyPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[38:1] -//! 38 | -//! 39 | function manyPrologue(a = 10, b = 20) { -//! 40 | "foo"; -//! 41 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 42 | } -//! 43 | -//! 44 | function invalidPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[44:1] -//! 44 | function invalidPrologue(a = 10, b = 20) { -//! 45 | "foo"; -//! 46 | const c = 1; -//! 47 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 48 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.2.minified.js b/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.2.minified.js deleted file mode 100644 index 0ff881181df..00000000000 --- a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList.2.minified.js +++ /dev/null @@ -1,105 +0,0 @@ -//// [functionWithUseStrictAndSimpleParameterList.ts] -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[1:1] -//! 1 | function a(a = 10) { -//! 2 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 3 | } -//! 4 | -//! 5 | export var foo = 10; -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[13:1] -//! 13 | } -//! 14 | -//! 15 | function rest(...args: any[]) { -//! 16 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 17 | } -//! 18 | -//! 19 | function rest1(a = 1, ...args) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[17:1] -//! 17 | } -//! 18 | -//! 19 | function rest1(a = 1, ...args) { -//! 20 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 21 | } -//! 22 | -//! 23 | function paramDefault(param = 1) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[21:1] -//! 21 | } -//! 22 | -//! 23 | function paramDefault(param = 1) { -//! 24 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 25 | } -//! 26 | -//! 27 | function objectBindingPattern({foo}: any) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[25:1] -//! 25 | } -//! 26 | -//! 27 | function objectBindingPattern({foo}: any) { -//! 28 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 29 | } -//! 30 | -//! 31 | function arrayBindingPattern([foo]: any[]) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[29:1] -//! 29 | } -//! 30 | -//! 31 | function arrayBindingPattern([foo]: any[]) { -//! 32 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 33 | } -//! 34 | -//! 35 | function manyParameter(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[33:1] -//! 33 | } -//! 34 | -//! 35 | function manyParameter(a = 10, b = 20) { -//! 36 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 37 | } -//! 38 | -//! 39 | function manyPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[38:1] -//! 38 | -//! 39 | function manyPrologue(a = 10, b = 20) { -//! 40 | "foo"; -//! 41 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 42 | } -//! 43 | -//! 44 | function invalidPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[44:1] -//! 44 | function invalidPrologue(a = 10, b = 20) { -//! 45 | "foo"; -//! 46 | const c = 1; -//! 47 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 48 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.1.normal.js b/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.1.normal.js deleted file mode 100644 index 0b811ea855e..00000000000 --- a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.1.normal.js +++ /dev/null @@ -1,106 +0,0 @@ -//// [functionWithUseStrictAndSimpleParameterList_es2016.ts] -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[1:1] -//! 1 | -//! 2 | function a(a = 10) { -//! 3 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | export var foo = 10; -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[14:1] -//! 14 | } -//! 15 | -//! 16 | function rest(...args: any[]) { -//! 17 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 18 | } -//! 19 | -//! 20 | function rest1(a = 1, ...args) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[18:1] -//! 18 | } -//! 19 | -//! 20 | function rest1(a = 1, ...args) { -//! 21 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 22 | } -//! 23 | -//! 24 | function paramDefault(param = 1) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[22:1] -//! 22 | } -//! 23 | -//! 24 | function paramDefault(param = 1) { -//! 25 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 26 | } -//! 27 | -//! 28 | function objectBindingPattern({foo}: any) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[26:1] -//! 26 | } -//! 27 | -//! 28 | function objectBindingPattern({foo}: any) { -//! 29 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 30 | } -//! 31 | -//! 32 | function arrayBindingPattern([foo]: any[]) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[30:1] -//! 30 | } -//! 31 | -//! 32 | function arrayBindingPattern([foo]: any[]) { -//! 33 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 34 | } -//! 35 | -//! 36 | function manyParameter(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[34:1] -//! 34 | } -//! 35 | -//! 36 | function manyParameter(a = 10, b = 20) { -//! 37 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 38 | } -//! 39 | -//! 40 | function manyPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[39:1] -//! 39 | -//! 40 | function manyPrologue(a = 10, b = 20) { -//! 41 | "foo"; -//! 42 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 43 | } -//! 44 | -//! 45 | function invalidPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[45:1] -//! 45 | function invalidPrologue(a = 10, b = 20) { -//! 46 | "foo"; -//! 47 | const c = 1; -//! 48 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 49 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.2.minified.js b/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.2.minified.js deleted file mode 100644 index 0b811ea855e..00000000000 --- a/crates/swc/tests/tsc-references/functionWithUseStrictAndSimpleParameterList_es2016.2.minified.js +++ /dev/null @@ -1,106 +0,0 @@ -//// [functionWithUseStrictAndSimpleParameterList_es2016.ts] -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[1:1] -//! 1 | -//! 2 | function a(a = 10) { -//! 3 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 4 | } -//! 5 | -//! 6 | export var foo = 10; -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[14:1] -//! 14 | } -//! 15 | -//! 16 | function rest(...args: any[]) { -//! 17 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 18 | } -//! 19 | -//! 20 | function rest1(a = 1, ...args) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[18:1] -//! 18 | } -//! 19 | -//! 20 | function rest1(a = 1, ...args) { -//! 21 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 22 | } -//! 23 | -//! 24 | function paramDefault(param = 1) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[22:1] -//! 22 | } -//! 23 | -//! 24 | function paramDefault(param = 1) { -//! 25 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 26 | } -//! 27 | -//! 28 | function objectBindingPattern({foo}: any) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[26:1] -//! 26 | } -//! 27 | -//! 28 | function objectBindingPattern({foo}: any) { -//! 29 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 30 | } -//! 31 | -//! 32 | function arrayBindingPattern([foo]: any[]) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[30:1] -//! 30 | } -//! 31 | -//! 32 | function arrayBindingPattern([foo]: any[]) { -//! 33 | 'use strict'; -//! : ^^^^^^^^^^^^^ -//! 34 | } -//! 35 | -//! 36 | function manyParameter(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[34:1] -//! 34 | } -//! 35 | -//! 36 | function manyParameter(a = 10, b = 20) { -//! 37 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 38 | } -//! 39 | -//! 40 | function manyPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[39:1] -//! 39 | -//! 40 | function manyPrologue(a = 10, b = 20) { -//! 41 | "foo"; -//! 42 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 43 | } -//! 44 | -//! 45 | function invalidPrologue(a = 10, b = 20) { -//! `---- -//! -//! x Illegal 'use strict' directive in function with non-simple parameter list. -//! ,-[45:1] -//! 45 | function invalidPrologue(a = 10, b = 20) { -//! 46 | "foo"; -//! 47 | const c = 1; -//! 48 | "use strict"; -//! : ^^^^^^^^^^^^^ -//! 49 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext1.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext1.1.normal.js deleted file mode 100644 index f3c89cc8a8c..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext1.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext1.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext1.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext1.2.minified.js deleted file mode 100644 index f3c89cc8a8c..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext1.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext1.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext2.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext2.1.normal.js deleted file mode 100644 index b7b1e020940..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext2.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext2.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext2.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext2.2.minified.js deleted file mode 100644 index b7b1e020940..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext2.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext2.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.1.normal.js deleted file mode 100644 index d10297890ac..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext3.d.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.2.minified.js deleted file mode 100644 index d10297890ac..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext3.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext3.d.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.1.normal.js b/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.1.normal.js deleted file mode 100644 index d5076152ee6..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext4.d.ts] diff --git a/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.2.minified.js b/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.2.minified.js deleted file mode 100644 index d5076152ee6..00000000000 --- a/crates/swc/tests/tsc-references/generatorInAmbientContext4.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorInAmbientContext4.d.ts] diff --git a/crates/swc/tests/tsc-references/generatorOverloads1.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads1.1.normal.js deleted file mode 100644 index eaab1c8d7c5..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads1.1.normal.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [generatorOverloads1.ts] -var M; -(function(M) { - function* f(s) {} -})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/generatorOverloads1.2.minified.js b/crates/swc/tests/tsc-references/generatorOverloads1.2.minified.js deleted file mode 100644 index 1a010dfb9dd..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads1.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [generatorOverloads1.ts] -var M; -M || (M = {}); diff --git a/crates/swc/tests/tsc-references/generatorOverloads2.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads2.1.normal.js deleted file mode 100644 index 19b226f3dd3..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads2.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorOverloads2.ts] diff --git a/crates/swc/tests/tsc-references/generatorOverloads2.2.minified.js b/crates/swc/tests/tsc-references/generatorOverloads2.2.minified.js deleted file mode 100644 index 19b226f3dd3..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads2.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorOverloads2.ts] diff --git a/crates/swc/tests/tsc-references/generatorOverloads3.1.normal.js b/crates/swc/tests/tsc-references/generatorOverloads3.1.normal.js deleted file mode 100644 index 1c952c4b3a4..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads3.1.normal.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [generatorOverloads3.ts] -class C { - *f(s) {} -} diff --git a/crates/swc/tests/tsc-references/generatorOverloads3.2.minified.js b/crates/swc/tests/tsc-references/generatorOverloads3.2.minified.js deleted file mode 100644 index 236219307af..00000000000 --- a/crates/swc/tests/tsc-references/generatorOverloads3.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorOverloads3.ts] diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck32.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck32.1.normal.js deleted file mode 100644 index 9d230839137..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck32.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [generatorTypeCheck32.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | var s: string; -//! 2 | var f: () => number = () => yield s; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck32.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck32.2.minified.js deleted file mode 100644 index 9d230839137..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck32.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [generatorTypeCheck32.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | var s: string; -//! 2 | var f: () => number = () => yield s; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck39.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck39.1.normal.js deleted file mode 100644 index 988448380a8..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck39.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [generatorTypeCheck39.ts] -//! -//! x Expression expected -//! ,-[2:1] -//! 2 | return y => { }; -//! 3 | } -//! 4 | function* g() { -//! 5 | @decorator(yield 0) -//! : ^ -//! 6 | class C { -//! 7 | x = yield 0; -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck39.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck39.2.minified.js deleted file mode 100644 index 988448380a8..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck39.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [generatorTypeCheck39.ts] -//! -//! x Expression expected -//! ,-[2:1] -//! 2 | return y => { }; -//! 3 | } -//! 4 | function* g() { -//! 5 | @decorator(yield 0) -//! : ^ -//! 6 | class C { -//! 7 | x = yield 0; -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck57.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck57.1.normal.js deleted file mode 100644 index f90152ed185..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck57.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [generatorTypeCheck57.ts] -function* g() { - class C { - constructor(){ - this.x = yield 0; - } - } -} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck57.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck57.2.minified.js deleted file mode 100644 index 98ae4e9f1e3..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck57.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorTypeCheck57.ts] diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck58.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck58.1.normal.js deleted file mode 100644 index 62baedba943..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck58.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [generatorTypeCheck58.ts] -function* g() { - class C { - } - C.x = yield 0; -} diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck58.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck58.2.minified.js deleted file mode 100644 index 0e6cdc5bd3d..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck58.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [generatorTypeCheck58.ts] diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck59.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck59.1.normal.js deleted file mode 100644 index ba1a835e6a1..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck59.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [generatorTypeCheck59.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | function* g() { -//! 2 | class C { -//! 3 | @(yield "") -//! : ^ -//! 4 | m() { } -//! 5 | }; -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck59.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck59.2.minified.js deleted file mode 100644 index ba1a835e6a1..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck59.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [generatorTypeCheck59.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | function* g() { -//! 2 | class C { -//! 3 | @(yield "") -//! : ^ -//! 4 | m() { } -//! 5 | }; -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck61.1.normal.js b/crates/swc/tests/tsc-references/generatorTypeCheck61.1.normal.js deleted file mode 100644 index 48b317755ed..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck61.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [generatorTypeCheck61.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | function * g() { -//! 2 | @(yield 0) -//! : ^ -//! 3 | class C {}; -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/generatorTypeCheck61.2.minified.js b/crates/swc/tests/tsc-references/generatorTypeCheck61.2.minified.js deleted file mode 100644 index 48b317755ed..00000000000 --- a/crates/swc/tests/tsc-references/generatorTypeCheck61.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [generatorTypeCheck61.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | function * g() { -//! 2 | @(yield 0) -//! : ^ -//! 3 | class C {}; -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).1.normal.js b/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).1.normal.js deleted file mode 100644 index 26d84621cc9..00000000000 --- a/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).1.normal.js +++ /dev/null @@ -1,70 +0,0 @@ -//// [importAssertion1.ts] -"use strict"; -//// [0.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - a: ()=>a, - b: ()=>b -}); -const a = 1; -const b = 2; -//// [1.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; -const _0 = /*#__PURE__*/ _interopRequireWildcard(require("./0")); -_0.a; -_0.b; -_0.a; -_0.b; -//// [2.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -const _0 = require("./0"); -_0.a; -_0.b; -_0.a; -_0.b; -//// [3.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; -const a = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0"))); -const b = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", { - assert: { - type: "json" - } - }))); -const c = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", { - assert: { - type: "json", - ttype: "typo" - } - }))); -const d = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", { - assert: {} - }))); -const dd = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", {}))); -const e = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", foo()))); -const f = Promise.resolve().then((p)=>/*#__PURE__*/ _interopRequireWildcard(require(p))); -const g = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", {}, {}))); -const h = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./0", { - assert: { - type: "json" - } - }))); diff --git a/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).2.minified.js b/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).2.minified.js deleted file mode 100644 index ebee77164bb..00000000000 --- a/crates/swc/tests/tsc-references/importAssertion1(module=commonjs).2.minified.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [importAssertion1.ts] -"use strict"; -//// [0.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: !0 -}), function(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: !0, - get: all[name] - }); -}(exports, { - a: ()=>a, - b: ()=>b -}); -const a = 1, b = 2; -//// [1.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: !0 -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default, _0 = _interopRequireWildcard(require("./0")); -_0.a, _0.b, _0.a, _0.b; -//// [2.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: !0 -}); -const _0 = require("./0"); -_0.a, _0.b, _0.a, _0.b; -//// [3.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: !0 -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; -Promise.resolve().then(()=>_interopRequireWildcard(require("./0"))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", { - assert: { - type: "json" - } - }))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", { - assert: { - type: "json", - ttype: "typo" - } - }))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", { - assert: {} - }))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", {}))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", foo()))), Promise.resolve().then((p)=>_interopRequireWildcard(require(p))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", {}, {}))), Promise.resolve().then(()=>_interopRequireWildcard(require("./0", { - assert: { - type: "json" - } - }))); diff --git a/crates/swc/tests/tsc-references/importAssertion1(module=es6).1.normal.js b/crates/swc/tests/tsc-references/importAssertion1(module=es6).1.normal.js deleted file mode 100644 index aa4656c5a84..00000000000 --- a/crates/swc/tests/tsc-references/importAssertion1(module=es6).1.normal.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [importAssertion1.ts] -//// [0.ts] -export const a = 1; -export const b = 2; -//// [1.ts] -import './0'; -import { a, b } from './0'; -import * as foo from './0'; -a; -b; -foo.a; -foo.b; -//// [2.ts] -import { a, b } from './0'; -import { a as c, b as d } from './0'; -a; -b; -c; -d; -//// [3.ts] -const a = import('./0'); -const b = import('./0', { - assert: { - type: "json" - } -}); -const c = import('./0', { - assert: { - type: "json", - ttype: "typo" - } -}); -const d = import('./0', { - assert: {} -}); -const dd = import('./0', {}); -const e = import('./0', foo()); -const f = import(); -const g = import('./0', {}, {}); -const h = import('./0', { - assert: { - type: "json" - } -}); diff --git a/crates/swc/tests/tsc-references/importAssertion1(module=es6).2.minified.js b/crates/swc/tests/tsc-references/importAssertion1(module=es6).2.minified.js deleted file mode 100644 index f8ff58ce02a..00000000000 --- a/crates/swc/tests/tsc-references/importAssertion1(module=es6).2.minified.js +++ /dev/null @@ -1,29 +0,0 @@ -//// [importAssertion1.ts] -//// [0.ts] -export const a = 1; -export const b = 2; -//// [1.ts] -import './0'; -import { a, b } from './0'; -import * as foo from './0'; -foo.a, foo.b; -//// [2.ts] -import { a, b } from './0'; -import { a as c, b as d } from './0'; -//// [3.ts] -import('./0'), import('./0', { - assert: { - type: "json" - } -}), import('./0', { - assert: { - type: "json", - ttype: "typo" - } -}), import('./0', { - assert: {} -}), import('./0', {}), import('./0', foo()), import(), import('./0', {}, {}), import('./0', { - assert: { - type: "json" - } -}); diff --git a/crates/swc/tests/tsc-references/importCallExpressionGrammarError.1.normal.js b/crates/swc/tests/tsc-references/importCallExpressionGrammarError.1.normal.js deleted file mode 100644 index cf9d5cb1c3a..00000000000 --- a/crates/swc/tests/tsc-references/importCallExpressionGrammarError.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [importCallExpressionGrammarError.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; -var a = [ - "./0" -]; -Promise.resolve(...[ - "PathModule" -]).then((p)=>/*#__PURE__*/ _interopRequireWildcard(require(p))); -var p1 = Promise.resolve(...a).then((p)=>/*#__PURE__*/ _interopRequireWildcard(require(p))); -const p2 = Promise.resolve().then((p)=>/*#__PURE__*/ _interopRequireWildcard(require(p))); -const p4 = Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("pathToModule", "secondModule"))); diff --git a/crates/swc/tests/tsc-references/importCallExpressionGrammarError.2.minified.js b/crates/swc/tests/tsc-references/importCallExpressionGrammarError.2.minified.js deleted file mode 100644 index 2dd33afa203..00000000000 --- a/crates/swc/tests/tsc-references/importCallExpressionGrammarError.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [importCallExpressionGrammarError.ts] -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: !0 -}); -const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; -Promise.resolve(...[ - "PathModule" -]).then((p)=>_interopRequireWildcard(require(p))), Promise.resolve(...[ - "./0" -]).then((p)=>_interopRequireWildcard(require(p))), Promise.resolve().then((p)=>_interopRequireWildcard(require(p))), Promise.resolve().then(()=>_interopRequireWildcard(require("pathToModule", "secondModule"))); diff --git a/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.1.normal.js b/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.1.normal.js new file mode 100644 index 00000000000..62d28908260 --- /dev/null +++ b/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.1.normal.js @@ -0,0 +1,10 @@ +//// [enum.ts] +export var Enum; +(function(Enum) { + Enum[Enum["One"] = 1] = "One"; +})(Enum || (Enum = {})); +//// [merge.ts] +import { Enum } from "./enum"; +//// [index.ts] +import { Enum } from "./merge"; +Enum.One; diff --git a/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.2.minified.js b/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.2.minified.js new file mode 100644 index 00000000000..1349632135c --- /dev/null +++ b/crates/swc/tests/tsc-references/importElisionConstEnumMerge1.2.minified.js @@ -0,0 +1,10 @@ +//// [enum.ts] +export var Enum; +!function(Enum) { + Enum[Enum.One = 1] = "One"; +}(Enum || (Enum = {})); +//// [merge.ts] +import "./enum"; +//// [index.ts] +import { Enum } from "./merge"; +Enum.One; diff --git a/crates/swc/tests/tsc-references/importEqualsDeclaration.1.normal.js b/crates/swc/tests/tsc-references/importEqualsDeclaration.1.normal.js new file mode 100644 index 00000000000..b322ad5a7ad --- /dev/null +++ b/crates/swc/tests/tsc-references/importEqualsDeclaration.1.normal.js @@ -0,0 +1,30 @@ +//// [importEqualsDeclaration.ts] +//// [/a.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | class A { a!: string } +//! 2 | export = A; +//! : ^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/b.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | class SomeClass {} +//! 2 | export = SomeClass; +//! : ^^^^^^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/c.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import type A = require('./a'); // Ok +//! 2 | import type = require('./b'); // Ok +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 3 | +//! 4 | A.prototype; // Error +//! 5 | const a: A = { a: 'a' }; // Ok +//! `---- diff --git a/crates/swc/tests/tsc-references/importEqualsDeclaration.2.minified.js b/crates/swc/tests/tsc-references/importEqualsDeclaration.2.minified.js new file mode 100644 index 00000000000..b322ad5a7ad --- /dev/null +++ b/crates/swc/tests/tsc-references/importEqualsDeclaration.2.minified.js @@ -0,0 +1,30 @@ +//// [importEqualsDeclaration.ts] +//// [/a.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | class A { a!: string } +//! 2 | export = A; +//! : ^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/b.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | class SomeClass {} +//! 2 | export = SomeClass; +//! : ^^^^^^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/c.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import type A = require('./a'); // Ok +//! 2 | import type = require('./b'); // Ok +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 3 | +//! 4 | A.prototype; // Error +//! 5 | const a: A = { a: 'a' }; // Ok +//! `---- diff --git a/crates/swc/tests/tsc-references/importFromDot.1.normal.js b/crates/swc/tests/tsc-references/importFromDot.1.normal.js new file mode 100644 index 00000000000..ff14aada68e --- /dev/null +++ b/crates/swc/tests/tsc-references/importFromDot.1.normal.js @@ -0,0 +1,31 @@ +//// [importFromDot.ts] +"use strict"; +//// [a.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "rootA", { + enumerable: true, + get: function() { + return rootA; + } +}); +var rootA = 0; +//// [a/index.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "indexInA", { + enumerable: true, + get: function() { + return indexInA; + } +}); +var indexInA = 0; +//// [a/b.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); diff --git a/crates/swc/tests/tsc-references/importFromDot.2.minified.js b/crates/swc/tests/tsc-references/importFromDot.2.minified.js new file mode 100644 index 00000000000..e97dd909524 --- /dev/null +++ b/crates/swc/tests/tsc-references/importFromDot.2.minified.js @@ -0,0 +1,29 @@ +//// [importFromDot.ts] +"use strict"; +//// [a.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), Object.defineProperty(exports, "rootA", { + enumerable: !0, + get: function() { + return rootA; + } +}); +var rootA = 0; +//// [a/index.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), Object.defineProperty(exports, "indexInA", { + enumerable: !0, + get: function() { + return indexInA; + } +}); +var indexInA = 0; +//// [a/b.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}); diff --git a/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).1.normal.js b/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).1.normal.js deleted file mode 100644 index 21bfd2d6f15..00000000000 --- a/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).1.normal.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [importMetaNarrowing.ts] -if (import.meta.foo) { - import.meta.foo(); -} diff --git a/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).2.minified.js b/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).2.minified.js deleted file mode 100644 index 74fae193691..00000000000 --- a/crates/swc/tests/tsc-references/importMetaNarrowing(module=es6).2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [importMetaNarrowing.ts] -import.meta.foo && import.meta.foo(); diff --git a/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).1.normal.js b/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).1.normal.js deleted file mode 100644 index d6f45996e4b..00000000000 --- a/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [importMetaNarrowing.ts] -System.register([], function(_export, _context) { - "use strict"; - return { - setters: [], - execute: function() { - if (_context.meta.foo) { - _context.meta.foo(); - } - } - }; -}); diff --git a/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).2.minified.js b/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).2.minified.js deleted file mode 100644 index f6bf3223247..00000000000 --- a/crates/swc/tests/tsc-references/importMetaNarrowing(module=system).2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [importMetaNarrowing.ts] -System.register([], function(_export, _context) { - return { - setters: [], - execute: function() { - _context.meta.foo && _context.meta.foo(); - } - }; -}); diff --git a/crates/swc/tests/tsc-references/importSpecifiers_js.1.normal.js b/crates/swc/tests/tsc-references/importSpecifiers_js.1.normal.js new file mode 100644 index 00000000000..4b8a77690d6 --- /dev/null +++ b/crates/swc/tests/tsc-references/importSpecifiers_js.1.normal.js @@ -0,0 +1,5 @@ +//// [importSpecifiers_js.ts] +//// [./a.ts] +export { }; +//// [./a.js] +export { }; diff --git a/crates/swc/tests/tsc-references/importSpecifiers_js.2.minified.js b/crates/swc/tests/tsc-references/importSpecifiers_js.2.minified.js new file mode 100644 index 00000000000..4b8a77690d6 --- /dev/null +++ b/crates/swc/tests/tsc-references/importSpecifiers_js.2.minified.js @@ -0,0 +1,5 @@ +//// [importSpecifiers_js.ts] +//// [./a.ts] +export { }; +//// [./a.js] +export { }; diff --git a/crates/swc/tests/tsc-references/importTypeGeneric.1.normal.js b/crates/swc/tests/tsc-references/importTypeGeneric.1.normal.js deleted file mode 100644 index a983b9ffa61..00000000000 --- a/crates/swc/tests/tsc-references/importTypeGeneric.1.normal.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [a.d.ts] -export { }; -//// [b.d.ts] -export { }; -//// [usage.ts] -//! -//! x literal in an import type should be string literal -//! ,-[1:1] -//! 1 | export function getFooFrom(v: T): import(T).Foo { -//! : ^ -//! 2 | return undefined as any; -//! 3 | } -//! `---- -//! -//! x literal in an import type should be string literal -//! ,-[2:1] -//! 2 | return undefined as any; -//! 3 | } -//! 4 | -//! 5 | export function getFooValueFrom(v: T): import(T).Foo["a"] { -//! : ^ -//! 6 | return undefined as any; -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/importTypeGeneric.2.minified.js b/crates/swc/tests/tsc-references/importTypeGeneric.2.minified.js deleted file mode 100644 index a983b9ffa61..00000000000 --- a/crates/swc/tests/tsc-references/importTypeGeneric.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [a.d.ts] -export { }; -//// [b.d.ts] -export { }; -//// [usage.ts] -//! -//! x literal in an import type should be string literal -//! ,-[1:1] -//! 1 | export function getFooFrom(v: T): import(T).Foo { -//! : ^ -//! 2 | return undefined as any; -//! 3 | } -//! `---- -//! -//! x literal in an import type should be string literal -//! ,-[2:1] -//! 2 | return undefined as any; -//! 3 | } -//! 4 | -//! 5 | export function getFooValueFrom(v: T): import(T).Foo["a"] { -//! : ^ -//! 6 | return undefined as any; -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/importingExportingTypes.1.normal.js b/crates/swc/tests/tsc-references/importingExportingTypes.1.normal.js new file mode 100644 index 00000000000..e30d62b34f5 --- /dev/null +++ b/crates/swc/tests/tsc-references/importingExportingTypes.1.normal.js @@ -0,0 +1,7 @@ +//// [importingExportingTypes.ts] +//// [/node_modules/@types/node/index.d.ts] +//// [/index.js] +import { WriteFileOptions } from "fs"; +/** @typedef {{ x: any }} JSDocType */ export { JSDocType }; +export { JSDocType as ThisIsFine }; +export { WriteFileOptions }; diff --git a/crates/swc/tests/tsc-references/importingExportingTypes.2.minified.js b/crates/swc/tests/tsc-references/importingExportingTypes.2.minified.js new file mode 100644 index 00000000000..e461284a20c --- /dev/null +++ b/crates/swc/tests/tsc-references/importingExportingTypes.2.minified.js @@ -0,0 +1,5 @@ +//// [importingExportingTypes.ts] +//// [/node_modules/@types/node/index.d.ts] +//// [/index.js] +import { WriteFileOptions } from "fs"; +export { JSDocType, JSDocType as ThisIsFine, WriteFileOptions }; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.1.normal.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.1.normal.js deleted file mode 100644 index 1fa5c64885b..00000000000 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.1.normal.js +++ /dev/null @@ -1,49 +0,0 @@ -//// [inOperatorWithInvalidOperands.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var Foo = function Foo() { - "use strict"; - _class_call_check(this, Foo); -}; -var E; -(function(E) { - E[E["a"] = 0] = "a"; -})(E || (E = {})); -var x; -// invalid left operands -// the left operand is required to be of type Any, the String primitive type, or the Number primitive type -var a1; -var a2; -var a3; -var a4; -var a5; -var a6; -var ra1 = a1 in x; -var ra2 = a2 in x; -var ra3 = a3 in x; -var ra4 = a4 in x; -var ra5 = null in x; -var ra6 = undefined in x; -var ra7 = E.a in x; -var ra8 = false in x; -var ra9 = {} in x; -var ra10 = a5 in x; -var ra11 = a6 in x; -// invalid right operands -// the right operand is required to be of type Any, an object type, or a type parameter type -var b1; -var b2; -var b3; -var b4; -var b5; -var rb1 = x in b1; -var rb2 = x in b2; -var rb3 = x in b3; -var rb4 = x in b4; -var rb5 = x in b5; -var rb6 = x in 0; -var rb7 = x in false; -var rb8 = x in ""; -var rb9 = x in null; -var rb10 = x in undefined; -// both operands are invalid -var rc1 = {} in ""; diff --git a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.2.minified.js b/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.2.minified.js deleted file mode 100644 index 9035ba7372b..00000000000 --- a/crates/swc/tests/tsc-references/inOperatorWithInvalidOperands.2.minified.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [inOperatorWithInvalidOperands.ts] -var E; -import "@swc/helpers/src/_class_call_check.mjs"; -!function(E) { - E[E.a = 0] = "a"; -}(E || (E = {})), E.a; diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js deleted file mode 100644 index 8a0ee49fcf9..00000000000 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.1.normal.js +++ /dev/null @@ -1,195 +0,0 @@ -//// [incrementOperatorWithAnyOtherTypeInvalidOperations.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[34:1] -//! 34 | var ResultIsNumber10 = obj1++; -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = ++{}; -//! : ^^ -//! 38 | var ResultIsNumber12 = ++null; -//! 39 | var ResultIsNumber13 = ++undefined; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[35:1] -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = ++{}; -//! 38 | var ResultIsNumber12 = ++null; -//! : ^^^^ -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[38:1] -//! 38 | var ResultIsNumber12 = ++null; -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! : ^^^^ -//! 42 | var ResultIsNumber15 = {}++; -//! 43 | var ResultIsNumber16 = undefined++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[39:1] -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! 42 | var ResultIsNumber15 = {}++; -//! : ^^ -//! 43 | var ResultIsNumber16 = undefined++; -//! 44 | -//! 45 | // any type expressions -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[43:1] -//! 43 | var ResultIsNumber16 = undefined++; -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! : ^^^^^ -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[44:1] -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! : ^^^^^^^ -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[45:1] -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! : ^^^^^^^^^^^^^^^^^^ -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[46:1] -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! : ^^^^^^^^^^^^^ -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[47:1] -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[51:1] -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! : ^^^^^ -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[52:1] -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! : ^^^^^^^ -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[53:1] -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! : ^^^^^^^^^^^^^^^^^^ -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! 59 | var ResultIsNumber29 = obj1.x++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[54:1] -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! : ^^^^^^^^^^^^^ -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! 59 | var ResultIsNumber29 = obj1.x++; -//! 60 | var ResultIsNumber30 = obj1.y++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[55:1] -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 59 | var ResultIsNumber29 = obj1.x++; -//! 60 | var ResultIsNumber30 = obj1.y++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[64:1] -//! 64 | -//! 65 | ANY2++; -//! 66 | -//! 67 | ++ANY1++; -//! : ^^^^^^ -//! 68 | ++ANY2++; -//! 69 | ++ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[65:1] -//! 65 | ANY2++; -//! 66 | -//! 67 | ++ANY1++; -//! 68 | ++ANY2++; -//! : ^^^^^^ -//! 69 | ++ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[66:1] -//! 66 | -//! 67 | ++ANY1++; -//! 68 | ++ANY2++; -//! 69 | ++ANY2[0]++; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js deleted file mode 100644 index 8a0ee49fcf9..00000000000 --- a/crates/swc/tests/tsc-references/incrementOperatorWithAnyOtherTypeInvalidOperations.2.minified.js +++ /dev/null @@ -1,195 +0,0 @@ -//// [incrementOperatorWithAnyOtherTypeInvalidOperations.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[34:1] -//! 34 | var ResultIsNumber10 = obj1++; -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = ++{}; -//! : ^^ -//! 38 | var ResultIsNumber12 = ++null; -//! 39 | var ResultIsNumber13 = ++undefined; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[35:1] -//! 35 | -//! 36 | // any type literal -//! 37 | var ResultIsNumber11 = ++{}; -//! 38 | var ResultIsNumber12 = ++null; -//! : ^^^^ -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[38:1] -//! 38 | var ResultIsNumber12 = ++null; -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! : ^^^^ -//! 42 | var ResultIsNumber15 = {}++; -//! 43 | var ResultIsNumber16 = undefined++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[39:1] -//! 39 | var ResultIsNumber13 = ++undefined; -//! 40 | -//! 41 | var ResultIsNumber14 = null++; -//! 42 | var ResultIsNumber15 = {}++; -//! : ^^ -//! 43 | var ResultIsNumber16 = undefined++; -//! 44 | -//! 45 | // any type expressions -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[43:1] -//! 43 | var ResultIsNumber16 = undefined++; -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! : ^^^^^ -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[44:1] -//! 44 | -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! : ^^^^^^^ -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[45:1] -//! 45 | // any type expressions -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! : ^^^^^^^^^^^^^^^^^^ -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[46:1] -//! 46 | var ResultIsNumber17 = ++foo(); -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! : ^^^^^^^^^^^^^ -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[47:1] -//! 47 | var ResultIsNumber18 = ++A.foo(); -//! 48 | var ResultIsNumber19 = ++(null + undefined); -//! 49 | var ResultIsNumber20 = ++(null + null); -//! 50 | var ResultIsNumber21 = ++(undefined + undefined); -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[51:1] -//! 51 | var ResultIsNumber22 = ++obj1.x; -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! : ^^^^^ -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[52:1] -//! 52 | var ResultIsNumber23 = ++obj1.y; -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! : ^^^^^^^ -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[53:1] -//! 53 | -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! : ^^^^^^^^^^^^^^^^^^ -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! 59 | var ResultIsNumber29 = obj1.x++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[54:1] -//! 54 | var ResultIsNumber24 = foo()++; -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! : ^^^^^^^^^^^^^ -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! 59 | var ResultIsNumber29 = obj1.x++; -//! 60 | var ResultIsNumber30 = obj1.y++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[55:1] -//! 55 | var ResultIsNumber25 = A.foo()++; -//! 56 | var ResultIsNumber26 = (null + undefined)++; -//! 57 | var ResultIsNumber27 = (null + null)++; -//! 58 | var ResultIsNumber28 = (undefined + undefined)++; -//! : ^^^^^^^^^^^^^^^^^^^^^^^ -//! 59 | var ResultIsNumber29 = obj1.x++; -//! 60 | var ResultIsNumber30 = obj1.y++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[64:1] -//! 64 | -//! 65 | ANY2++; -//! 66 | -//! 67 | ++ANY1++; -//! : ^^^^^^ -//! 68 | ++ANY2++; -//! 69 | ++ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[65:1] -//! 65 | ANY2++; -//! 66 | -//! 67 | ++ANY1++; -//! 68 | ++ANY2++; -//! : ^^^^^^ -//! 69 | ++ANY2[0]++; -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[66:1] -//! 66 | -//! 67 | ++ANY1++; -//! 68 | ++ANY2++; -//! 69 | ++ANY2[0]++; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/inferThis.1.normal.js b/crates/swc/tests/tsc-references/inferThis.1.normal.js new file mode 100644 index 00000000000..87322c7adc6 --- /dev/null +++ b/crates/swc/tests/tsc-references/inferThis.1.normal.js @@ -0,0 +1,29 @@ +//// [/a.js] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +export var C = /*#__PURE__*/ function() { + "use strict"; + function C() { + _class_call_check(this, C); + } + var _proto = C.prototype; + /** + * @template T + * @this {T} + * @return {T} + */ _proto.b = function b() { + return this; + }; + /** + * @template T + * @this {T} + * @return {T} + */ C.a = function a() { + return this; + }; + return C; +}(); +var a = C.a(); +a; // typeof C +var c = new C(); +var b = c.b(); +b; // C diff --git a/crates/swc/tests/tsc-references/inferThis.2.minified.js b/crates/swc/tests/tsc-references/inferThis.2.minified.js new file mode 100644 index 00000000000..ff56b4c0aa8 --- /dev/null +++ b/crates/swc/tests/tsc-references/inferThis.2.minified.js @@ -0,0 +1,14 @@ +//// [/a.js] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +export var C = function() { + "use strict"; + function C() { + _class_call_check(this, C); + } + return C.prototype.b = function() { + return this; + }, C.a = function() { + return this; + }, C; +}(); +C.a(), new C().b(); diff --git a/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.1.normal.js b/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.1.normal.js new file mode 100644 index 00000000000..289c7f4fd9a --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.1.normal.js @@ -0,0 +1 @@ +//// [inferTypesInvalidExtendsDeclaration.ts] diff --git a/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.2.minified.js b/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.2.minified.js new file mode 100644 index 00000000000..289c7f4fd9a --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesInvalidExtendsDeclaration.2.minified.js @@ -0,0 +1 @@ +//// [inferTypesInvalidExtendsDeclaration.ts] diff --git a/crates/swc/tests/tsc-references/inferTypesWithExtends1.1.normal.js b/crates/swc/tests/tsc-references/inferTypesWithExtends1.1.normal.js new file mode 100644 index 00000000000..720eebfe002 --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesWithExtends1.1.normal.js @@ -0,0 +1,8 @@ +//// [inferTypesWithExtends1.ts] +// infer to tuple element +function f1() { + return x1; +} +function f2() { + return x2; +} diff --git a/crates/swc/tests/tsc-references/inferTypesWithExtends1.2.minified.js b/crates/swc/tests/tsc-references/inferTypesWithExtends1.2.minified.js new file mode 100644 index 00000000000..b1edd51722c --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesWithExtends1.2.minified.js @@ -0,0 +1 @@ +//// [inferTypesWithExtends1.ts] diff --git a/crates/swc/tests/tsc-references/inferTypesWithExtends2.1.normal.js b/crates/swc/tests/tsc-references/inferTypesWithExtends2.1.normal.js new file mode 100644 index 00000000000..7cf3718e4ed --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesWithExtends2.1.normal.js @@ -0,0 +1,2 @@ +//// [inferTypesWithExtends2.ts] +// infer twice with different constraints (same behavior as class/interface) diff --git a/crates/swc/tests/tsc-references/inferTypesWithExtends2.2.minified.js b/crates/swc/tests/tsc-references/inferTypesWithExtends2.2.minified.js new file mode 100644 index 00000000000..17237235d80 --- /dev/null +++ b/crates/swc/tests/tsc-references/inferTypesWithExtends2.2.minified.js @@ -0,0 +1 @@ +//// [inferTypesWithExtends2.ts] diff --git a/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js b/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js new file mode 100644 index 00000000000..8d785a39391 --- /dev/null +++ b/crates/swc/tests/tsc-references/intraExpressionInferences.1.normal.js @@ -0,0 +1,194 @@ +//// [intraExpressionInferences.ts] +// Repros from #47599 +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +callIt({ + produce: function() { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}); +callIt({ + produce: function(_a) { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}); +callIt({ + produce: function produce() { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}); +callItT([ + function() { + return 0; + }, + function(n) { + return n.toFixed(); + } +]); +callItT([ + function(_a) { + return 0; + }, + function(n) { + return n.toFixed(); + } +]); +var inferTypeFn = function(generic) { + return generic; +}; +var myGeneric = inferTypeFn({ + retrieveGeneric: function(parameter) { + return 5; + }, + operateWithGeneric: function(generic) { + return generic.toFixed(); + } +}); +// Repro #38623 +function make(o) {} +make({ + mutations: { + foo: function foo1() {} + }, + action: function(a) { + a.foo(); + } +}); +foo({ + a: function() { + return 42; + }, + b: function b(a) {} +}); +foo({ + a: function a() { + return 42; + }, + b: function b(a) {} +}); +foo({ + a: function a() { + return 42; + }, + b: function b(a) {} +}); +function test(foo1) {} +test({ + a: function() { + return 0; + }, + b: function(a) { + return "a"; + }, + c: function(b) { + var _$x = b; + } +}); +test({ + a: function() { + return 0; + }, + b: function(a) { + return a; + }, + c: function(b) { + var _$x = b; + } +}); +// Repro from #41712 +var Wrapper = function Wrapper() { + "use strict"; + _class_call_check(this, Wrapper); +}; +createMappingComponent({ + setup: function setup() { + return { + inputs: { + num: new Wrapper(), + str: new Wrapper() + }, + outputs: { + bool: new Wrapper(), + str: new Wrapper() + } + }; + }, + map: function map(inputs) { + return { + bool: inputs.nonexistent, + str: inputs.num + }; + } +}); +// Repro from #48279 +function simplified(props) {} +function whatIWant(props) {} +function nonObject(generator, receiver) {} +simplified({ + generator: function() { + return 123; + }, + receiver: function(t) { + return console.log(t + 2); + } +}); +whatIWant({ + generator: function(bob) { + return bob ? 1 : 2; + }, + receiver: function(t) { + return console.log(t + 2); + } +}); +nonObject(function(bob) { + return bob ? 1 : 2; +}, function(t) { + return console.log(t + 2); +}); +function example(options) { + return function(params) { + var data = options.fetch(params, 123); + return options.map(data); + }; +} +example({ + fetch: function(params) { + return 123; + }, + map: function(number) { + return String(number); + } +}); +example({ + fetch: function(params, foo1) { + return 123; + }, + map: function(number) { + return String(number); + } +}); +example({ + fetch: function(params, foo1) { + return 123; + }, + map: function(number) { + return String(number); + } +}); +branch({ + test: x, + if: function(t) { + return t === "a"; + }, + then: function(u) { + var test1 = u; + } +}); diff --git a/crates/swc/tests/tsc-references/intraExpressionInferences.2.minified.js b/crates/swc/tests/tsc-references/intraExpressionInferences.2.minified.js new file mode 100644 index 00000000000..56d7dda5057 --- /dev/null +++ b/crates/swc/tests/tsc-references/intraExpressionInferences.2.minified.js @@ -0,0 +1,110 @@ +//// [intraExpressionInferences.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +callIt({ + produce: function() { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}), callIt({ + produce: function(_a) { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}), callIt({ + produce: function() { + return 0; + }, + consume: function(n) { + return n.toFixed(); + } +}), callItT([ + function() { + return 0; + }, + function(n) { + return n.toFixed(); + } +]), callItT([ + function(_a) { + return 0; + }, + function(n) { + return n.toFixed(); + } +]), foo({ + a: function() { + return 42; + }, + b: function(a) {} +}), foo({ + a: function() { + return 42; + }, + b: function(a) {} +}), foo({ + a: function() { + return 42; + }, + b: function(a) {} +}); +var Wrapper = function Wrapper() { + "use strict"; + _class_call_check(this, Wrapper); +}; +function example(options) { + return function(params) { + var data = options.fetch(params, 123); + return options.map(data); + }; +} +createMappingComponent({ + setup: function() { + return { + inputs: { + num: new Wrapper(), + str: new Wrapper() + }, + outputs: { + bool: new Wrapper(), + str: new Wrapper() + } + }; + }, + map: function(inputs) { + return { + bool: inputs.nonexistent, + str: inputs.num + }; + } +}), example({ + fetch: function(params) { + return 123; + }, + map: function(number) { + return String(number); + } +}), example({ + fetch: function(params, foo1) { + return 123; + }, + map: function(number) { + return String(number); + } +}), example({ + fetch: function(params, foo1) { + return 123; + }, + map: function(number) { + return String(number); + } +}), branch({ + test: x, + if: function(t) { + return "a" === t; + }, + then: function(u) {} +}); diff --git a/crates/swc/tests/tsc-references/invalidNewTarget.es5.1.normal.js b/crates/swc/tests/tsc-references/invalidNewTarget.es5.1.normal.js deleted file mode 100644 index 84808f0232a..00000000000 --- a/crates/swc/tests/tsc-references/invalidNewTarget.es5.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [invalidNewTarget.es5.ts] -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! : ^^^^^^^^^^ -//! 2 | const b = () => new.target; -//! 3 | -//! 4 | class C { -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! 2 | const b = () => new.target; -//! : ^^^^^^^^^^ -//! 3 | -//! 4 | class C { -//! 5 | [new.target]() { } -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[16:1] -//! 16 | } -//! 17 | -//! 18 | const O = { -//! 19 | [new.target]: undefined, -//! : ^^^^^^^^^^ -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[20:1] -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! 23 | n: new.target, -//! : ^^^^^^^^^^ -//! 24 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/invalidNewTarget.es5.2.minified.js b/crates/swc/tests/tsc-references/invalidNewTarget.es5.2.minified.js deleted file mode 100644 index 84808f0232a..00000000000 --- a/crates/swc/tests/tsc-references/invalidNewTarget.es5.2.minified.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [invalidNewTarget.es5.ts] -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! : ^^^^^^^^^^ -//! 2 | const b = () => new.target; -//! 3 | -//! 4 | class C { -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! 2 | const b = () => new.target; -//! : ^^^^^^^^^^ -//! 3 | -//! 4 | class C { -//! 5 | [new.target]() { } -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[16:1] -//! 16 | } -//! 17 | -//! 18 | const O = { -//! 19 | [new.target]: undefined, -//! : ^^^^^^^^^^ -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[20:1] -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! 23 | n: new.target, -//! : ^^^^^^^^^^ -//! 24 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/invalidNewTarget.es6.1.normal.js b/crates/swc/tests/tsc-references/invalidNewTarget.es6.1.normal.js deleted file mode 100644 index cbb0bd3385e..00000000000 --- a/crates/swc/tests/tsc-references/invalidNewTarget.es6.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [invalidNewTarget.es6.ts] -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! : ^^^^^^^^^^ -//! 2 | const b = () => new.target; -//! 3 | -//! 4 | class C { -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! 2 | const b = () => new.target; -//! : ^^^^^^^^^^ -//! 3 | -//! 4 | class C { -//! 5 | [new.target]() { } -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[16:1] -//! 16 | } -//! 17 | -//! 18 | const O = { -//! 19 | [new.target]: undefined, -//! : ^^^^^^^^^^ -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[20:1] -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! 23 | n: new.target, -//! : ^^^^^^^^^^ -//! 24 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/invalidNewTarget.es6.2.minified.js b/crates/swc/tests/tsc-references/invalidNewTarget.es6.2.minified.js deleted file mode 100644 index cbb0bd3385e..00000000000 --- a/crates/swc/tests/tsc-references/invalidNewTarget.es6.2.minified.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [invalidNewTarget.es6.ts] -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! : ^^^^^^^^^^ -//! 2 | const b = () => new.target; -//! 3 | -//! 4 | class C { -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[1:1] -//! 1 | const a = new.target; -//! 2 | const b = () => new.target; -//! : ^^^^^^^^^^ -//! 3 | -//! 4 | class C { -//! 5 | [new.target]() { } -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[16:1] -//! 16 | } -//! 17 | -//! 18 | const O = { -//! 19 | [new.target]: undefined, -//! : ^^^^^^^^^^ -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! `---- -//! -//! x 'new.target' is only allowed in the body of a function declaration, function expression, or class. -//! ,-[20:1] -//! 20 | k() { return new.target; }, -//! 21 | get l() { return new.target; }, -//! 22 | set m(_) { _ = new.target; }, -//! 23 | n: new.target, -//! : ^^^^^^^^^^ -//! 24 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.1.normal.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.1.normal.js new file mode 100644 index 00000000000..55bf8a724b1 --- /dev/null +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.1.normal.js @@ -0,0 +1,15 @@ +//// [foo.js] +/** + * @typedef {{ + * [id: string]: [Function, Function]; + * }} ResolveRejectMap + */ let id = 0; +/** + * @param {ResolveRejectMap} handlers + * @returns {Promise} + */ const send = (handlers)=>new Promise((resolve, reject)=>{ + handlers[++id] = [ + resolve, + reject + ]; + }); diff --git a/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.2.minified.js b/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.2.minified.js new file mode 100644 index 00000000000..8885ba71967 --- /dev/null +++ b/crates/swc/tests/tsc-references/jsDeclarationsTypedefFunction.2.minified.js @@ -0,0 +1 @@ +//// [foo.js] diff --git a/crates/swc/tests/tsc-references/jsxAndTypeAssertion.1.normal.js b/crates/swc/tests/tsc-references/jsxAndTypeAssertion.1.normal.js deleted file mode 100644 index 90d8c8c7842..00000000000 --- a/crates/swc/tests/tsc-references/jsxAndTypeAssertion.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [jsxAndTypeAssertion.tsx] -//! -//! x Unexpected token `any`. Expected jsx identifier -//! ,-[4:1] -//! 4 | class foo {} -//! 5 | -//! 6 | var x: any; -//! 7 | x = { test: }; -//! : ^^^ -//! 8 | -//! 9 | x = ; -//! 10 | -//! `---- diff --git a/crates/swc/tests/tsc-references/jsxAndTypeAssertion.2.minified.js b/crates/swc/tests/tsc-references/jsxAndTypeAssertion.2.minified.js deleted file mode 100644 index 90d8c8c7842..00000000000 --- a/crates/swc/tests/tsc-references/jsxAndTypeAssertion.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [jsxAndTypeAssertion.tsx] -//! -//! x Unexpected token `any`. Expected jsx identifier -//! ,-[4:1] -//! 4 | class foo {} -//! 5 | -//! 6 | var x: any; -//! 7 | x = { test: }; -//! : ^^^ -//! 8 | -//! 9 | x = ; -//! 10 | -//! `---- diff --git a/crates/swc/tests/tsc-references/jsxParsingError1.1.normal.js b/crates/swc/tests/tsc-references/jsxParsingError1.1.normal.js deleted file mode 100644 index 5ccd701f9ac..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError1.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [jsxParsingError1.tsx] -//// [file.tsx] -// This should be a parse error -var class1 = "foo"; -var class2 = "bar"; -var elem = /*#__PURE__*/ React.createElement("div", { - className: (class1, class2) -}); diff --git a/crates/swc/tests/tsc-references/jsxParsingError1.2.minified.js b/crates/swc/tests/tsc-references/jsxParsingError1.2.minified.js deleted file mode 100644 index 2fd0332d2b7..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError1.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [jsxParsingError1.tsx] -//// [file.tsx] diff --git a/crates/swc/tests/tsc-references/jsxParsingError2.1.normal.js b/crates/swc/tests/tsc-references/jsxParsingError2.1.normal.js deleted file mode 100644 index 616c3831673..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError2.1.normal.js +++ /dev/null @@ -1,45 +0,0 @@ -//// [jsxParsingError2.tsx] -//// [file.tsx] -//// [Error1.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | // Issue error about missing span closing tag, not missing div closing tag -//! 2 | let x1 =
; -//! : ^^^ -//! 3 | -//! `---- -//// [Error2.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x2 =
; -//! : ^^^ -//! 2 | -//! 3 | -//! `---- -//// [Error3.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x3 =
; -//! : ^^^ -//! 2 | -//! 3 | -//! `---- -//// [Error4.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x4 =
; -//! : ^^^ -//! 2 | -//! `---- -//// [Error5.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x5 =
-//! : ^^^ -//! 2 | -//! `---- diff --git a/crates/swc/tests/tsc-references/jsxParsingError2.2.minified.js b/crates/swc/tests/tsc-references/jsxParsingError2.2.minified.js deleted file mode 100644 index 616c3831673..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError2.2.minified.js +++ /dev/null @@ -1,45 +0,0 @@ -//// [jsxParsingError2.tsx] -//// [file.tsx] -//// [Error1.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | // Issue error about missing span closing tag, not missing div closing tag -//! 2 | let x1 =
; -//! : ^^^ -//! 3 | -//! `---- -//// [Error2.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x2 =
; -//! : ^^^ -//! 2 | -//! 3 | -//! `---- -//// [Error3.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x3 =
; -//! : ^^^ -//! 2 | -//! 3 | -//! `---- -//// [Error4.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x4 =
; -//! : ^^^ -//! 2 | -//! `---- -//// [Error5.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[1:1] -//! 1 | let x5 =
-//! : ^^^ -//! 2 | -//! `---- diff --git a/crates/swc/tests/tsc-references/jsxParsingError3.1.normal.js b/crates/swc/tests/tsc-references/jsxParsingError3.1.normal.js deleted file mode 100644 index 6e8eb59e1a5..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError3.1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [jsxParsingError3.tsx] -//// [file.tsx] -//// [Error1.tsx] -var x1 = /*#__PURE__*/ React.createElement("div", null, "}"); -//// [Error2.tsx] -var x2 = /*#__PURE__*/ React.createElement("div", null, ">"); -//// [Error3.tsx] -var x3 = /*#__PURE__*/ React.createElement("div", null, "foo", "}"); -//// [Error4.tsx] -var x4 = /*#__PURE__*/ React.createElement("div", null, "foo", ">"); -//// [Error5.tsx] -var x5 = /*#__PURE__*/ React.createElement("div", null, "}", "foo"); -//// [Error6.tsx] -var x6 = /*#__PURE__*/ React.createElement("div", null, ">", "foo"); diff --git a/crates/swc/tests/tsc-references/jsxParsingError3.2.minified.js b/crates/swc/tests/tsc-references/jsxParsingError3.2.minified.js deleted file mode 100644 index f8d5dbf2da6..00000000000 --- a/crates/swc/tests/tsc-references/jsxParsingError3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [jsxParsingError3.tsx] -//// [file.tsx] -//// [Error1.tsx] -//// [Error2.tsx] -//// [Error3.tsx] -//// [Error4.tsx] -//// [Error5.tsx] -//// [Error6.tsx] diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js index 1c1ca536e83..8668316eb66 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.1.normal.js @@ -81,3 +81,17 @@ function f30() { function f31() { var x = "hello"; } +// Repro from #51069 +var Test = /*#__PURE__*/ function() { + "use strict"; + function Test(t) { + _class_call_check(this, Test); + this.testy = t; + } + var _proto = Test.prototype; + _proto.t = function t(key) { + this.testy[key] += 1; // Error + return this.testy[key]; + }; + return Test; +}(); diff --git a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.2.minified.js b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.2.minified.js index 882d31c7cd7..048854c4038 100644 --- a/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.2.minified.js +++ b/crates/swc/tests/tsc-references/keyofAndIndexedAccessErrors.2.minified.js @@ -1,2 +1,2 @@ //// [keyofAndIndexedAccessErrors.ts] -import "@swc/helpers/src/_class_call_check.mjs"; +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.1.normal.js b/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.1.normal.js new file mode 100644 index 00000000000..76358ed1eef --- /dev/null +++ b/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.1.normal.js @@ -0,0 +1,7 @@ +//// [leaveOptionalParameterAsWritten.ts] +//// [a.ts] +export { }; +//// [b.ts] +import * as a from "./a"; +//// [c.ts] +export var bar = function(p) {}; diff --git a/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.2.minified.js b/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.2.minified.js new file mode 100644 index 00000000000..8a9dcb35848 --- /dev/null +++ b/crates/swc/tests/tsc-references/leaveOptionalParameterAsWritten.2.minified.js @@ -0,0 +1,7 @@ +//// [leaveOptionalParameterAsWritten.ts] +//// [a.ts] +export { }; +//// [b.ts] +import "./a"; +//// [c.ts] +export var bar = function(p) {}; diff --git a/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.1.normal.js b/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.1.normal.js deleted file mode 100644 index 6d48a55febb..00000000000 --- a/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.1.normal.js +++ /dev/null @@ -1,75 +0,0 @@ -//// [logicalAndOperatorStrictMode.ts] -var a = [ - 0 -]; -var s = ""; -var x = 0; -var b = false; -var v = undefined; -var u = undefined; -var n = null; -var z = s || x || u; -var a1 = a && a; -var a2 = a && s; -var a3 = a && x; -var a4 = a && b; -var a5 = a && v; -var a6 = a && u; -var a7 = a && n; -var a8 = a && z; -var s1 = s && a; -var s2 = s && s; -var s3 = s && x; -var s4 = s && b; -var s5 = s && v; -var s6 = s && u; -var s7 = s && n; -var s8 = s && z; -var x1 = x && a; -var x2 = x && s; -var x3 = x && x; -var x4 = x && b; -var x5 = x && v; -var x6 = x && u; -var x7 = x && n; -var x8 = x && z; -var b1 = b && a; -var b2 = b && s; -var b3 = b && x; -var b4 = b && b; -var b5 = b && v; -var b6 = b && u; -var b7 = b && n; -var b8 = b && z; -var v1 = v && a; -var v2 = v && s; -var v3 = v && x; -var v4 = v && b; -var v5 = v && v; -var v6 = v && u; -var v7 = v && n; -var v8 = v && z; -var u1 = u && a; -var u2 = u && s; -var u3 = u && x; -var u4 = u && b; -var u5 = u && v; -var u6 = u && u; -var u7 = u && n; -var u8 = u && z; -var n1 = n && a; -var n2 = n && s; -var n3 = n && x; -var n4 = n && b; -var n5 = n && v; -var n6 = n && u; -var n7 = n && n; -var n8 = n && z; -var z1 = z && a; -var z2 = z && s; -var z3 = z && x; -var z4 = z && b; -var z5 = z && v; -var z6 = z && u; -var z7 = z && n; -var z8 = z && z; diff --git a/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.2.minified.js b/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.2.minified.js deleted file mode 100644 index 7eecebdc57d..00000000000 --- a/crates/swc/tests/tsc-references/logicalAndOperatorStrictMode.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [logicalAndOperatorStrictMode.ts] diff --git a/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.1.normal.js b/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.1.normal.js deleted file mode 100644 index a102cca389e..00000000000 --- a/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.1.normal.js +++ /dev/null @@ -1,117 +0,0 @@ -//// [logicalAndOperatorWithEveryType.ts] -// The && operator permits the operands to be of any type and produces a result of the same -// type as the second operand. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -var a1; -var a2; -var a3; -var a4; -var a5; -var a6; -var a7; -var a8; -var ra1 = a1 && a1; -var ra2 = a2 && a1; -var ra3 = a3 && a1; -var ra4 = a4 && a1; -var ra5 = a5 && a1; -var ra6 = a6 && a1; -var ra7 = a7 && a1; -var ra8 = a8 && a1; -var ra9 = null && a1; -var ra10 = undefined && a1; -var rb1 = a1 && a2; -var rb2 = a2 && a2; -var rb3 = a3 && a2; -var rb4 = a4 && a2; -var rb5 = a5 && a2; -var rb6 = a6 && a2; -var rb7 = a7 && a2; -var rb8 = a8 && a2; -var rb9 = null && a2; -var rb10 = undefined && a2; -var rc1 = a1 && a3; -var rc2 = a2 && a3; -var rc3 = a3 && a3; -var rc4 = a4 && a3; -var rc5 = a5 && a3; -var rc6 = a6 && a3; -var rc7 = a7 && a3; -var rc8 = a8 && a3; -var rc9 = null && a3; -var rc10 = undefined && a3; -var rd1 = a1 && a4; -var rd2 = a2 && a4; -var rd3 = a3 && a4; -var rd4 = a4 && a4; -var rd5 = a5 && a4; -var rd6 = a6 && a4; -var rd7 = a7 && a4; -var rd8 = a8 && a4; -var rd9 = null && a4; -var rd10 = undefined && a4; -var re1 = a1 && a5; -var re2 = a2 && a5; -var re3 = a3 && a5; -var re4 = a4 && a5; -var re5 = a5 && a5; -var re6 = a6 && a5; -var re7 = a7 && a5; -var re8 = a8 && a5; -var re9 = null && a5; -var re10 = undefined && a5; -var rf1 = a1 && a6; -var rf2 = a2 && a6; -var rf3 = a3 && a6; -var rf4 = a4 && a6; -var rf5 = a5 && a6; -var rf6 = a6 && a6; -var rf7 = a7 && a6; -var rf8 = a8 && a6; -var rf9 = null && a6; -var rf10 = undefined && a6; -var rg1 = a1 && a7; -var rg2 = a2 && a7; -var rg3 = a3 && a7; -var rg4 = a4 && a7; -var rg5 = a5 && a7; -var rg6 = a6 && a7; -var rg7 = a7 && a7; -var rg8 = a8 && a7; -var rg9 = null && a7; -var rg10 = undefined && a7; -var rh1 = a1 && a8; -var rh2 = a2 && a8; -var rh3 = a3 && a8; -var rh4 = a4 && a8; -var rh5 = a5 && a8; -var rh6 = a6 && a8; -var rh7 = a7 && a8; -var rh8 = a8 && a8; -var rh9 = null && a8; -var rh10 = undefined && a8; -var ri1 = a1 && null; -var ri2 = a2 && null; -var ri3 = a3 && null; -var ri4 = a4 && null; -var ri5 = a5 && null; -var ri6 = a6 && null; -var ri7 = a7 && null; -var ri8 = a8 && null; -var ri9 = null && null; -var ri10 = undefined && null; -var rj1 = a1 && undefined; -var rj2 = a2 && undefined; -var rj3 = a3 && undefined; -var rj4 = a4 && undefined; -var rj5 = a5 && undefined; -var rj6 = a6 && undefined; -var rj7 = a7 && undefined; -var rj8 = a8 && undefined; -var rj9 = null && undefined; -var rj10 = undefined && undefined; diff --git a/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.2.minified.js b/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.2.minified.js deleted file mode 100644 index fde6f58ede2..00000000000 --- a/crates/swc/tests/tsc-references/logicalAndOperatorWithEveryType.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [logicalAndOperatorWithEveryType.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.1.normal.js deleted file mode 100644 index 11cdd10f258..00000000000 --- a/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [logicalNotOperatorInvalidOperations.ts] -//! -//! x Expression expected -//! ,-[8:1] -//! 8 | var BOOLEAN2 = !b + b; -//! 9 | -//! 10 | // miss an operand -//! 11 | var BOOLEAN3 =!; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.2.minified.js deleted file mode 100644 index 11cdd10f258..00000000000 --- a/crates/swc/tests/tsc-references/logicalNotOperatorInvalidOperations.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [logicalNotOperatorInvalidOperations.ts] -//! -//! x Expression expected -//! ,-[8:1] -//! 8 | var BOOLEAN2 = !b + b; -//! 9 | -//! 10 | // miss an operand -//! 11 | var BOOLEAN3 =!; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.1.normal.js b/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.1.normal.js deleted file mode 100644 index 5035ae956da..00000000000 --- a/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.1.normal.js +++ /dev/null @@ -1,119 +0,0 @@ -//// [logicalOrOperatorWithEveryType.ts] -// The || operator permits the operands to be of any type. -// If the || expression is not contextually typed, the right operand is contextually typed -// by the type of the left operand and the result is of the best common type of the two -// operand types. -var E; -(function(E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; - E[E["c"] = 2] = "c"; -})(E || (E = {})); -var a1; -var a2; -var a3; -var a4; -var a5; -var a6; -var a7; -var a8; -var ra1 = a1 || a1; // any || any is any -var ra2 = a2 || a1; // boolean || any is any -var ra3 = a3 || a1; // number || any is any -var ra4 = a4 || a1; // string || any is any -var ra5 = a5 || a1; // void || any is any -var ra6 = a6 || a1; // enum || any is any -var ra7 = a7 || a1; // object || any is any -var ra8 = a8 || a1; // array || any is any -var ra9 = null || a1; // null || any is any -var ra10 = undefined || a1; // undefined || any is any -var rb1 = a1 || a2; // any || boolean is any -var rb2 = a2 || a2; // boolean || boolean is boolean -var rb3 = a3 || a2; // number || boolean is number | boolean -var rb4 = a4 || a2; // string || boolean is string | boolean -var rb5 = a5 || a2; // void || boolean is void | boolean -var rb6 = a6 || a2; // enum || boolean is E | boolean -var rb7 = a7 || a2; // object || boolean is object | boolean -var rb8 = a8 || a2; // array || boolean is array | boolean -var rb9 = null || a2; // null || boolean is boolean -var rb10 = undefined || a2; // undefined || boolean is boolean -var rc1 = a1 || a3; // any || number is any -var rc2 = a2 || a3; // boolean || number is boolean | number -var rc3 = a3 || a3; // number || number is number -var rc4 = a4 || a3; // string || number is string | number -var rc5 = a5 || a3; // void || number is void | number -var rc6 = a6 || a3; // enum || number is number -var rc7 = a7 || a3; // object || number is object | number -var rc8 = a8 || a3; // array || number is array | number -var rc9 = null || a3; // null || number is number -var rc10 = undefined || a3; // undefined || number is number -var rd1 = a1 || a4; // any || string is any -var rd2 = a2 || a4; // boolean || string is boolean | string -var rd3 = a3 || a4; // number || string is number | string -var rd4 = a4 || a4; // string || string is string -var rd5 = a5 || a4; // void || string is void | string -var rd6 = a6 || a4; // enum || string is enum | string -var rd7 = a7 || a4; // object || string is object | string -var rd8 = a8 || a4; // array || string is array | string -var rd9 = null || a4; // null || string is string -var rd10 = undefined || a4; // undefined || string is string -var re1 = a1 || a5; // any || void is any -var re2 = a2 || a5; // boolean || void is boolean | void -var re3 = a3 || a5; // number || void is number | void -var re4 = a4 || a5; // string || void is string | void -var re5 = a5 || a5; // void || void is void -var re6 = a6 || a5; // enum || void is enum | void -var re7 = a7 || a5; // object || void is object | void -var re8 = a8 || a5; // array || void is array | void -var re9 = null || a5; // null || void is void -var re10 = undefined || a5; // undefined || void is void -var rg1 = a1 || a6; // any || enum is any -var rg2 = a2 || a6; // boolean || enum is boolean | enum -var rg3 = a3 || a6; // number || enum is number -var rg4 = a4 || a6; // string || enum is string | enum -var rg5 = a5 || a6; // void || enum is void | enum -var rg6 = a6 || a6; // enum || enum is E -var rg7 = a7 || a6; // object || enum is object | enum -var rg8 = a8 || a6; // array || enum is array | enum -var rg9 = null || a6; // null || enum is E -var rg10 = undefined || a6; // undefined || enum is E -var rh1 = a1 || a7; // any || object is any -var rh2 = a2 || a7; // boolean || object is boolean | object -var rh3 = a3 || a7; // number || object is number | object -var rh4 = a4 || a7; // string || object is string | object -var rh5 = a5 || a7; // void || object is void | object -var rh6 = a6 || a7; // enum || object is enum | object -var rh7 = a7 || a7; // object || object is object -var rh8 = a8 || a7; // array || object is array | object -var rh9 = null || a7; // null || object is object -var rh10 = undefined || a7; // undefined || object is object -var ri1 = a1 || a8; // any || array is any -var ri2 = a2 || a8; // boolean || array is boolean | array -var ri3 = a3 || a8; // number || array is number | array -var ri4 = a4 || a8; // string || array is string | array -var ri5 = a5 || a8; // void || array is void | array -var ri6 = a6 || a8; // enum || array is enum | array -var ri7 = a7 || a8; // object || array is object | array -var ri8 = a8 || a8; // array || array is array -var ri9 = null || a8; // null || array is array -var ri10 = undefined || a8; // undefined || array is array -var rj1 = a1 || null; // any || null is any -var rj2 = a2 || null; // boolean || null is boolean -var rj3 = a3 || null; // number || null is number -var rj4 = a4 || null; // string || null is string -var rj5 = a5 || null; // void || null is void -var rj6 = a6 || null; // enum || null is E -var rj7 = a7 || null; // object || null is object -var rj8 = a8 || null; // array || null is array -var rj9 = null || null; // null || null is any -var rj10 = undefined || null; // undefined || null is any -var rf1 = a1 || undefined; // any || undefined is any -var rf2 = a2 || undefined; // boolean || undefined is boolean -var rf3 = a3 || undefined; // number || undefined is number -var rf4 = a4 || undefined; // string || undefined is string -var rf5 = a5 || undefined; // void || undefined is void -var rf6 = a6 || undefined; // enum || undefined is E -var rf7 = a7 || undefined; // object || undefined is object -var rf8 = a8 || undefined; // array || undefined is array -var rf9 = null || undefined; // null || undefined is any -var rf10 = undefined || undefined; // undefined || undefined is any diff --git a/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.2.minified.js b/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.2.minified.js deleted file mode 100644 index fc4c73f1924..00000000000 --- a/crates/swc/tests/tsc-references/logicalOrOperatorWithEveryType.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [logicalOrOperatorWithEveryType.ts] -var E; -!function(E) { - E[E.a = 0] = "a", E[E.b = 1] = "b", E[E.c = 2] = "c"; -}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/mappedTypeConstraints2.1.normal.js b/crates/swc/tests/tsc-references/mappedTypeConstraints2.1.normal.js new file mode 100644 index 00000000000..5258538027a --- /dev/null +++ b/crates/swc/tests/tsc-references/mappedTypeConstraints2.1.normal.js @@ -0,0 +1,21 @@ +//// [mappedTypeConstraints2.ts] +function f1(obj, key) { + const x = obj[key]; +} +function f2(obj, key) { + const x = obj[key]; // Error +} +function f3(obj, key) { + const x = obj[key]; // Error +} +const get = (t, foo)=>foo[`get${t}`]; // Type 'Foo[`get${T}`]' is not assignable to type 'T' +function validate(obj, bounds) { + for (const [key, val] of Object.entries(obj)){ + const boundsForKey = bounds[key]; + if (boundsForKey) { + const { min , max } = boundsForKey; + if (min > val || max < val) return false; + } + } + return true; +} diff --git a/crates/swc/tests/tsc-references/mappedTypeConstraints2.2.minified.js b/crates/swc/tests/tsc-references/mappedTypeConstraints2.2.minified.js new file mode 100644 index 00000000000..d2fd415629d --- /dev/null +++ b/crates/swc/tests/tsc-references/mappedTypeConstraints2.2.minified.js @@ -0,0 +1 @@ +//// [mappedTypeConstraints2.ts] diff --git a/crates/swc/tests/tsc-references/mergedWithLocalValue.1.normal.js b/crates/swc/tests/tsc-references/mergedWithLocalValue.1.normal.js new file mode 100644 index 00000000000..71b7e28b783 --- /dev/null +++ b/crates/swc/tests/tsc-references/mergedWithLocalValue.1.normal.js @@ -0,0 +1,6 @@ +//// [a.ts] +export { }; +//// [b.ts] +var A = "a"; +A.toUpperCase(); +export { }; diff --git a/crates/swc/tests/tsc-references/mergedWithLocalValue.2.minified.js b/crates/swc/tests/tsc-references/mergedWithLocalValue.2.minified.js new file mode 100644 index 00000000000..5c34445ee6d --- /dev/null +++ b/crates/swc/tests/tsc-references/mergedWithLocalValue.2.minified.js @@ -0,0 +1,4 @@ +//// [a.ts] +export { }; +//// [b.ts] +export { }; diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment7.1.normal.js b/crates/swc/tests/tsc-references/moduleExportAssignment7.1.normal.js new file mode 100644 index 00000000000..f203ea485cc --- /dev/null +++ b/crates/swc/tests/tsc-references/moduleExportAssignment7.1.normal.js @@ -0,0 +1,58 @@ +//// [mod.js] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +var Thing = function Thing() { + "use strict"; + _class_call_check(this, Thing); + this.x = 1; +}; +var AnotherThing = function AnotherThing() { + "use strict"; + _class_call_check(this, AnotherThing); + this.y = 2; +}; +function foo() { + return 3; +} +function bar() { + return 4; +} +/** @typedef {() => number} buz */ module.exports = { + Thing: Thing, + AnotherThing: AnotherThing, + foo: foo, + qux: bar, + baz: function baz() { + return 5; + }, + literal: "" +}; +//// [main.js] +/** + * @param {import("./mod").Thing} a + * @param {import("./mod").AnotherThing} b + * @param {import("./mod").foo} c + * @param {import("./mod").qux} d + * @param {import("./mod").baz} e + * @param {import("./mod").buz} f + * @param {import("./mod").literal} g + */ function jstypes(a, b, c, d, e, f, g) { + return a.x + b.y + c() + d() + e() + f() + g.length; +} +/** + * @param {typeof import("./mod").Thing} a + * @param {typeof import("./mod").AnotherThing} b + * @param {typeof import("./mod").foo} c + * @param {typeof import("./mod").qux} d + * @param {typeof import("./mod").baz} e + * @param {typeof import("./mod").buz} f + * @param {typeof import("./mod").literal} g + */ function jsvalues(a, b, c, d, e, f, g) { + return a.length + b.length + c() + d() + e() + f() + g.length; +} +//// [index.ts] +function types(a, b, c, d, e, f, g) { + return a.x + b.y + c() + d() + e() + f() + g.length; +} +function values(a, b, c, d, e, f, g) { + return a.length + b.length + c() + d() + e() + f() + g.length; +} diff --git a/crates/swc/tests/tsc-references/moduleExportAssignment7.2.minified.js b/crates/swc/tests/tsc-references/moduleExportAssignment7.2.minified.js new file mode 100644 index 00000000000..7d7877b3033 --- /dev/null +++ b/crates/swc/tests/tsc-references/moduleExportAssignment7.2.minified.js @@ -0,0 +1,24 @@ +//// [mod.js] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +module.exports = { + Thing: function Thing() { + "use strict"; + _class_call_check(this, Thing), this.x = 1; + }, + AnotherThing: function AnotherThing() { + "use strict"; + _class_call_check(this, AnotherThing), this.y = 2; + }, + foo: function() { + return 3; + }, + qux: function() { + return 4; + }, + baz: function() { + return 5; + }, + literal: "" +}; +//// [main.js] +//// [index.ts] diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.1.normal.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.1.normal.js deleted file mode 100644 index 420d5c48d32..00000000000 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.1.normal.js +++ /dev/null @@ -1,61 +0,0 @@ -//// [negateOperatorWithAnyOtherType.ts] -// - operator on any type -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var ANY; -var ANY1; -var ANY2 = [ - "", - "" -]; -var obj; -var obj1 = { - x: "", - y: function() {} -}; -function foo() { - var a; - return a; -} -var A = /*#__PURE__*/ function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - A.foo = function foo() { - var a; - return a; - }; - return A; -}(); -var M; -(function(M) { - var n; - M.n = n; -})(M || (M = {})); -var objA = new A(); -// any type var -var ResultIsNumber1 = -ANY1; -var ResultIsNumber2 = -ANY2; -var ResultIsNumber3 = -A; -var ResultIsNumber4 = -M; -var ResultIsNumber5 = -obj; -var ResultIsNumber6 = -obj1; -// any type literal -var ResultIsNumber7 = -undefined; -var ResultIsNumber = -null; -// any type expressions -var ResultIsNumber8 = -ANY2[0]; -var ResultIsNumber9 = -obj1.x; -var ResultIsNumber10 = -obj1.y; -var ResultIsNumber11 = -objA.a; -var ResultIsNumber12 = -M.n; -var ResultIsNumber13 = -foo(); -var ResultIsNumber14 = -A.foo(); -var ResultIsNumber15 = -(ANY - ANY1); -// miss assignment operators --ANY; --ANY1; --ANY2[0]; --ANY, ANY1; --objA.a; --M.n; diff --git a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.2.minified.js b/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.2.minified.js deleted file mode 100644 index a7948645b65..00000000000 --- a/crates/swc/tests/tsc-references/negateOperatorWithAnyOtherType.2.minified.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [negateOperatorWithAnyOtherType.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var M, obj1 = { - x: "", - y: function() {} -}, A = function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - return A.foo = function() {}, A; -}(); -!function(M) { - var n; - M.n = n; -}(M || (M = {})); -var objA = new A(); -obj1.x, obj1.y, objA.a, M.n, A.foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases.1.normal.js b/crates/swc/tests/tsc-references/newOperatorErrorCases.1.normal.js deleted file mode 100644 index ef7615daa4f..00000000000 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [newOperatorErrorCases.ts] -//! -//! x Expected a semicolon -//! ,-[24:1] -//! 24 | var nestedCtor: nestedCtor; -//! 25 | -//! 26 | // Construct expression with no parentheses for construct signature with > 0 parameters -//! 27 | var b = new C0 32, ''; // Parse error -//! : ^^ -//! 28 | -//! 29 | // Generic construct expression with no parentheses -//! 30 | var c1 = new T; -//! `---- diff --git a/crates/swc/tests/tsc-references/newOperatorErrorCases.2.minified.js b/crates/swc/tests/tsc-references/newOperatorErrorCases.2.minified.js deleted file mode 100644 index ef7615daa4f..00000000000 --- a/crates/swc/tests/tsc-references/newOperatorErrorCases.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [newOperatorErrorCases.ts] -//! -//! x Expected a semicolon -//! ,-[24:1] -//! 24 | var nestedCtor: nestedCtor; -//! 25 | -//! 26 | // Construct expression with no parentheses for construct signature with > 0 parameters -//! 27 | var b = new C0 32, ''; // Parse error -//! : ^^ -//! 28 | -//! 29 | // Generic construct expression with no parentheses -//! 30 | var c1 = new T; -//! `---- diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.1.normal.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.1.normal.js index c65f8aab33f..6bda6ef0e03 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.1.normal.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.1.normal.js @@ -30,6 +30,13 @@ t2.z.toString(); // Should error x1.toFixed(); // Should OK q.y.toFixed(); // Should OK q.z.toFixed(); // Should error +}{ + var x2 = numMapPoint.x, q1 = _object_without_properties(numMapPoint, [ + "x" + ]); + x2.toFixed(); // Should OK + q1.y.toFixed(); // Should OK + q1.z.toFixed(); // Should error }var ref; // Assignment forms ref = _sliced_to_array(strArray, 1), target_string = ref[0], ref; // Should error @@ -38,9 +45,9 @@ ref1 = _sliced_to_array(strArray, 1), target_string_undef = ref1[0], ref1; // Sh var ref2; ref2 = _to_array(strArray), target_string_arr = ref2.slice(3), ref2; // Should OK { - var x2, y1, z1; + var x3, y1, z1; var ref3; - ref3 = numMapPoint, x2 = ref3.x, y1 = ref3.y, z1 = ref3.z, ref3; // Should OK - var q1; - q1 = numMapPoint.q; // Should error + ref3 = numMapPoint, x3 = ref3.x, y1 = ref3.y, z1 = ref3.z, ref3; // Should OK + var q2; + q2 = numMapPoint.q; // Should error } diff --git a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.2.minified.js b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.2.minified.js index fefc57a32d9..0349018837b 100644 --- a/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.2.minified.js +++ b/crates/swc/tests/tsc-references/noUncheckedIndexedAccessDestructuring.2.minified.js @@ -10,4 +10,8 @@ x.toFixed(), y.toFixed(), z.toFixed(); var x1 = numMapPoint.x, q = _object_without_properties(numMapPoint, [ "x" ]); -x1.toFixed(), q.y.toFixed(), q.z.toFixed(), target_string = _sliced_to_array(strArray, 1)[0], target_string_undef = _sliced_to_array(strArray, 1)[0], target_string_arr = _to_array(strArray).slice(3), (ref3 = numMapPoint).x, ref3.y, ref3.z, numMapPoint.q; +x1.toFixed(), q.y.toFixed(), q.z.toFixed(); +var x2 = numMapPoint.x, q1 = _object_without_properties(numMapPoint, [ + "x" +]); +x2.toFixed(), q1.y.toFixed(), q1.z.toFixed(), target_string = _sliced_to_array(strArray, 1)[0], target_string_undef = _sliced_to_array(strArray, 1)[0], target_string_arr = _to_array(strArray).slice(3), (ref3 = numMapPoint).x, ref3.y, ref3.z, numMapPoint.q; diff --git a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js new file mode 100644 index 00000000000..74adc1945e0 --- /dev/null +++ b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.1.normal.js @@ -0,0 +1,20 @@ +//// [nodeModulesAtTypesPriority.ts] +//// [/node_modules/@types/react/index.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare const React: any; +//! 2 | export = React; +//! : ^^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/node_modules/@types/redux/index.d.ts] +export { }; +//// [/packages/a/node_modules/react/index.js] +module.exports = {}; +//// [/packages/a/node_modules/redux/index.d.ts] +export { }; +//// [/packages/a/node_modules/redux/index.js] +module.exports = {}; +//// [/packages/a/index.ts] +import React from "react"; diff --git a/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js new file mode 100644 index 00000000000..45c14909401 --- /dev/null +++ b/crates/swc/tests/tsc-references/nodeModulesAtTypesPriority.2.minified.js @@ -0,0 +1,20 @@ +//// [nodeModulesAtTypesPriority.ts] +//// [/node_modules/@types/react/index.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare const React: any; +//! 2 | export = React; +//! : ^^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/node_modules/@types/redux/index.d.ts] +export { }; +//// [/packages/a/node_modules/react/index.js] +module.exports = {}; +//// [/packages/a/node_modules/redux/index.d.ts] +export { }; +//// [/packages/a/node_modules/redux/index.js] +module.exports = {}; +//// [/packages/a/index.ts] +import "react"; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.1.normal.js new file mode 100644 index 00000000000..d016e0c51dd --- /dev/null +++ b/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.1.normal.js @@ -0,0 +1,5 @@ +//// [nonPrimitiveAndEmptyObject.ts] +// Repro from #49480 +var _foo_fooProps = foo.fooProps, fooProps = _foo_fooProps === void 0 ? {} : _foo_fooProps; +fooProps.barProp; +export { }; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.2.minified.js new file mode 100644 index 00000000000..325d3d0216f --- /dev/null +++ b/crates/swc/tests/tsc-references/nonPrimitiveAndEmptyObject.2.minified.js @@ -0,0 +1,4 @@ +//// [nonPrimitiveAndEmptyObject.ts] +var _foo_fooProps = foo.fooProps; +(void 0 === _foo_fooProps ? {} : _foo_fooProps).barProp; +export { }; diff --git a/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.1.normal.js b/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.1.normal.js deleted file mode 100644 index 96d6db19a1d..00000000000 --- a/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [nonPrimitiveStrictNull.ts] -var a; -var e; -a.toString; // error -a = undefined; // error -a = null; // error -a = b; // error -a = c; // error -a = d; // error -e = a; // ok -a = e; // ok -if (typeof b !== "object") { - b.toString(); // error, never -} -if (typeof b === "object") { - a = b; // error, b is not narrowed -} -if (typeof d === "object") { - b = d; // ok - d.toString(); // error, object | null -} else { - d.toString(); // error, undefined -} -if (d == null) { - d.toString(); // error, undefined | null -} else { - d.toString(); // object -} -if (d === null) { - d.toString(); // error, null -} else { - d.toString(); // error, object | undefined -} -if (typeof d === "undefined") { - d.toString(); // error, undefined -} else { - d.toString(); // error, object | null -} -var x; // error -var y; // error -var z; // error -var u; // ok diff --git a/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.2.minified.js b/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.2.minified.js deleted file mode 100644 index e2a94a941eb..00000000000 --- a/crates/swc/tests/tsc-references/nonPrimitiveStrictNull.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [nonPrimitiveStrictNull.ts] -var a; -a.toString, a = void 0, a = null, a = b, a = c, a = a = d, "object" != typeof b && b.toString(), "object" == typeof b && (a = b), "object" == typeof d && (b = d), d.toString(), d, d.toString(), d, d.toString(), d.toString(); diff --git a/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js b/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js new file mode 100644 index 00000000000..f3f48359f15 --- /dev/null +++ b/crates/swc/tests/tsc-references/numericStringLiteralTypes.1.normal.js @@ -0,0 +1,16 @@ +//// [numericStringLiteralTypes.ts] +function f1(a, x) { + var s = a[x]; // boolean +} +function f2(a, x) { + var s = a[x]; // boolean +} +var container1 = createContainer("hi"); +var container2 = createContainer(2); +f([ + container1, + container2 +], function(value1, value2) { + value1; // string + value2; // number +}); diff --git a/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js b/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js new file mode 100644 index 00000000000..d7ee94e53e9 --- /dev/null +++ b/crates/swc/tests/tsc-references/numericStringLiteralTypes.2.minified.js @@ -0,0 +1,6 @@ +//// [numericStringLiteralTypes.ts] +var container1 = createContainer("hi"), container2 = createContainer(2); +f([ + container1, + container2 +], function(value1, value2) {}); diff --git a/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.1.normal.js b/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.1.normal.js deleted file mode 100644 index e22ff2ad329..00000000000 --- a/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [numericStringNamedPropertyEquivalence.ts] -// Each of these types has an error in it. -// String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; -var a; -var b = { - "0": "", - 0: "" -}; diff --git a/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.2.minified.js b/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.2.minified.js deleted file mode 100644 index a2ab29a1c43..00000000000 --- a/crates/swc/tests/tsc-references/numericStringNamedPropertyEquivalence.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [numericStringNamedPropertyEquivalence.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.1.normal.js b/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.1.normal.js deleted file mode 100644 index 5a1b7ee9dbd..00000000000 --- a/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [objectBindingPatternKeywordIdentifiers01.ts] -//! -//! x Cannot use a reserved word as a shorthand property -//! ,-[1:1] -//! 1 | -//! 2 | var { while } = { while: 1 } -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.2.minified.js b/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.2.minified.js deleted file mode 100644 index 5a1b7ee9dbd..00000000000 --- a/crates/swc/tests/tsc-references/objectBindingPatternKeywordIdentifiers01.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [objectBindingPatternKeywordIdentifiers01.ts] -//! -//! x Cannot use a reserved word as a shorthand property -//! ,-[1:1] -//! 1 | -//! 2 | var { while } = { while: 1 } -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.1.normal.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.1.normal.js deleted file mode 100644 index 050c3f60c1b..00000000000 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.1.normal.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts] -var x = { - x: x, - undefinedVariable: undefinedVariable // Error -}; diff --git a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.2.minified.js b/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.2.minified.js deleted file mode 100644 index 39dcea86a97..00000000000 --- a/crates/swc/tests/tsc-references/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts] -var x = { - x: x, - undefinedVariable: undefinedVariable -}; diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative.1.normal.js b/crates/swc/tests/tsc-references/objectSpreadNegative.1.normal.js deleted file mode 100644 index 5e3094b2655..00000000000 --- a/crates/swc/tests/tsc-references/objectSpreadNegative.1.normal.js +++ /dev/null @@ -1,114 +0,0 @@ -//// [objectSpreadNegative.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _object_spread from "@swc/helpers/src/_object_spread.mjs"; -import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs"; -var o = { - a: 1, - b: "no" -}; -/// private propagates -var PrivateOptionalX = function PrivateOptionalX() { - "use strict"; - _class_call_check(this, PrivateOptionalX); -}; -var PublicX = function PublicX() { - "use strict"; - _class_call_check(this, PublicX); -}; -var o2 = _object_spread({}, publicX, privateOptionalX); -var sn = o2.x; // error, x is private -var allOptional = _object_spread({}, optionalString, optionalNumber); -var spread = _object_spread({}, { - b: true -}, { - s: "foo" -}); -spread = { - s: "foo" -}; // error, missing 'b' -var b = { - b: false -}; -spread = b; // error, missing 's' -// literal repeats are not allowed, but spread repeats are fine -var duplicated = _object_spread_props(_object_spread(_object_spread_props(_object_spread({ - b: "bad" -}, o), { - b: "bad" -}), o2), { - b: "bad" -}); -var duplicatedSpread = _object_spread({}, o, o); -// Note: ignore changes the order that properties are printed -var ignore = _object_spread({ - b: "ignored" -}, o); -var o3 = { - a: 1, - b: "no" -}; -var o4 = { - b: "yes", - c: true -}; -var combinedBefore = _object_spread({ - b: "ok" -}, o3, o4); -var combinedMid = _object_spread(_object_spread_props(_object_spread({}, o3), { - b: "ok" -}), o4); -var combinedNested = _object_spread(_object_spread_props(_object_spread({}, _object_spread({ - a: 4 -}, { - b: false, - c: "overriden" -})), { - d: "actually new" -}), { - a: 5, - d: "maybe new" -}); -var changeTypeBefore = _object_spread({ - a: "wrong type?" -}, o3); -var _obj; -var computedMiddle = _object_spread(_object_spread_props(_object_spread({}, o3), (_obj = {}, _define_property(_obj, "in the middle", 13), _define_property(_obj, "b", "maybe?"), _obj)), o4); -// primitives are not allowed, except for falsy ones -var spreadNum = _object_spread({}, 12); -var spreadSum = _object_spread({}, 1 + 1); -var spreadZero = _object_spread({}, 0); -spreadZero.toFixed(); // error, no methods even from a falsy number -var spreadBool = _object_spread({}, true); -spreadBool.valueOf(); -var spreadStr = _object_spread({}, "foo"); -spreadStr.length; // error, no 'length' -spreadStr.charAt(1); // error, no methods either -// functions are skipped -var spreadFunc = _object_spread({}, function() {}); -spreadFunc(); // error, no call signature -// write-only properties get skipped -var setterOnly = _object_spread({}, { - set b (bad){} -}); -setterOnly.b = 12; // error, 'b' does not exist -// methods are skipped because they aren't enumerable -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - this.p = 1; - } - var _proto = C.prototype; - _proto.m = function m() {}; - return C; -}(); -var c = new C(); -var spreadC = _object_spread({}, c); -spreadC.m(); // error 'm' is not in '{ ... c }' -// non primitive -var obj = { - a: 123 -}; -var spreadObj = _object_spread({}, obj); -spreadObj.a; // error 'a' is not in {} diff --git a/crates/swc/tests/tsc-references/objectSpreadNegative.2.minified.js b/crates/swc/tests/tsc-references/objectSpreadNegative.2.minified.js deleted file mode 100644 index 6433a880867..00000000000 --- a/crates/swc/tests/tsc-references/objectSpreadNegative.2.minified.js +++ /dev/null @@ -1,58 +0,0 @@ -//// [objectSpreadNegative.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _object_spread from "@swc/helpers/src/_object_spread.mjs"; -import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs"; -var _obj, o = { - a: 1, - b: "no" -}, o2 = _object_spread({}, publicX, privateOptionalX); -o2.x, _object_spread({}, optionalString, optionalNumber), _object_spread({}, { - b: !0 -}, { - s: "foo" -}), _object_spread_props(_object_spread(_object_spread_props(_object_spread({ - b: "bad" -}, o), { - b: "bad" -}), o2), { - b: "bad" -}), _object_spread({}, o, o), _object_spread({ - b: "ignored" -}, o); -var o3 = { - a: 1, - b: "no" -}, o4 = { - b: "yes", - c: !0 -}; -_object_spread({ - b: "ok" -}, o3, o4), _object_spread(_object_spread_props(_object_spread({}, o3), { - b: "ok" -}), o4), _object_spread(_object_spread_props(_object_spread({}, _object_spread({ - a: 4 -}, { - b: !1, - c: "overriden" -})), { - d: "actually new" -}), { - a: 5, - d: "maybe new" -}), _object_spread({ - a: "wrong type?" -}, o3), _object_spread(_object_spread_props(_object_spread({}, o3), (_define_property(_obj = {}, "in the middle", 13), _define_property(_obj, "b", "maybe?"), _obj)), o4), _object_spread({}, 12), _object_spread({}, 2), _object_spread({}, 0).toFixed(), _object_spread({}, !0).valueOf(); -var spreadStr = _object_spread({}, "foo"); -spreadStr.length, spreadStr.charAt(1), _object_spread({}, function() {})(), _object_spread({}, { - set b (bad){} -}).b = 12, _object_spread({}, new (function() { - "use strict"; - function C() { - _class_call_check(this, C), this.p = 1; - } - return C.prototype.m = function() {}, C; -}())()).m(), _object_spread({}, { - a: 123 -}).a; diff --git a/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.1.normal.js b/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.1.normal.js deleted file mode 100644 index cea5268f05f..00000000000 --- a/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [objectTypeWithDuplicateNumericProperty.ts] -// numeric properties must be distinct after a ToNumber operation -// so the below are all errors -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; -var a; -var b = { - 1: 1, - 1.0: 1, - 1.: 1, - 1.00: 1 -}; diff --git a/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.2.minified.js b/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.2.minified.js deleted file mode 100644 index 054418e2d2d..00000000000 --- a/crates/swc/tests/tsc-references/objectTypeWithDuplicateNumericProperty.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [objectTypeWithDuplicateNumericProperty.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/octalIntegerLiteralError.1.normal.js b/crates/swc/tests/tsc-references/octalIntegerLiteralError.1.normal.js deleted file mode 100644 index fc47628694e..00000000000 --- a/crates/swc/tests/tsc-references/octalIntegerLiteralError.1.normal.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [octalIntegerLiteralError.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var oct1 = 0O13334823; -//! : ^^^ -//! 3 | var oct2 = 0o34318592; -//! 4 | -//! 5 | var obj1 = { -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var oct1 = 0O13334823; -//! 3 | var oct2 = 0o34318592; -//! : ^^^^ -//! 4 | -//! 5 | var obj1 = { -//! 6 | 0O45436: "hi", -//! `---- diff --git a/crates/swc/tests/tsc-references/octalIntegerLiteralError.2.minified.js b/crates/swc/tests/tsc-references/octalIntegerLiteralError.2.minified.js deleted file mode 100644 index fc47628694e..00000000000 --- a/crates/swc/tests/tsc-references/octalIntegerLiteralError.2.minified.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [octalIntegerLiteralError.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var oct1 = 0O13334823; -//! : ^^^ -//! 3 | var oct2 = 0o34318592; -//! 4 | -//! 5 | var obj1 = { -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // error -//! 2 | var oct1 = 0O13334823; -//! 3 | var oct2 = 0o34318592; -//! : ^^^^ -//! 4 | -//! 5 | var obj1 = { -//! 6 | 0O45436: "hi", -//! `---- diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters4.1.normal.js b/crates/swc/tests/tsc-references/optionalBindingParameters4.1.normal.js new file mode 100644 index 00000000000..8a24f301c1b --- /dev/null +++ b/crates/swc/tests/tsc-references/optionalBindingParameters4.1.normal.js @@ -0,0 +1,7 @@ +//// [/a.js] +/** +* @param {{ cause?: string }} [options] +*/ function foo() { + var cause = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).cause; + return cause; +} diff --git a/crates/swc/tests/tsc-references/optionalBindingParameters4.2.minified.js b/crates/swc/tests/tsc-references/optionalBindingParameters4.2.minified.js new file mode 100644 index 00000000000..592ffcb475c --- /dev/null +++ b/crates/swc/tests/tsc-references/optionalBindingParameters4.2.minified.js @@ -0,0 +1 @@ +//// [/a.js] diff --git a/crates/swc/tests/tsc-references/overloadTag1.1.normal.js b/crates/swc/tests/tsc-references/overloadTag1.1.normal.js new file mode 100644 index 00000000000..aac5c573886 --- /dev/null +++ b/crates/swc/tests/tsc-references/overloadTag1.1.normal.js @@ -0,0 +1,41 @@ +//// [overloadTag1.js] +/** + * @overload + * @param {number} a + * @param {number} b + * @returns {number} + * + * @overload + * @param {string} a + * @param {boolean} b + * @returns {string} + * + * @param {string | number} a + * @param {string | number} b + * @returns {string | number} + */ export function overloaded(a, b) { + if (typeof a === "string" && typeof b === "string") { + return a + b; + } else if (typeof a === "number" && typeof b === "number") { + return a + b; + } + throw new Error("Invalid arguments"); +} +var o1 = overloaded(1, 2); +var o2 = overloaded("zero", "one"); +var o3 = overloaded("a", false); +/** + * @overload + * @param {number} a + * @param {number} b + * @returns {number} + * + * @overload + * @param {string} a + * @param {boolean} b + * @returns {string} + */ export function uncheckedInternally(a, b) { + return a + b; +} +uncheckedInternally(1, 2); +uncheckedInternally("zero", "one"); diff --git a/crates/swc/tests/tsc-references/overloadTag1.2.minified.js b/crates/swc/tests/tsc-references/overloadTag1.2.minified.js new file mode 100644 index 00000000000..f9ab1612292 --- /dev/null +++ b/crates/swc/tests/tsc-references/overloadTag1.2.minified.js @@ -0,0 +1,10 @@ +//// [overloadTag1.js] +export function overloaded(a, b) { + if ("string" == typeof a && "string" == typeof b || "number" == typeof a && "number" == typeof b) return a + b; + throw Error("Invalid arguments"); +} +overloaded(1, 2), overloaded("zero", "one"), overloaded("a", !1); +export function uncheckedInternally(a, b) { + return a + b; +} +uncheckedInternally(1, 2), uncheckedInternally("zero", "one"); diff --git a/crates/swc/tests/tsc-references/overloadTag2.1.normal.js b/crates/swc/tests/tsc-references/overloadTag2.1.normal.js new file mode 100644 index 00000000000..498629191d2 --- /dev/null +++ b/crates/swc/tests/tsc-references/overloadTag2.1.normal.js @@ -0,0 +1,30 @@ +//// [overloadTag2.js] +export class Foo { + #a = true ? 1 : "1"; + #b; + /** + * Should not have an implicit any error, because constructor's return type is always implicit + * @constructor + * @overload + * @param {string} a + * @param {number} b + */ /** + * @constructor + * @overload + * @param {number} a + */ /** + * @constructor + * @overload + * @param {string} a + */ /** + * @constructor + * @param {number | string} a + */ constructor(a, b){ + this.#a = a; + this.#b = b; + } +} +var a = new Foo(); +var b = new Foo('str'); +var c = new Foo(2); +var d = new Foo('str', 2); diff --git a/crates/swc/tests/tsc-references/overloadTag2.2.minified.js b/crates/swc/tests/tsc-references/overloadTag2.2.minified.js new file mode 100644 index 00000000000..2d77f24c998 --- /dev/null +++ b/crates/swc/tests/tsc-references/overloadTag2.2.minified.js @@ -0,0 +1,9 @@ +//// [overloadTag2.js] +export class Foo { + #a = 1; + #b; + constructor(a, b){ + this.#a = a, this.#b = b; + } +} +new Foo(), new Foo('str'), new Foo(2), new Foo('str', 2); diff --git a/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.1.normal.js b/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.1.normal.js new file mode 100644 index 00000000000..00d91482306 --- /dev/null +++ b/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.1.normal.js @@ -0,0 +1 @@ +//// [packageJsonImportsExportsOptionCompat.ts] diff --git a/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.2.minified.js b/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.2.minified.js new file mode 100644 index 00000000000..00d91482306 --- /dev/null +++ b/crates/swc/tests/tsc-references/packageJsonImportsExportsOptionCompat.2.minified.js @@ -0,0 +1 @@ +//// [packageJsonImportsExportsOptionCompat.ts] diff --git a/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.1.normal.js b/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.1.normal.js deleted file mode 100644 index 8d5c06a43b0..00000000000 --- a/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.1.normal.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [parseClassDeclarationInStrictModeByDefaultInES6.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | class C { -//! 2 | interface = 10; -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! : ^^^^^^^^^ -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! 7 | } -//! `---- -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[2:1] -//! 2 | interface = 10; -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! : ^^^^ -//! 6 | arguments = "hello"; -//! 7 | } -//! 8 | } -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[3:1] -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! : ^^^^^^^^^ -//! 7 | } -//! 8 | } -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[3:1] -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! : ^^^^^^^^^ -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.2.minified.js b/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.2.minified.js deleted file mode 100644 index 8d5c06a43b0..00000000000 --- a/crates/swc/tests/tsc-references/parseClassDeclarationInStrictModeByDefaultInES6.2.minified.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [parseClassDeclarationInStrictModeByDefaultInES6.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | class C { -//! 2 | interface = 10; -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! : ^^^^^^^^^ -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! 7 | } -//! `---- -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[2:1] -//! 2 | interface = 10; -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! : ^^^^ -//! 6 | arguments = "hello"; -//! 7 | } -//! 8 | } -//! `---- -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[3:1] -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! : ^^^^^^^^^ -//! 7 | } -//! 8 | } -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[3:1] -//! 3 | public implements() { } -//! 4 | public foo(arguments: any) { } -//! 5 | private bar(eval:any) { -//! 6 | arguments = "hello"; -//! : ^^^^^^^^^ -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.1.normal.js b/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.1.normal.js deleted file mode 100644 index fbe9cf05ad0..00000000000 --- a/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parseIncompleteBinaryExpression1.ts] -//! -//! x Expression expected -//! ,---- -//! 1 | var v = || b; -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.2.minified.js b/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.2.minified.js deleted file mode 100644 index fbe9cf05ad0..00000000000 --- a/crates/swc/tests/tsc-references/parseIncompleteBinaryExpression1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parseIncompleteBinaryExpression1.ts] -//! -//! x Expression expected -//! ,---- -//! 1 | var v = || b; -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parseThrowsTag.1.normal.js b/crates/swc/tests/tsc-references/parseThrowsTag.1.normal.js new file mode 100644 index 00000000000..e4f3808fdd2 --- /dev/null +++ b/crates/swc/tests/tsc-references/parseThrowsTag.1.normal.js @@ -0,0 +1,2 @@ +//// [parseThrowsTag.ts] +/** @throws {Error} comment */ function f() {} diff --git a/crates/swc/tests/tsc-references/parseThrowsTag.2.minified.js b/crates/swc/tests/tsc-references/parseThrowsTag.2.minified.js new file mode 100644 index 00000000000..bc03fbf5042 --- /dev/null +++ b/crates/swc/tests/tsc-references/parseThrowsTag.2.minified.js @@ -0,0 +1 @@ +//// [parseThrowsTag.ts] diff --git a/crates/swc/tests/tsc-references/parser10.1.1-8gs.1.normal.js b/crates/swc/tests/tsc-references/parser10.1.1-8gs.1.normal.js deleted file mode 100644 index 659f470dac2..00000000000 --- a/crates/swc/tests/tsc-references/parser10.1.1-8gs.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser10.1.1-8gs.ts] -//! -//! x `public` cannot be used as an identifier in strict mode -//! ,-[15:1] -//! 15 | "use strict"; -//! 16 | "use strict"; -//! 17 | throw NotEarlyError; -//! 18 | var public = 1; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser10.1.1-8gs.2.minified.js b/crates/swc/tests/tsc-references/parser10.1.1-8gs.2.minified.js deleted file mode 100644 index 659f470dac2..00000000000 --- a/crates/swc/tests/tsc-references/parser10.1.1-8gs.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser10.1.1-8gs.ts] -//! -//! x `public` cannot be used as an identifier in strict mode -//! ,-[15:1] -//! 15 | "use strict"; -//! 16 | "use strict"; -//! 17 | throw NotEarlyError; -//! 18 | var public = 1; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser509618.1.normal.js b/crates/swc/tests/tsc-references/parser509618.1.normal.js deleted file mode 100644 index ae46946280d..00000000000 --- a/crates/swc/tests/tsc-references/parser509618.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parser509618.ts] diff --git a/crates/swc/tests/tsc-references/parser509618.2.minified.js b/crates/swc/tests/tsc-references/parser509618.2.minified.js deleted file mode 100644 index ae46946280d..00000000000 --- a/crates/swc/tests/tsc-references/parser509618.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parser509618.ts] diff --git a/crates/swc/tests/tsc-references/parser512084.1.normal.js b/crates/swc/tests/tsc-references/parser512084.1.normal.js deleted file mode 100644 index d9989eb526b..00000000000 --- a/crates/swc/tests/tsc-references/parser512084.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser512084.ts] -//! -//! x Expected '}', got '' -//! ,---- -//! 1 | class foo { -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser512084.2.minified.js b/crates/swc/tests/tsc-references/parser512084.2.minified.js deleted file mode 100644 index d9989eb526b..00000000000 --- a/crates/swc/tests/tsc-references/parser512084.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser512084.ts] -//! -//! x Expected '}', got '' -//! ,---- -//! 1 | class foo { -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser512325.1.normal.js b/crates/swc/tests/tsc-references/parser512325.1.normal.js deleted file mode 100644 index 00fddc86b1e..00000000000 --- a/crates/swc/tests/tsc-references/parser512325.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser512325.ts] -//! -//! x Not a pattern -//! ,---- -//! 1 | var tt = (a, (b, c)) => a+b+c; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser512325.2.minified.js b/crates/swc/tests/tsc-references/parser512325.2.minified.js deleted file mode 100644 index 00fddc86b1e..00000000000 --- a/crates/swc/tests/tsc-references/parser512325.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser512325.ts] -//! -//! x Not a pattern -//! ,---- -//! 1 | var tt = (a, (b, c)) => a+b+c; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser553699.1.normal.js b/crates/swc/tests/tsc-references/parser553699.1.normal.js deleted file mode 100644 index bc370beac3a..00000000000 --- a/crates/swc/tests/tsc-references/parser553699.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parser553699.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var Foo = /*#__PURE__*/ function() { - "use strict"; - function Foo() { - _class_call_check(this, Foo); - } - var _proto = Foo.prototype; - _proto.banana = function banana(x) {}; - return Foo; -}(); -var Bar = function Bar(c) { - "use strict"; - _class_call_check(this, Bar); -}; diff --git a/crates/swc/tests/tsc-references/parser642331.1.normal.js b/crates/swc/tests/tsc-references/parser642331.1.normal.js deleted file mode 100644 index 111f18aff79..00000000000 --- a/crates/swc/tests/tsc-references/parser642331.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser642331.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | class test { -//! 2 | constructor (static) { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser642331.2.minified.js b/crates/swc/tests/tsc-references/parser642331.2.minified.js deleted file mode 100644 index 111f18aff79..00000000000 --- a/crates/swc/tests/tsc-references/parser642331.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser642331.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | class test { -//! 2 | constructor (static) { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser642331_1.1.normal.js b/crates/swc/tests/tsc-references/parser642331_1.1.normal.js deleted file mode 100644 index 67cd799b54f..00000000000 --- a/crates/swc/tests/tsc-references/parser642331_1.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser642331_1.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | -//! 3 | class test { -//! 4 | constructor (static) { } -//! : ^^^^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser642331_1.2.minified.js b/crates/swc/tests/tsc-references/parser642331_1.2.minified.js deleted file mode 100644 index 67cd799b54f..00000000000 --- a/crates/swc/tests/tsc-references/parser642331_1.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser642331_1.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | -//! 3 | class test { -//! 4 | constructor (static) { } -//! : ^^^^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser645086_1.1.normal.js b/crates/swc/tests/tsc-references/parser645086_1.1.normal.js deleted file mode 100644 index 6b7d4fe760c..00000000000 --- a/crates/swc/tests/tsc-references/parser645086_1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser645086_1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = /[]/]/ -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser645086_1.2.minified.js b/crates/swc/tests/tsc-references/parser645086_1.2.minified.js deleted file mode 100644 index 6b7d4fe760c..00000000000 --- a/crates/swc/tests/tsc-references/parser645086_1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser645086_1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = /[]/]/ -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser645086_2.1.normal.js b/crates/swc/tests/tsc-references/parser645086_2.1.normal.js deleted file mode 100644 index 130640e88a2..00000000000 --- a/crates/swc/tests/tsc-references/parser645086_2.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser645086_2.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = /[^]/]/ -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser645086_2.2.minified.js b/crates/swc/tests/tsc-references/parser645086_2.2.minified.js deleted file mode 100644 index 130640e88a2..00000000000 --- a/crates/swc/tests/tsc-references/parser645086_2.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser645086_2.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = /[^]/]/ -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.1.normal.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.1.normal.js deleted file mode 100644 index f4fd0201cef..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessibilityAfterStatic6.ts] -//! -//! x Expected '}', got '' -//! ,-[1:1] -//! 1 | class Outer -//! 2 | { -//! 3 | static public -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.2.minified.js b/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.2.minified.js deleted file mode 100644 index f4fd0201cef..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessibilityAfterStatic6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessibilityAfterStatic6.ts] -//! -//! x Expected '}', got '' -//! ,-[1:1] -//! 1 | class Outer -//! 2 | { -//! 3 | static public -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors10.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors10.1.normal.js deleted file mode 100644 index 1045fdbcf4a..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors10.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors10.ts] -//! -//! x `async` modifier cannot be used here -//! ,-[1:1] -//! 1 | var v = { -//! 2 | public get foo() { } -//! : ^^^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors10.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors10.2.minified.js deleted file mode 100644 index 1045fdbcf4a..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors10.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors10.ts] -//! -//! x `async` modifier cannot be used here -//! ,-[1:1] -//! 1 | var v = { -//! 2 | public get foo() { } -//! : ^^^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors5.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors5.1.normal.js deleted file mode 100644 index 6e2a5fac5af..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors5.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors5.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class C { -//! 2 | get foo() { return 0; } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors5.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors5.2.minified.js deleted file mode 100644 index 6e2a5fac5af..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors5.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors5.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class C { -//! 2 | get foo() { return 0; } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors6.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors6.1.normal.js deleted file mode 100644 index 701175d1f4c..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors6.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class C { -//! 2 | set foo(v) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors6.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors6.2.minified.js deleted file mode 100644 index 701175d1f4c..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserAccessors6.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class C { -//! 2 | set foo(v) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors7.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors7.1.normal.js deleted file mode 100644 index 64da8656b88..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors7.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors7.ts] -//! -//! x A `get` accessor cannot have parameters -//! ,---- -//! 1 | var v = { get foo(v: number) { } }; -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors7.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors7.2.minified.js deleted file mode 100644 index 64da8656b88..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors7.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors7.ts] -//! -//! x A `get` accessor cannot have parameters -//! ,---- -//! 1 | var v = { get foo(v: number) { } }; -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors8.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors8.1.normal.js deleted file mode 100644 index 9f30d1e069c..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors8.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors8.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,---- -//! 1 | var v = { set foo() { } } -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors8.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors8.2.minified.js deleted file mode 100644 index 9f30d1e069c..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors8.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors8.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,---- -//! 1 | var v = { set foo() { } } -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors9.1.normal.js b/crates/swc/tests/tsc-references/parserAccessors9.1.normal.js deleted file mode 100644 index ab1a2beebfa..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors9.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors9.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,---- -//! 1 | var v = { set foo(a, b) { } } -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserAccessors9.2.minified.js b/crates/swc/tests/tsc-references/parserAccessors9.2.minified.js deleted file mode 100644 index ab1a2beebfa..00000000000 --- a/crates/swc/tests/tsc-references/parserAccessors9.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserAccessors9.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,---- -//! 1 | var v = { set foo(a, b) { } } -//! : ^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).1.normal.js new file mode 100644 index 00000000000..9120f0eeaa5 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).1.normal.js @@ -0,0 +1,7 @@ +//// [parserArrowFunctionExpression10.ts] +//// [fileJs.js] +a ? (b)=>d : (e)=>f // Not legal JS; "Unexpected token ':'" at last colon + // Not legal JS; "Unexpected token ':'" at last colon +; +//// [fileTs.ts] +a ? (b)=>d : (e)=>f; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).2.minified.js new file mode 100644 index 00000000000..55a0a8c14a7 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es2015).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression10.ts] +//// [fileJs.js] +a || ((e)=>f); +//// [fileTs.ts] +a || ((e)=>f); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).1.normal.js new file mode 100644 index 00000000000..77c79388a88 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).1.normal.js @@ -0,0 +1,15 @@ +//// [parserArrowFunctionExpression10.ts] +//// [fileJs.js] +a ? function(b) { + return d; +} : function(e) { + return f // Not legal JS; "Unexpected token ':'" at last colon + // Not legal JS; "Unexpected token ':'" at last colon + ; +}; +//// [fileTs.ts] +a ? function(b) { + return d; +} : function(e) { + return f; +}; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).2.minified.js new file mode 100644 index 00000000000..31082399305 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression10(target=es3).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression10.ts] +//// [fileJs.js] +a; +//// [fileTs.ts] +a; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).1.normal.js new file mode 100644 index 00000000000..630a2b0eaf2 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).1.normal.js @@ -0,0 +1,16 @@ +//// [parserArrowFunctionExpression11.ts] +//// [fileJs.js] +//! +//! x Expected ':', got '' +//! ,-[1:1] +//! 1 | a ? b ? c : (d) : e => f // Legal JS +//! : ^ +//! 2 | +//! `---- +//// [fileTs.ts] +//! +//! x Expected ':', got '' +//! ,---- +//! 1 | a ? b ? c : (d) : e => f +//! : ^ +//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).2.minified.js new file mode 100644 index 00000000000..630a2b0eaf2 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es2015).2.minified.js @@ -0,0 +1,16 @@ +//// [parserArrowFunctionExpression11.ts] +//// [fileJs.js] +//! +//! x Expected ':', got '' +//! ,-[1:1] +//! 1 | a ? b ? c : (d) : e => f // Legal JS +//! : ^ +//! 2 | +//! `---- +//// [fileTs.ts] +//! +//! x Expected ':', got '' +//! ,---- +//! 1 | a ? b ? c : (d) : e => f +//! : ^ +//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).1.normal.js new file mode 100644 index 00000000000..630a2b0eaf2 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).1.normal.js @@ -0,0 +1,16 @@ +//// [parserArrowFunctionExpression11.ts] +//// [fileJs.js] +//! +//! x Expected ':', got '' +//! ,-[1:1] +//! 1 | a ? b ? c : (d) : e => f // Legal JS +//! : ^ +//! 2 | +//! `---- +//// [fileTs.ts] +//! +//! x Expected ':', got '' +//! ,---- +//! 1 | a ? b ? c : (d) : e => f +//! : ^ +//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).2.minified.js new file mode 100644 index 00000000000..630a2b0eaf2 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression11(target=es3).2.minified.js @@ -0,0 +1,16 @@ +//// [parserArrowFunctionExpression11.ts] +//// [fileJs.js] +//! +//! x Expected ':', got '' +//! ,-[1:1] +//! 1 | a ? b ? c : (d) : e => f // Legal JS +//! : ^ +//! 2 | +//! `---- +//// [fileTs.ts] +//! +//! x Expected ':', got '' +//! ,---- +//! 1 | a ? b ? c : (d) : e => f +//! : ^ +//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).1.normal.js new file mode 100644 index 00000000000..3e44c07136a --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).1.normal.js @@ -0,0 +1,7 @@ +//// [parserArrowFunctionExpression12.ts] +//// [fileJs.js] +a ? (b)=>c : (d)=>e // Legal JS + // Legal JS +; +//// [fileTs.ts] +a ? (b)=>c : (d)=>e; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).2.minified.js new file mode 100644 index 00000000000..3db81a70b45 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es2015).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression12.ts] +//// [fileJs.js] +a || ((d)=>e); +//// [fileTs.ts] +a || ((d)=>e); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).1.normal.js new file mode 100644 index 00000000000..74ae2b9c1b8 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).1.normal.js @@ -0,0 +1,15 @@ +//// [parserArrowFunctionExpression12.ts] +//// [fileJs.js] +a ? function(b) { + return c; +} : function(d) { + return e // Legal JS + // Legal JS + ; +}; +//// [fileTs.ts] +a ? function(b) { + return c; +} : function(d) { + return e; +}; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).2.minified.js new file mode 100644 index 00000000000..624739b58f5 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression12(target=es3).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression12.ts] +//// [fileJs.js] +a; +//// [fileTs.ts] +a; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.1.normal.js deleted file mode 100644 index 3948947f3fb..00000000000 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserArrowFunctionExpression2.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = () => { } || a -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.2.minified.js deleted file mode 100644 index 3948947f3fb..00000000000 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression2.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserArrowFunctionExpression2.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = () => { } || a -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.1.normal.js deleted file mode 100644 index ba01924fc19..00000000000 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserArrowFunctionExpression3.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = (() => { } || a) -//! : ^^ -//! `---- -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = (() => { } || a) -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.2.minified.js deleted file mode 100644 index ba01924fc19..00000000000 --- a/crates/swc/tests/tsc-references/parserArrowFunctionExpression3.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserArrowFunctionExpression3.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = (() => { } || a) -//! : ^^ -//! `---- -//! -//! x Expected a semicolon -//! ,---- -//! 1 | a = (() => { } || a) -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).1.normal.js new file mode 100644 index 00000000000..1830b5928d3 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).1.normal.js @@ -0,0 +1,15 @@ +//// [parserArrowFunctionExpression8.ts] +//// [fileJs.js] +x ? (y)=>({ + y + }) : (z)=>({ + z + } // Legal JS + // Legal JS + ); +//// [fileTs.ts] +x ? (y)=>({ + y + }) : (z)=>({ + z + }); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).2.minified.js new file mode 100644 index 00000000000..cf6b319eaf1 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es2015).2.minified.js @@ -0,0 +1,9 @@ +//// [parserArrowFunctionExpression8.ts] +//// [fileJs.js] +x || ((z)=>({ + z + })); +//// [fileTs.ts] +x || ((z)=>({ + z + })); diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).1.normal.js new file mode 100644 index 00000000000..af45f0eb4b1 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).1.normal.js @@ -0,0 +1,23 @@ +//// [parserArrowFunctionExpression8.ts] +//// [fileJs.js] +x ? function(y) { + return { + y: y + }; +} : function(z) { + return { + z: z + } // Legal JS + // Legal JS + ; +}; +//// [fileTs.ts] +x ? function(y) { + return { + y: y + }; +} : function(z) { + return { + z: z + }; +}; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).2.minified.js new file mode 100644 index 00000000000..667f56c5496 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression8(target=es3).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression8.ts] +//// [fileJs.js] +x; +//// [fileTs.ts] +x; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).1.normal.js new file mode 100644 index 00000000000..922e889b145 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).1.normal.js @@ -0,0 +1,7 @@ +//// [parserArrowFunctionExpression9.ts] +//// [fileJs.js] +b ? c : (d)=>e // Legal JS + // Legal JS +; +//// [fileTs.ts] +b ? c : (d)=>e; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).2.minified.js new file mode 100644 index 00000000000..93bd42f0712 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es2015).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression9.ts] +//// [fileJs.js] +b && c; +//// [fileTs.ts] +b && c; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).1.normal.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).1.normal.js new file mode 100644 index 00000000000..f7d8aa20a4c --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).1.normal.js @@ -0,0 +1,11 @@ +//// [parserArrowFunctionExpression9.ts] +//// [fileJs.js] +b ? c : function(d) { + return e // Legal JS + // Legal JS + ; +}; +//// [fileTs.ts] +b ? c : function(d) { + return e; +}; diff --git a/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).2.minified.js b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).2.minified.js new file mode 100644 index 00000000000..93bd42f0712 --- /dev/null +++ b/crates/swc/tests/tsc-references/parserArrowFunctionExpression9(target=es3).2.minified.js @@ -0,0 +1,5 @@ +//// [parserArrowFunctionExpression9.ts] +//// [fileJs.js] +b && c; +//// [fileTs.ts] +b && c; diff --git a/crates/swc/tests/tsc-references/parserBlockStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserBlockStatement1.d.1.normal.js deleted file mode 100644 index 70de68ca5cb..00000000000 --- a/crates/swc/tests/tsc-references/parserBlockStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserBlockStatement1.d.ts] -{} diff --git a/crates/swc/tests/tsc-references/parserBlockStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserBlockStatement1.d.2.minified.js deleted file mode 100644 index 02124b8e212..00000000000 --- a/crates/swc/tests/tsc-references/parserBlockStatement1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserBlockStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserBreakStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserBreakStatement1.d.1.normal.js deleted file mode 100644 index 1a0f613ec48..00000000000 --- a/crates/swc/tests/tsc-references/parserBreakStatement1.d.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserBreakStatement1.d.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,---- -//! 1 | break; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserBreakStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserBreakStatement1.d.2.minified.js deleted file mode 100644 index 1a0f613ec48..00000000000 --- a/crates/swc/tests/tsc-references/parserBreakStatement1.d.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserBreakStatement1.d.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,---- -//! 1 | break; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.1.normal.js b/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.1.normal.js deleted file mode 100644 index 190370aa512..00000000000 --- a/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserCatchClauseWithTypeAnnotation1.ts] -try {} catch (e) {} diff --git a/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.2.minified.js b/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.2.minified.js deleted file mode 100644 index 56be78f5326..00000000000 --- a/crates/swc/tests/tsc-references/parserCatchClauseWithTypeAnnotation1.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserCatchClauseWithTypeAnnotation1.ts] diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration1.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration1.1.normal.js deleted file mode 100644 index 7f2838f3dd9..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration1.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration1.ts] -//! -//! x `extends` clause already seen. -//! ,-[1:1] -//! 1 | class C extends A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration1.2.minified.js deleted file mode 100644 index 7f2838f3dd9..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration1.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration1.ts] -//! -//! x `extends` clause already seen. -//! ,-[1:1] -//! 1 | class C extends A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration18.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration18.1.normal.js deleted file mode 100644 index 1e020c73bbf..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration18.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserClassDeclaration18.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class FooBase { -//! 2 | constructor(s: string); -//! 3 | constructor(n: number); -//! 4 | constructor(x: any) { -//! : ^ -//! 5 | } -//! 6 | bar1():void; -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration18.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration18.2.minified.js deleted file mode 100644 index 1e020c73bbf..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration18.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserClassDeclaration18.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare class FooBase { -//! 2 | constructor(s: string); -//! 3 | constructor(n: number); -//! 4 | constructor(x: any) { -//! : ^ -//! 5 | } -//! 6 | bar1():void; -//! 7 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration2.1.normal.js deleted file mode 100644 index 0822a33f370..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration2.ts] -//! -//! x `implements` clause already seen -//! ,-[1:1] -//! 1 | class C implements A implements B { -//! : ^^^^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration2.2.minified.js deleted file mode 100644 index 0822a33f370..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration2.ts] -//! -//! x `implements` clause already seen -//! ,-[1:1] -//! 1 | class C implements A implements B { -//! : ^^^^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration3.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration3.1.normal.js deleted file mode 100644 index aab7f9b1105..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration3.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration3.ts] -//! -//! x 'extends' clause must precede 'implements' clause. -//! ,-[1:1] -//! 1 | class C implements A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration3.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration3.2.minified.js deleted file mode 100644 index aab7f9b1105..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration3.ts] -//! -//! x 'extends' clause must precede 'implements' clause. -//! ,-[1:1] -//! 1 | class C implements A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration4.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration4.1.normal.js deleted file mode 100644 index 13956b6a0a4..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration4.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration4.ts] -//! -//! x 'extends' clause must precede 'implements' clause. -//! ,-[1:1] -//! 1 | class C extends A implements B extends C { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration4.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration4.2.minified.js deleted file mode 100644 index 13956b6a0a4..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration4.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration4.ts] -//! -//! x 'extends' clause must precede 'implements' clause. -//! ,-[1:1] -//! 1 | class C extends A implements B extends C { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration5.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration5.1.normal.js deleted file mode 100644 index f11934eeea3..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration5.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration5.ts] -//! -//! x `implements` clause already seen -//! ,-[1:1] -//! 1 | class C extends A implements B implements C { -//! : ^^^^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration5.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration5.2.minified.js deleted file mode 100644 index f11934eeea3..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration5.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration5.ts] -//! -//! x `implements` clause already seen -//! ,-[1:1] -//! 1 | class C extends A implements B implements C { -//! : ^^^^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration6.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration6.1.normal.js deleted file mode 100644 index 97551644df8..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration6.ts] -//! -//! x Classes can only extend a single class -//! ,-[1:1] -//! 1 | class C extends A, B { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration6.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration6.2.minified.js deleted file mode 100644 index 97551644df8..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserClassDeclaration6.ts] -//! -//! x Classes can only extend a single class -//! ,-[1:1] -//! 1 | class C extends A, B { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration7.1.normal.js b/crates/swc/tests/tsc-references/parserClassDeclaration7.1.normal.js deleted file mode 100644 index 4b79ecc60a4..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration7.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserClassDeclaration7.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare class C { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserClassDeclaration7.2.minified.js b/crates/swc/tests/tsc-references/parserClassDeclaration7.2.minified.js deleted file mode 100644 index 4b79ecc60a4..00000000000 --- a/crates/swc/tests/tsc-references/parserClassDeclaration7.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserClassDeclaration7.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare class C { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName1.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName1.1.normal.js deleted file mode 100644 index 4d62e8664a6..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { [e] }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName1.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName1.2.minified.js deleted file mode 100644 index 4d62e8664a6..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { [e] }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName10.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName10.1.normal.js deleted file mode 100644 index f0a965a94de..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName10.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName10.ts] -let _e = e; -class C { - constructor(){ - this[_e] = 1; - } -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName10.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName10.2.minified.js deleted file mode 100644 index f44e50f61f3..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName10.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName10.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName11.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName11.1.normal.js deleted file mode 100644 index e72d0620ca7..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName11.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserComputedPropertyName11.ts] -class C { -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName11.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName11.2.minified.js deleted file mode 100644 index 49e568a6102..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName11.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName11.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName13.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName13.1.normal.js deleted file mode 100644 index 187ca060de4..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName13.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName13.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName13.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName13.2.minified.js deleted file mode 100644 index 0fa6533ec44..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName13.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName13.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName14.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName14.1.normal.js deleted file mode 100644 index ff7eb6ce64d..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName14.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName14.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName14.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName14.2.minified.js deleted file mode 100644 index 5de3909502d..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName14.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName14.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName15.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName15.1.normal.js deleted file mode 100644 index 3eb0f02488c..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName15.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName15.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName15.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName15.2.minified.js deleted file mode 100644 index 571e6f85084..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName15.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName15.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName16.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName16.1.normal.js deleted file mode 100644 index 92026267fbd..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName16.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserComputedPropertyName16.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | [e] = 1 -//! : ^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName16.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName16.2.minified.js deleted file mode 100644 index 92026267fbd..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName16.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserComputedPropertyName16.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | [e] = 1 -//! : ^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName18.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName18.1.normal.js deleted file mode 100644 index 6b87e2a46d6..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName18.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName18.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName18.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName18.2.minified.js deleted file mode 100644 index 151dea1d346..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName18.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName18.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName19.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName19.1.normal.js deleted file mode 100644 index dfd8799ceb5..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName19.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName19.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName19.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName19.2.minified.js deleted file mode 100644 index dd8b8321ce0..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName19.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName19.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName20.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName20.1.normal.js deleted file mode 100644 index 1ba8ff3a8cf..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName20.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName20.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName20.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName20.2.minified.js deleted file mode 100644 index 1ba8ff3a8cf..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName20.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName20.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName21.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName21.1.normal.js deleted file mode 100644 index b0cb515823d..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName21.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName21.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName21.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName21.2.minified.js deleted file mode 100644 index b0cb515823d..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName21.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName21.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName22.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName22.1.normal.js deleted file mode 100644 index 606d01f405e..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName22.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName22.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName22.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName22.2.minified.js deleted file mode 100644 index 606d01f405e..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName22.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName22.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName25.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName25.1.normal.js deleted file mode 100644 index 5c7bc3d7d8a..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName25.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserComputedPropertyName25.ts] -let _e = e; -class C { - constructor(){ - // No ASI - this[_e] = 0[e2] = 1; - } -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName25.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName25.2.minified.js deleted file mode 100644 index 663584b3c0e..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName25.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName25.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName26.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName26.1.normal.js deleted file mode 100644 index a5a94a945dd..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName26.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserComputedPropertyName26.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // No ASI -//! 3 | [e] = 0 -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName26.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName26.2.minified.js deleted file mode 100644 index a5a94a945dd..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName26.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserComputedPropertyName26.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // No ASI -//! 3 | [e] = 0 -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName28.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName28.1.normal.js deleted file mode 100644 index 4d7c6bb30f4..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName28.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName28.ts] -let _e = e; -class C { - constructor(){ - this[_e] = 0; - } -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName28.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName28.2.minified.js deleted file mode 100644 index b4bb5755507..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName28.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName28.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName29.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName29.1.normal.js deleted file mode 100644 index d4053aa6615..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName29.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserComputedPropertyName29.ts] -let _e = e; -class C { - constructor(){ - // yes ASI - this[_e] = id++; - } -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName29.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName29.2.minified.js deleted file mode 100644 index d7fd4ceffdf..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName29.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserComputedPropertyName29.ts] -e; diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName30.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName30.1.normal.js deleted file mode 100644 index e1d03e7966e..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName30.1.normal.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [parserComputedPropertyName30.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- -//! -//! x Expected ',', got '[' -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! 4 | [e2] = 1 -//! : ^ -//! 5 | } -//! `---- -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! 4 | [e2] = 1 -//! : ^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName30.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName30.2.minified.js deleted file mode 100644 index e1d03e7966e..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName30.2.minified.js +++ /dev/null @@ -1,31 +0,0 @@ -//// [parserComputedPropertyName30.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- -//! -//! x Expected ',', got '[' -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! 4 | [e2] = 1 -//! : ^ -//! 5 | } -//! `---- -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++ -//! 4 | [e2] = 1 -//! : ^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName31.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName31.1.normal.js deleted file mode 100644 index 9ba0a6ba00a..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName31.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserComputedPropertyName31.ts] -class C { -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName31.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName31.2.minified.js deleted file mode 100644 index 6c449dc8b11..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName31.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName31.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName32.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName32.1.normal.js deleted file mode 100644 index 2637850f6ce..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName32.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName32.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName32.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName32.2.minified.js deleted file mode 100644 index 2637850f6ce..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName32.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName32.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName34.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName34.1.normal.js deleted file mode 100644 index 4065c0a8b32..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName34.1.normal.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [parserComputedPropertyName34.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++, -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++, -//! 4 | [e2] = 1 -//! : ^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName34.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName34.2.minified.js deleted file mode 100644 index 4065c0a8b32..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName34.2.minified.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [parserComputedPropertyName34.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++, -//! : ^^ -//! 4 | [e2] = 1 -//! 5 | } -//! `---- -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | // no ASI, comma expected -//! 3 | [e] = id++, -//! 4 | [e2] = 1 -//! : ^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName35.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName35.1.normal.js deleted file mode 100644 index 5d23b05e502..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName35.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserComputedPropertyName35.ts] -//! -//! x A comma expression is not allowed in a computed property name -//! ,-[1:1] -//! 1 | var x = { -//! 2 | [0, 1]: { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName35.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName35.2.minified.js deleted file mode 100644 index 5d23b05e502..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName35.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserComputedPropertyName35.ts] -//! -//! x A comma expression is not allowed in a computed property name -//! ,-[1:1] -//! 1 | var x = { -//! 2 | [0, 1]: { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName5.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName5.1.normal.js deleted file mode 100644 index 05b40f98370..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName5.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName5.ts] -//! -//! x `async` modifier cannot be used here -//! ,---- -//! 1 | var v = { public get [e]() { } }; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName5.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName5.2.minified.js deleted file mode 100644 index 05b40f98370..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName5.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserComputedPropertyName5.ts] -//! -//! x `async` modifier cannot be used here -//! ,---- -//! 1 | var v = { public get [e]() { } }; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName7.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName7.1.normal.js deleted file mode 100644 index e8100d12720..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName7.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserComputedPropertyName7.ts] -class C { -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName7.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName7.2.minified.js deleted file mode 100644 index 0a7ed0a6487..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName7.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName7.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName8.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName8.1.normal.js deleted file mode 100644 index c1d751ce892..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName8.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserComputedPropertyName8.ts] -class C { -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName8.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName8.2.minified.js deleted file mode 100644 index b1ef2db707b..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName8.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName8.ts] diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName9.1.normal.js b/crates/swc/tests/tsc-references/parserComputedPropertyName9.1.normal.js deleted file mode 100644 index ba56c08ba9d..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName9.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserComputedPropertyName9.ts] -class C { -} diff --git a/crates/swc/tests/tsc-references/parserComputedPropertyName9.2.minified.js b/crates/swc/tests/tsc-references/parserComputedPropertyName9.2.minified.js deleted file mode 100644 index 40b2123f6e6..00000000000 --- a/crates/swc/tests/tsc-references/parserComputedPropertyName9.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserComputedPropertyName9.ts] diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration10.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration10.1.normal.js deleted file mode 100644 index 6f9b23731a0..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration10.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration10.ts] -//! -//! x Type annotation cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor(): number { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration10.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration10.2.minified.js deleted file mode 100644 index 6f9b23731a0..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration10.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration10.ts] -//! -//! x Type annotation cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor(): number { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration11.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration11.1.normal.js deleted file mode 100644 index 7965ce1ce41..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration11.1.normal.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserConstructorDeclaration11.ts] -//! -//! x Type parameter list cannot be empty -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor<>() { } -//! : ^^ -//! 3 | } -//! `---- -//! -//! x Type parameters cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor<>() { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration11.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration11.2.minified.js deleted file mode 100644 index 7965ce1ce41..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration11.2.minified.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserConstructorDeclaration11.ts] -//! -//! x Type parameter list cannot be empty -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor<>() { } -//! : ^^ -//! 3 | } -//! `---- -//! -//! x Type parameters cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor<>() { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration2.1.normal.js deleted file mode 100644 index 0607694d9ba..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration2.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration2.ts] -//! -//! x 'static' modifier cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | static constructor() { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration2.2.minified.js deleted file mode 100644 index 0607694d9ba..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration2.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration2.ts] -//! -//! x 'static' modifier cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | static constructor() { } -//! : ^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration4.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration4.1.normal.js deleted file mode 100644 index 69ae9bdd5ff..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration4.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration4.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[1:1] -//! 1 | class C { -//! 2 | declare constructor() { } -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration4.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration4.2.minified.js deleted file mode 100644 index 69ae9bdd5ff..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration4.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration4.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[1:1] -//! 1 | class C { -//! 2 | declare constructor() { } -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration9.1.normal.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration9.1.normal.js deleted file mode 100644 index 5268e441578..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration9.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration9.ts] -//! -//! x Type parameters cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor() { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserConstructorDeclaration9.2.minified.js b/crates/swc/tests/tsc-references/parserConstructorDeclaration9.2.minified.js deleted file mode 100644 index 5268e441578..00000000000 --- a/crates/swc/tests/tsc-references/parserConstructorDeclaration9.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserConstructorDeclaration9.ts] -//! -//! x Type parameters cannot appear on a constructor declaration -//! ,-[1:1] -//! 1 | class C { -//! 2 | constructor() { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserContinueStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserContinueStatement1.d.1.normal.js deleted file mode 100644 index 4673644cbdc..00000000000 --- a/crates/swc/tests/tsc-references/parserContinueStatement1.d.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserContinueStatement1.d.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,---- -//! 1 | continue; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserContinueStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserContinueStatement1.d.2.minified.js deleted file mode 100644 index 4673644cbdc..00000000000 --- a/crates/swc/tests/tsc-references/parserContinueStatement1.d.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserContinueStatement1.d.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,---- -//! 1 | continue; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.1.normal.js deleted file mode 100644 index 1150546c446..00000000000 --- a/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserDebuggerStatement1.d.ts] -debugger; diff --git a/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.2.minified.js deleted file mode 100644 index a5c6b93f982..00000000000 --- a/crates/swc/tests/tsc-references/parserDebuggerStatement1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserDebuggerStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserDoStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserDoStatement1.d.1.normal.js deleted file mode 100644 index 2e7b248e1b8..00000000000 --- a/crates/swc/tests/tsc-references/parserDoStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserDoStatement1.d.ts] -do {}while (e); diff --git a/crates/swc/tests/tsc-references/parserDoStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserDoStatement1.d.2.minified.js deleted file mode 100644 index 5fc11a9e5e1..00000000000 --- a/crates/swc/tests/tsc-references/parserDoStatement1.d.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserDoStatement1.d.ts] -do ; -while (e); diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.1.normal.js deleted file mode 100644 index 5fdf0346034..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5ComputedPropertyName1.ts] diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.2.minified.js deleted file mode 100644 index 5fdf0346034..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName1.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5ComputedPropertyName1.ts] diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.1.normal.js deleted file mode 100644 index e2821552464..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ComputedPropertyName10.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var _e = e; -var C = function C() { - "use strict"; - _class_call_check(this, C); - this[_e] = 1; -}; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.2.minified.js deleted file mode 100644 index 2ab83f97de6..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName10.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserES5ComputedPropertyName10.ts] -import "@swc/helpers/src/_class_call_check.mjs"; -e; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.1.normal.js deleted file mode 100644 index 0889568ace1..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserES5ComputedPropertyName11.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.2.minified.js deleted file mode 100644 index a2f030ade3d..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName11.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserES5ComputedPropertyName11.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.1.normal.js deleted file mode 100644 index 342bdbf4be3..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5ComputedPropertyName5.ts] diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.2.minified.js deleted file mode 100644 index 342bdbf4be3..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName5.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5ComputedPropertyName5.ts] diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.1.normal.js deleted file mode 100644 index c2365743b98..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserES5ComputedPropertyName6.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | [e] = 1 -//! : ^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.2.minified.js deleted file mode 100644 index c2365743b98..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserES5ComputedPropertyName6.ts] -//! -//! x Computed property names are not allowed in enums -//! ,-[1:1] -//! 1 | enum E { -//! 2 | [e] = 1 -//! : ^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.1.normal.js deleted file mode 100644 index b72acf2bc00..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserES5ComputedPropertyName7.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.2.minified.js deleted file mode 100644 index 4d4df7e6ff2..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName7.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserES5ComputedPropertyName7.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.1.normal.js deleted file mode 100644 index 31e3819bf64..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserES5ComputedPropertyName8.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.2.minified.js deleted file mode 100644 index 6724b8e1ac4..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName8.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5ComputedPropertyName8.ts] diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.1.normal.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.1.normal.js deleted file mode 100644 index bf66af5b1ae..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserES5ComputedPropertyName9.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.2.minified.js b/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.2.minified.js deleted file mode 100644 index 6b5121a3412..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ComputedPropertyName9.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserES5ComputedPropertyName9.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.1.normal.js deleted file mode 100644 index 62afe235cd5..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.1.normal.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [parserES5ForOfStatement1.d.ts] -var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; -try { - for(var _iterator = e[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ - var i = _step.value; - } -} catch (err) { - _didIteratorError = true; - _iteratorError = err; -} finally{ - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally{ - if (_didIteratorError) { - throw _iteratorError; - } - } -} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.2.minified.js deleted file mode 100644 index 27517781b71..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement1.d.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserES5ForOfStatement1.d.ts] -var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; -try { - for(var _step, _iterator = e[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)_step.value; -} catch (err) { - _didIteratorError = !0, _iteratorError = err; -} finally{ - try { - _iteratorNormalCompletion || null == _iterator.return || _iterator.return(); - } finally{ - if (_didIteratorError) throw _iteratorError; - } -} diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement2.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement2.1.normal.js deleted file mode 100644 index 1be7a323799..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement2.2.minified.js deleted file mode 100644 index 1be7a323799..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement20.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement20.1.normal.js deleted file mode 100644 index ae5102940cb..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement20.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserES5ForOfStatement20.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,---- -//! 1 | for (var of = 0 in of) { } -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement20.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement20.2.minified.js deleted file mode 100644 index ae5102940cb..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement20.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserES5ForOfStatement20.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,---- -//! 1 | for (var of = 0 in of) { } -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement21.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement21.1.normal.js deleted file mode 100644 index f6a018bd5b5..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement21.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserES5ForOfStatement21.ts] -//! -//! x Variable declaration list cannot be empty -//! ,---- -//! 1 | for (var of of) { } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement21.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement21.2.minified.js deleted file mode 100644 index f6a018bd5b5..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement21.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserES5ForOfStatement21.ts] -//! -//! x Variable declaration list cannot be empty -//! ,---- -//! 1 | for (var of of) { } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement3.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement3.1.normal.js deleted file mode 100644 index 7924c2b3843..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement3.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement3.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement3.2.minified.js deleted file mode 100644 index 7924c2b3843..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement4.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement4.1.normal.js deleted file mode 100644 index e618552d524..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement4.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement4.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement4.2.minified.js deleted file mode 100644 index e618552d524..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement4.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement6.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement6.1.normal.js deleted file mode 100644 index 727a90b07b9..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement6.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement6.2.minified.js deleted file mode 100644 index 727a90b07b9..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement7.1.normal.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement7.1.normal.js deleted file mode 100644 index c5e781ab6ab..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement7.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5ForOfStatement7.2.minified.js b/crates/swc/tests/tsc-references/parserES5ForOfStatement7.2.minified.js deleted file mode 100644 index c5e781ab6ab..00000000000 --- a/crates/swc/tests/tsc-references/parserES5ForOfStatement7.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserES5ForOfStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty4.1.normal.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty4.1.normal.js deleted file mode 100644 index 56ad2f27cb5..00000000000 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty4.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5SymbolProperty4.ts] diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty4.2.minified.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty4.2.minified.js deleted file mode 100644 index 56ad2f27cb5..00000000000 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty4.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserES5SymbolProperty4.ts] diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty5.1.normal.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty5.1.normal.js deleted file mode 100644 index 55484aa50c9..00000000000 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty5.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserES5SymbolProperty5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserES5SymbolProperty5.2.minified.js b/crates/swc/tests/tsc-references/parserES5SymbolProperty5.2.minified.js deleted file mode 100644 index 38254d4bf70..00000000000 --- a/crates/swc/tests/tsc-references/parserES5SymbolProperty5.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserES5SymbolProperty5.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserEmptyStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserEmptyStatement1.d.1.normal.js deleted file mode 100644 index 813fefb33db..00000000000 --- a/crates/swc/tests/tsc-references/parserEmptyStatement1.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserEmptyStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserEmptyStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserEmptyStatement1.d.2.minified.js deleted file mode 100644 index 813fefb33db..00000000000 --- a/crates/swc/tests/tsc-references/parserEmptyStatement1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserEmptyStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserEnum5.1.normal.js b/crates/swc/tests/tsc-references/parserEnum5.1.normal.js deleted file mode 100644 index 258b2f3c497..00000000000 --- a/crates/swc/tests/tsc-references/parserEnum5.1.normal.js +++ /dev/null @@ -1,49 +0,0 @@ -//// [parserEnum5.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! : ^ -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! : ^ -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserEnum5.2.minified.js b/crates/swc/tests/tsc-references/parserEnum5.2.minified.js deleted file mode 100644 index 258b2f3c497..00000000000 --- a/crates/swc/tests/tsc-references/parserEnum5.2.minified.js +++ /dev/null @@ -1,49 +0,0 @@ -//// [parserEnum5.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! : ^ -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! : ^ -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- -//! -//! x An enum member cannot have a numeric name -//! ,-[1:1] -//! 1 | enum E2 { a, } -//! 2 | enum E3 { a: 1, } -//! 3 | enum E1 { a, b: 1, c, d: 2 = 3 } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration2.1.normal.js deleted file mode 100644 index 61f05c2275a..00000000000 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration2.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserEnumDeclaration2.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare enum E { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration2.2.minified.js deleted file mode 100644 index 61f05c2275a..00000000000 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration2.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserEnumDeclaration2.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare enum E { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration4.1.normal.js b/crates/swc/tests/tsc-references/parserEnumDeclaration4.1.normal.js deleted file mode 100644 index 8b5f4291f9a..00000000000 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration4.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserEnumDeclaration4.ts] -var _void; -(function(_void) {})(_void || (_void = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration4.2.minified.js b/crates/swc/tests/tsc-references/parserEnumDeclaration4.2.minified.js deleted file mode 100644 index b9cf781c19f..00000000000 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration4.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserEnumDeclaration4.ts] -var _void; -_void || (_void = {}); diff --git a/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.1.normal.js b/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.1.normal.js deleted file mode 100644 index f5076a48b43..00000000000 --- a/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrantSemicolonInClass1.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[12:1] -//! 12 | public get d() { -//! 13 | return 30; -//! 14 | } -//! 15 | public set d() { -//! : ^^^ -//! 16 | } -//! 17 | -//! 18 | public static get p2() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.2.minified.js b/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.2.minified.js deleted file mode 100644 index f5076a48b43..00000000000 --- a/crates/swc/tests/tsc-references/parserErrantSemicolonInClass1.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrantSemicolonInClass1.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[12:1] -//! 12 | public get d() { -//! 13 | return 30; -//! 14 | } -//! 15 | public set d() { -//! : ^^^ -//! 16 | } -//! 17 | -//! 18 | public static get p2() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.1.normal.js deleted file mode 100644 index bd1af4a516c..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrorRecoveryIfStatement2.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | class Foo { -//! 2 | f1() { -//! 3 | if (a -//! 4 | } -//! : ^ -//! 5 | f2() { -//! 6 | } -//! 7 | f3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.2.minified.js deleted file mode 100644 index bd1af4a516c..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement2.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrorRecoveryIfStatement2.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | class Foo { -//! 2 | f1() { -//! 3 | if (a -//! 4 | } -//! : ^ -//! 5 | f2() { -//! 6 | } -//! 7 | f3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.1.normal.js deleted file mode 100644 index 11c1d0fd1f7..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrorRecoveryIfStatement3.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | class Foo { -//! 2 | f1() { -//! 3 | if (a.b -//! 4 | } -//! : ^ -//! 5 | f2() { -//! 6 | } -//! 7 | f3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.2.minified.js deleted file mode 100644 index 11c1d0fd1f7..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecoveryIfStatement3.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parserErrorRecoveryIfStatement3.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | class Foo { -//! 2 | f1() { -//! 3 | if (a.b -//! 4 | } -//! : ^ -//! 5 | f2() { -//! 6 | } -//! 7 | f3() { -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.1.normal.js deleted file mode 100644 index 1df10f394cf..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause2.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var C = /*#__PURE__*/ function(A1) { - "use strict"; - _inherits(C, A1); - var _super = _create_super(C); - function C() { - _class_call_check(this, C); - return _super.apply(this, arguments); - } - return C; -}(A); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.2.minified.js deleted file mode 100644 index f5cc4ec7184..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause2.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause2.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -A; diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.1.normal.js deleted file mode 100644 index 8d44e14dec8..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause4.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var C = /*#__PURE__*/ function(A1) { - "use strict"; - _inherits(C, A1); - var _super = _create_super(C); - function C() { - _class_call_check(this, C); - return _super.apply(this, arguments); - } - return C; -}(A); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.2.minified.js deleted file mode 100644 index 3b22f69836d..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause4.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause4.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -A; diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.1.normal.js deleted file mode 100644 index e316e9d1a89..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var C = /*#__PURE__*/ function(A1) { - "use strict"; - _inherits(C, A1); - var _super = _create_super(C); - function C() { - _class_call_check(this, C); - return _super.apply(this, arguments); - } - return C; -}(A); diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.2.minified.js deleted file mode 100644 index 22f52e5d778..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause5.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause5.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -A; diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.1.normal.js deleted file mode 100644 index 63bd73787b7..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause6.ts] diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.2.minified.js deleted file mode 100644 index 63bd73787b7..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_ExtendsOrImplementsClause6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserErrorRecovery_ExtendsOrImplementsClause6.ts] diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.1.normal.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.1.normal.js deleted file mode 100644 index 29e5568bc1a..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parserErrorRecovery_IncompleteMemberVariable2.ts] -//! -//! x Expected a semicolon -//! ,-[9:1] -//! 9 | // Class -//! 10 | export class Point implements IPoint { -//! 11 | -//! 12 | public con:C "hello"; -//! : ^^^^^^^ -//! 13 | // Constructor -//! 14 | constructor (public x: number, public y: number) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.2.minified.js b/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.2.minified.js deleted file mode 100644 index 29e5568bc1a..00000000000 --- a/crates/swc/tests/tsc-references/parserErrorRecovery_IncompleteMemberVariable2.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parserErrorRecovery_IncompleteMemberVariable2.ts] -//! -//! x Expected a semicolon -//! ,-[9:1] -//! 9 | // Class -//! 10 | export class Point implements IPoint { -//! 11 | -//! 12 | public con:C "hello"; -//! : ^^^^^^^ -//! 13 | // Constructor -//! 14 | constructor (public x: number, public y: number) { } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserExportAssignment5.1.normal.js b/crates/swc/tests/tsc-references/parserExportAssignment5.1.normal.js deleted file mode 100644 index ed07b60ca11..00000000000 --- a/crates/swc/tests/tsc-references/parserExportAssignment5.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserExportAssignment5.ts] -var M; -(function(M) {})(M || (M = {})); diff --git a/crates/swc/tests/tsc-references/parserExportAssignment5.2.minified.js b/crates/swc/tests/tsc-references/parserExportAssignment5.2.minified.js deleted file mode 100644 index b3bab1a515d..00000000000 --- a/crates/swc/tests/tsc-references/parserExportAssignment5.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserExportAssignment5.ts] -var M; -M || (M = {}); diff --git a/crates/swc/tests/tsc-references/parserExportAssignment9.1.normal.js b/crates/swc/tests/tsc-references/parserExportAssignment9.1.normal.js deleted file mode 100644 index b16f4858079..00000000000 --- a/crates/swc/tests/tsc-references/parserExportAssignment9.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [parserExportAssignment9.ts] -//! -//! x the name `default` is exported multiple times -//! ,-[1:1] -//! 1 | namespace Foo { -//! 2 | export default foo; -//! : ^^^^^^^^^|^^^^^^^^^ -//! : `-- previous exported here -//! 3 | } -//! 4 | -//! 5 | module Bar { -//! 6 | export default bar; -//! : ^^^^^^^^^|^^^^^^^^^ -//! : `-- exported more than once -//! 7 | } -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique diff --git a/crates/swc/tests/tsc-references/parserExportAssignment9.2.minified.js b/crates/swc/tests/tsc-references/parserExportAssignment9.2.minified.js deleted file mode 100644 index b16f4858079..00000000000 --- a/crates/swc/tests/tsc-references/parserExportAssignment9.2.minified.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [parserExportAssignment9.ts] -//! -//! x the name `default` is exported multiple times -//! ,-[1:1] -//! 1 | namespace Foo { -//! 2 | export default foo; -//! : ^^^^^^^^^|^^^^^^^^^ -//! : `-- previous exported here -//! 3 | } -//! 4 | -//! 5 | module Bar { -//! 6 | export default bar; -//! : ^^^^^^^^^|^^^^^^^^^ -//! : `-- exported more than once -//! 7 | } -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique diff --git a/crates/swc/tests/tsc-references/parserExpressionStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserExpressionStatement1.d.1.normal.js deleted file mode 100644 index 679f65c87e3..00000000000 --- a/crates/swc/tests/tsc-references/parserExpressionStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserExpressionStatement1.d.ts] -Foo(); diff --git a/crates/swc/tests/tsc-references/parserExpressionStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserExpressionStatement1.d.2.minified.js deleted file mode 100644 index 679f65c87e3..00000000000 --- a/crates/swc/tests/tsc-references/parserExpressionStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserExpressionStatement1.d.ts] -Foo(); diff --git a/crates/swc/tests/tsc-references/parserForInStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement1.d.1.normal.js deleted file mode 100644 index faa716bed9c..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForInStatement1.d.ts] -for(var i in e){} diff --git a/crates/swc/tests/tsc-references/parserForInStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement1.d.2.minified.js deleted file mode 100644 index e97b134c309..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForInStatement1.d.ts] -for(var i in e); diff --git a/crates/swc/tests/tsc-references/parserForInStatement2.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement2.1.normal.js deleted file mode 100644 index 2205469e9ab..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement2.2.minified.js deleted file mode 100644 index 2205469e9ab..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement3.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement3.1.normal.js deleted file mode 100644 index d79af678dbb..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement3.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement3.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement3.2.minified.js deleted file mode 100644 index d79af678dbb..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement4.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement4.1.normal.js deleted file mode 100644 index 0908ec1c864..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement4.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement4.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement4.2.minified.js deleted file mode 100644 index 0908ec1c864..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement4.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement6.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement6.1.normal.js deleted file mode 100644 index f938cdd0e73..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement6.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement6.2.minified.js deleted file mode 100644 index f938cdd0e73..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement7.1.normal.js b/crates/swc/tests/tsc-references/parserForInStatement7.1.normal.js deleted file mode 100644 index 4da213efa8d..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement7.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForInStatement7.2.minified.js b/crates/swc/tests/tsc-references/parserForInStatement7.2.minified.js deleted file mode 100644 index 4da213efa8d..00000000000 --- a/crates/swc/tests/tsc-references/parserForInStatement7.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForInStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" in X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement1.d.1.normal.js deleted file mode 100644 index fd0e0b965ba..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForOfStatement1.d.ts] -for (var i of e){} diff --git a/crates/swc/tests/tsc-references/parserForOfStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement1.d.2.minified.js deleted file mode 100644 index 1e7e53ad6b8..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForOfStatement1.d.ts] -for (var i of e); diff --git a/crates/swc/tests/tsc-references/parserForOfStatement2.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement2.1.normal.js deleted file mode 100644 index e61789b3297..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement2.2.minified.js deleted file mode 100644 index e61789b3297..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement2.ts] -//! -//! x Variable declaration list cannot be empty -//! ,-[1:1] -//! 1 | for (var of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement20.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement20.1.normal.js deleted file mode 100644 index 23cc7148342..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement20.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForOfStatement20.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,---- -//! 1 | for (var of = 0 in of) { } -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement20.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement20.2.minified.js deleted file mode 100644 index 23cc7148342..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement20.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForOfStatement20.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,---- -//! 1 | for (var of = 0 in of) { } -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement21.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement21.1.normal.js deleted file mode 100644 index 8d3e28845eb..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement21.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForOfStatement21.ts] -//! -//! x Variable declaration list cannot be empty -//! ,---- -//! 1 | for (var of of) { } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement21.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement21.2.minified.js deleted file mode 100644 index 8d3e28845eb..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement21.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForOfStatement21.ts] -//! -//! x Variable declaration list cannot be empty -//! ,---- -//! 1 | for (var of of) { } -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement22.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement22.1.normal.js deleted file mode 100644 index 925ad9889c9..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement22.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserForOfStatement22.ts] -//! -//! x The left-hand side of a `for...of` statement may not be `async` -//! ,-[1:1] -//! 1 | -//! 2 | var async; -//! 3 | for (async of [1, 2]) {} -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement22.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement22.2.minified.js deleted file mode 100644 index 925ad9889c9..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement22.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserForOfStatement22.ts] -//! -//! x The left-hand side of a `for...of` statement may not be `async` -//! ,-[1:1] -//! 1 | -//! 2 | var async; -//! 3 | for (async of [1, 2]) {} -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement3.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement3.1.normal.js deleted file mode 100644 index ab10529d32f..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement3.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement3.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement3.2.minified.js deleted file mode 100644 index ab10529d32f..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement3.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a, b of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement4.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement4.1.normal.js deleted file mode 100644 index 828f77f7802..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement4.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement4.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement4.2.minified.js deleted file mode 100644 index 828f77f7802..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement4.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement4.ts] -//! -//! x Unexpected initializer in for in/of loop -//! ,-[1:1] -//! 1 | for (var a = 1 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement6.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement6.1.normal.js deleted file mode 100644 index bb12fa2020c..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement6.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement6.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement6.2.minified.js deleted file mode 100644 index bb12fa2020c..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement6.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement6.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a = 1, b = 2 of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement7.1.normal.js b/crates/swc/tests/tsc-references/parserForOfStatement7.1.normal.js deleted file mode 100644 index b9686006a07..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement7.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForOfStatement7.2.minified.js b/crates/swc/tests/tsc-references/parserForOfStatement7.2.minified.js deleted file mode 100644 index b9686006a07..00000000000 --- a/crates/swc/tests/tsc-references/parserForOfStatement7.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserForOfStatement7.ts] -//! -//! x Expected one variable binding -//! ,-[1:1] -//! 1 | for (var a: number = 1, b: string = "" of X) { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserForStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserForStatement1.d.1.normal.js deleted file mode 100644 index e46eff660fb..00000000000 --- a/crates/swc/tests/tsc-references/parserForStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForStatement1.d.ts] -for(;;){} diff --git a/crates/swc/tests/tsc-references/parserForStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserForStatement1.d.2.minified.js deleted file mode 100644 index b09a5d1159a..00000000000 --- a/crates/swc/tests/tsc-references/parserForStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserForStatement1.d.ts] -for(;;); diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration1.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration1.1.normal.js deleted file mode 100644 index 22b7a3647f1..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration1.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserFunctionDeclaration1.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare function F(); -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration1.2.minified.js deleted file mode 100644 index 22b7a3647f1..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration1.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserFunctionDeclaration1.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare function F(); -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration2.1.normal.js deleted file mode 100644 index 12e6bbf208a..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserFunctionDeclaration2.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare function Foo() { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration2.2.minified.js deleted file mode 100644 index 12e6bbf208a..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserFunctionDeclaration2.ts] -//! -//! x An implementation cannot be declared in ambient contexts -//! ,-[1:1] -//! 1 | declare function Foo() { -//! : ^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.1.normal.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.1.normal.js deleted file mode 100644 index 4e02769633c..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserFunctionDeclaration2.d.ts] -function F() {} diff --git a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.2.minified.js b/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.2.minified.js deleted file mode 100644 index b5b1f8e6e37..00000000000 --- a/crates/swc/tests/tsc-references/parserFunctionDeclaration2.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserFunctionDeclaration2.d.ts] diff --git a/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.1.normal.js b/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.1.normal.js deleted file mode 100644 index baf0d2b370d..00000000000 --- a/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserGetAccessorWithTypeParameters1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "foo", - get: function get() {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.2.minified.js b/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.2.minified.js deleted file mode 100644 index 4ee87f7b73c..00000000000 --- a/crates/swc/tests/tsc-references/parserGetAccessorWithTypeParameters1.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserGetAccessorWithTypeParameters1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserIfStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserIfStatement1.d.1.normal.js deleted file mode 100644 index 7170b2f8d5a..00000000000 --- a/crates/swc/tests/tsc-references/parserIfStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserIfStatement1.d.ts] -if (foo) {} diff --git a/crates/swc/tests/tsc-references/parserIfStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserIfStatement1.d.2.minified.js deleted file mode 100644 index c7fd54fc843..00000000000 --- a/crates/swc/tests/tsc-references/parserIfStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserIfStatement1.d.ts] -foo; diff --git a/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.1.normal.js b/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.1.normal.js deleted file mode 100644 index 04084f12b99..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserIndexMemberDeclaration10.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.2.minified.js b/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.2.minified.js deleted file mode 100644 index 1c1669407a2..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexMemberDeclaration10.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserIndexMemberDeclaration10.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserIndexSignature10.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature10.1.normal.js deleted file mode 100644 index c7597ac84be..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature10.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserIndexSignature10.ts] -//! -//! x An index signature must have exactly one parameter -//! ,-[1:1] -//! 1 | interface I { -//! 2 | [a, b]: number -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserIndexSignature10.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature10.2.minified.js deleted file mode 100644 index c7597ac84be..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature10.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserIndexSignature10.ts] -//! -//! x An index signature must have exactly one parameter -//! ,-[1:1] -//! 1 | interface I { -//! 2 | [a, b]: number -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserIndexSignature4.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature4.1.normal.js deleted file mode 100644 index e92ff517e71..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature4.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature4.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature4.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature4.2.minified.js deleted file mode 100644 index e92ff517e71..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature4.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature4.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature5.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature5.1.normal.js deleted file mode 100644 index a65b6b9f47b..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature5.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature5.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature5.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature5.2.minified.js deleted file mode 100644 index a65b6b9f47b..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature5.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature5.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature6.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature6.1.normal.js deleted file mode 100644 index c5042a75110..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature6.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature6.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature6.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature6.2.minified.js deleted file mode 100644 index c5042a75110..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature6.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature6.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature7.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature7.1.normal.js deleted file mode 100644 index eeaa06f9a9b..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature7.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature7.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature7.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature7.2.minified.js deleted file mode 100644 index eeaa06f9a9b..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature7.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature7.ts] diff --git a/crates/swc/tests/tsc-references/parserIndexSignature8.1.normal.js b/crates/swc/tests/tsc-references/parserIndexSignature8.1.normal.js deleted file mode 100644 index a43f68c8b1d..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature8.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserIndexSignature8.ts] -var foo; // expect an error here -var foo2; // expect an error here diff --git a/crates/swc/tests/tsc-references/parserIndexSignature8.2.minified.js b/crates/swc/tests/tsc-references/parserIndexSignature8.2.minified.js deleted file mode 100644 index 20d4d07abd3..00000000000 --- a/crates/swc/tests/tsc-references/parserIndexSignature8.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserIndexSignature8.ts] diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.1.normal.js deleted file mode 100644 index de99a0f4fb3..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserInterfaceDeclaration1.ts] -//! -//! x `extends` clause already seen. -//! ,-[1:1] -//! 1 | interface I extends A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.2.minified.js deleted file mode 100644 index de99a0f4fb3..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration1.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserInterfaceDeclaration1.ts] -//! -//! x `extends` clause already seen. -//! ,-[1:1] -//! 1 | interface I extends A extends B { -//! : ^^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.1.normal.js deleted file mode 100644 index e830a2f142c..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserInterfaceDeclaration3.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | public interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.2.minified.js deleted file mode 100644 index e830a2f142c..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserInterfaceDeclaration3.ts] -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | public interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.1.normal.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.1.normal.js deleted file mode 100644 index f8381cb2a9d..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserInterfaceDeclaration4.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | static interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- -//! -//! x interface name is invalid -//! ,-[1:1] -//! 1 | static interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.2.minified.js b/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.2.minified.js deleted file mode 100644 index f8381cb2a9d..00000000000 --- a/crates/swc/tests/tsc-references/parserInterfaceDeclaration4.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserInterfaceDeclaration4.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[1:1] -//! 1 | static interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- -//! -//! x interface name is invalid -//! ,-[1:1] -//! 1 | static interface I { -//! : ^^^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserLabeledStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserLabeledStatement1.d.1.normal.js deleted file mode 100644 index 9d3b114ad46..00000000000 --- a/crates/swc/tests/tsc-references/parserLabeledStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserLabeledStatement1.d.ts] -foo: bar(); diff --git a/crates/swc/tests/tsc-references/parserLabeledStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserLabeledStatement1.d.2.minified.js deleted file mode 100644 index 9d3b114ad46..00000000000 --- a/crates/swc/tests/tsc-references/parserLabeledStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserLabeledStatement1.d.ts] -foo: bar(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessExpression1.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessExpression1.1.normal.js deleted file mode 100644 index 685a23eec99..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessExpression1.1.normal.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserMemberAccessExpression1.ts] -Foo(); -Foo.Bar(); -Foo.Bar(); -Foo.Bar(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessExpression1.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessExpression1.2.minified.js deleted file mode 100644 index 0c019dd99ec..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessExpression1.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserMemberAccessExpression1.ts] -Foo(), Foo.Bar(), Foo.Bar(), Foo.Bar(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.1.normal.js deleted file mode 100644 index 66ef326adb0..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserMemberAccessOffOfGenericType1.ts] -var v = List.makeChild(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.2.minified.js deleted file mode 100644 index 3987d34aa21..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessOffOfGenericType1.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserMemberAccessOffOfGenericType1.ts] -List.makeChild(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.1.normal.js deleted file mode 100644 index dc4e136a6e8..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserMemberAccessorDeclaration11.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "Foo", - get: function get() {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.2.minified.js deleted file mode 100644 index 0116600bf12..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration11.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserMemberAccessorDeclaration11.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.1.normal.js deleted file mode 100644 index e861a53de7e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration12.ts] -//! -//! x A `get` accessor cannot have parameters -//! ,-[1:1] -//! 1 | class C { -//! 2 | get Foo(a: number) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.2.minified.js deleted file mode 100644 index e861a53de7e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration12.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration12.ts] -//! -//! x A `get` accessor cannot have parameters -//! ,-[1:1] -//! 1 | class C { -//! 2 | get Foo(a: number) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.1.normal.js deleted file mode 100644 index 0330b43cd1e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration13.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo() { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.2.minified.js deleted file mode 100644 index 0330b43cd1e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration13.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration13.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo() { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.1.normal.js deleted file mode 100644 index b6583cbe800..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration14.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo(a: number, b: number) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.2.minified.js deleted file mode 100644 index b6583cbe800..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration14.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration14.ts] -//! -//! x A `set` accessor must have exactly one parameter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo(a: number, b: number) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.1.normal.js deleted file mode 100644 index ec73bb4a7fe..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.1.normal.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [parserMemberAccessorDeclaration16.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "Foo", - set: function set() { - var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1; - } - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.2.minified.js deleted file mode 100644 index 4fa7a8f57a6..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration16.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserMemberAccessorDeclaration16.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.1.normal.js deleted file mode 100644 index 82cda5a69d5..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserMemberAccessorDeclaration17.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "Foo", - set: function set(a) {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.2.minified.js deleted file mode 100644 index 58f66e97947..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration17.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserMemberAccessorDeclaration17.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.1.normal.js deleted file mode 100644 index cf025ec2c5e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration18.ts] -//! -//! x Rest pattern is not allowed in setter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo(...a) { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.2.minified.js deleted file mode 100644 index cf025ec2c5e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration18.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberAccessorDeclaration18.ts] -//! -//! x Rest pattern is not allowed in setter -//! ,-[1:1] -//! 1 | class C { -//! 2 | set Foo(...a) { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.1.normal.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.1.normal.js deleted file mode 100644 index d709f500cac..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserMemberAccessorDeclaration8.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, null, [ - { - key: "Foo", - get: function get() {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.2.minified.js b/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.2.minified.js deleted file mode 100644 index edc9175a92a..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberAccessorDeclaration8.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserMemberAccessorDeclaration8.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.1.normal.js deleted file mode 100644 index e8c49382d5e..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserMemberFunctionDeclaration2.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - C.Foo = function Foo() {}; - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.2.minified.js deleted file mode 100644 index b3936505040..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration2.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserMemberFunctionDeclaration2.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.1.normal.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.1.normal.js deleted file mode 100644 index e6910d6cf9b..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberFunctionDeclaration5.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[1:1] -//! 1 | class C { -//! 2 | declare Foo() { } -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.2.minified.js b/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.2.minified.js deleted file mode 100644 index e6910d6cf9b..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberFunctionDeclaration5.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserMemberFunctionDeclaration5.ts] -//! -//! x `declare` modifier cannot appear on class elements of this kind -//! ,-[1:1] -//! 1 | class C { -//! 2 | declare Foo() { } -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.1.normal.js b/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.1.normal.js deleted file mode 100644 index ae1234e95d9..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.1.normal.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserMemberVariableDeclaration2.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; diff --git a/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.2.minified.js b/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.2.minified.js deleted file mode 100644 index 25535619420..00000000000 --- a/crates/swc/tests/tsc-references/parserMemberVariableDeclaration2.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserMemberVariableDeclaration2.ts] -import "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.1.normal.js b/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.1.normal.js deleted file mode 100644 index bddc4d51447..00000000000 --- a/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserModifierOnStatementInBlock2.ts] -{} diff --git a/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.2.minified.js b/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.2.minified.js deleted file mode 100644 index 8da072d4bb8..00000000000 --- a/crates/swc/tests/tsc-references/parserModifierOnStatementInBlock2.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModifierOnStatementInBlock2.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration1.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration1.1.normal.js deleted file mode 100644 index 5d9869c23da..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration1.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration1.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration1.2.minified.js deleted file mode 100644 index 5d9869c23da..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration1.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration1.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.1.normal.js deleted file mode 100644 index e81646b39e3..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.2.minified.js deleted file mode 100644 index e81646b39e3..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.1.normal.js deleted file mode 100644 index edd0cccecad..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration2.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.2.minified.js deleted file mode 100644 index edd0cccecad..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration2.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration2.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration3.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration3.1.normal.js deleted file mode 100644 index cf6dac3155b..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration3.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserModuleDeclaration3.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare module M2 { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration3.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration3.2.minified.js deleted file mode 100644 index cf6dac3155b..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration3.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserModuleDeclaration3.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare module M2 { -//! : ^^^^^^^ -//! 3 | } -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.1.normal.js deleted file mode 100644 index 1ff651133a7..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration4.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.2.minified.js deleted file mode 100644 index 1ff651133a7..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration4.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserModuleDeclaration4.d.ts] diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration5.1.normal.js b/crates/swc/tests/tsc-references/parserModuleDeclaration5.1.normal.js deleted file mode 100644 index 8c8daa0839b..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration5.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parserModuleDeclaration5.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | module M1 { -//! 2 | declare module M2 { -//! 3 | declare module M3 { -//! : ^^^^^^^ -//! 4 | } -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserModuleDeclaration5.2.minified.js b/crates/swc/tests/tsc-references/parserModuleDeclaration5.2.minified.js deleted file mode 100644 index 8c8daa0839b..00000000000 --- a/crates/swc/tests/tsc-references/parserModuleDeclaration5.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parserModuleDeclaration5.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | module M1 { -//! 2 | declare module M2 { -//! 3 | declare module M3 { -//! : ^^^^^^^ -//! 4 | } -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserNotRegex1.1.normal.js b/crates/swc/tests/tsc-references/parserNotRegex1.1.normal.js deleted file mode 100644 index 60bd7d3b187..00000000000 --- a/crates/swc/tests/tsc-references/parserNotRegex1.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserNotRegex1.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment. -//! 2 | { -//! 3 | return true; -//! : ^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserNotRegex1.2.minified.js b/crates/swc/tests/tsc-references/parserNotRegex1.2.minified.js deleted file mode 100644 index 60bd7d3b187..00000000000 --- a/crates/swc/tests/tsc-references/parserNotRegex1.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserNotRegex1.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment. -//! 2 | { -//! 3 | return true; -//! : ^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList1.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList1.1.normal.js deleted file mode 100644 index a03c73ce9cd..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList1.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList1.ts] -//! -//! x A rest parameter must be last in a parameter list -//! ,-[1:1] -//! 1 | class C { -//! 2 | F(...A, B) { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList1.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList1.2.minified.js deleted file mode 100644 index a03c73ce9cd..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList1.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList1.ts] -//! -//! x A rest parameter must be last in a parameter list -//! ,-[1:1] -//! 1 | class C { -//! 2 | F(...A, B) { } -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList10.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList10.1.normal.js deleted file mode 100644 index 769ce74266c..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList10.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList10.ts] -//! -//! x A rest parameter cannot have an initializer -//! ,-[1:1] -//! 1 | class C { -//! 2 | foo(...bar = 0) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList10.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList10.2.minified.js deleted file mode 100644 index 769ce74266c..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList10.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList10.ts] -//! -//! x A rest parameter cannot have an initializer -//! ,-[1:1] -//! 1 | class C { -//! 2 | foo(...bar = 0) { } -//! : ^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList11.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList11.1.normal.js deleted file mode 100644 index 1476b8160ca..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList11.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserParameterList11.ts] -//! -//! x A rest parameter cannot be optional -//! ,---- -//! 1 | (...arg?) => 102; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList11.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList11.2.minified.js deleted file mode 100644 index 1476b8160ca..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList11.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserParameterList11.ts] -//! -//! x A rest parameter cannot be optional -//! ,---- -//! 1 | (...arg?) => 102; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList2.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList2.1.normal.js deleted file mode 100644 index 430cb2e55fe..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList2.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList2.ts] -//! -//! x Parameter cannot have question mark and initializer -//! ,-[1:1] -//! 1 | class C { -//! 2 | F(A?= 0) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList2.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList2.2.minified.js deleted file mode 100644 index 430cb2e55fe..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList2.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList2.ts] -//! -//! x Parameter cannot have question mark and initializer -//! ,-[1:1] -//! 1 | class C { -//! 2 | F(A?= 0) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList3.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList3.1.normal.js deleted file mode 100644 index ccb8432cf75..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList3.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserParameterList3.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - var _proto = C.prototype; - _proto.F = function F(A, B) {}; - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserParameterList3.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList3.2.minified.js deleted file mode 100644 index d0a0d7da638..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList3.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserParameterList3.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; diff --git a/crates/swc/tests/tsc-references/parserParameterList9.1.normal.js b/crates/swc/tests/tsc-references/parserParameterList9.1.normal.js deleted file mode 100644 index 8876b2d5efb..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList9.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList9.ts] -//! -//! x A rest parameter cannot be optional -//! ,-[1:1] -//! 1 | class C { -//! 2 | foo(...bar?) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserParameterList9.2.minified.js b/crates/swc/tests/tsc-references/parserParameterList9.2.minified.js deleted file mode 100644 index 8876b2d5efb..00000000000 --- a/crates/swc/tests/tsc-references/parserParameterList9.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserParameterList9.ts] -//! -//! x A rest parameter cannot be optional -//! ,-[1:1] -//! 1 | class C { -//! 2 | foo(...bar?) { } -//! : ^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserRegularExpression1.1.normal.js b/crates/swc/tests/tsc-references/parserRegularExpression1.1.normal.js deleted file mode 100644 index afe905b9fe8..00000000000 --- a/crates/swc/tests/tsc-references/parserRegularExpression1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserRegularExpression1.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserRegularExpression1.2.minified.js b/crates/swc/tests/tsc-references/parserRegularExpression1.2.minified.js deleted file mode 100644 index afe905b9fe8..00000000000 --- a/crates/swc/tests/tsc-references/parserRegularExpression1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserRegularExpression1.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement1.1.normal.js b/crates/swc/tests/tsc-references/parserReturnStatement1.1.normal.js deleted file mode 100644 index 20e21ad55ca..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserReturnStatement1.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return; -//! : ^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement1.2.minified.js b/crates/swc/tests/tsc-references/parserReturnStatement1.2.minified.js deleted file mode 100644 index 20e21ad55ca..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserReturnStatement1.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return; -//! : ^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserReturnStatement1.d.1.normal.js deleted file mode 100644 index e32b31e21ba..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement1.d.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserReturnStatement1.d.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return; -//! : ^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserReturnStatement1.d.2.minified.js deleted file mode 100644 index e32b31e21ba..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement1.d.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserReturnStatement1.d.ts] -//! -//! x Return statement is not allowed here -//! ,---- -//! 1 | return; -//! : ^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement2.1.normal.js b/crates/swc/tests/tsc-references/parserReturnStatement2.1.normal.js deleted file mode 100644 index 350a3b29e59..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement2.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserReturnStatement2.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | { -//! 2 | return; -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserReturnStatement2.2.minified.js b/crates/swc/tests/tsc-references/parserReturnStatement2.2.minified.js deleted file mode 100644 index 350a3b29e59..00000000000 --- a/crates/swc/tests/tsc-references/parserReturnStatement2.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserReturnStatement2.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | { -//! 2 | return; -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.1.normal.js b/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.1.normal.js deleted file mode 100644 index 9d400ba809c..00000000000 --- a/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserS7.9_A5.7_T1.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[14:1] -//! 14 | var z= -//! 15 | x -//! 16 | ++ -//! 17 | ,-> ++ -//! 18 | `-> y -//! 19 | -//! `---- diff --git a/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.2.minified.js b/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.2.minified.js deleted file mode 100644 index 9d400ba809c..00000000000 --- a/crates/swc/tests/tsc-references/parserS7.9_A5.7_T1.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserS7.9_A5.7_T1.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[14:1] -//! 14 | var z= -//! 15 | x -//! 16 | ++ -//! 17 | ,-> ++ -//! 18 | `-> y -//! 19 | -//! `---- diff --git a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.1.normal.js b/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.1.normal.js deleted file mode 100644 index 1c43dc8361d..00000000000 --- a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserSetAccessorWithTypeAnnotation1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "foo", - set: function set(v) {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.2.minified.js b/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.2.minified.js deleted file mode 100644 index 931303dc85b..00000000000 --- a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeAnnotation1.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserSetAccessorWithTypeAnnotation1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.1.normal.js b/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.1.normal.js deleted file mode 100644 index f78740f7a9f..00000000000 --- a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.1.normal.js +++ /dev/null @@ -1,16 +0,0 @@ -//// [parserSetAccessorWithTypeParameters1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "foo", - set: function set(v) {} - } - ]); - return C; -}(); diff --git a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.2.minified.js b/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.2.minified.js deleted file mode 100644 index 86468be8104..00000000000 --- a/crates/swc/tests/tsc-references/parserSetAccessorWithTypeParameters1.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserSetAccessorWithTypeParameters1.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.1.normal.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.1.normal.js deleted file mode 100644 index 0b1abe5e833..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.1.normal.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserShorthandPropertyAssignment1.ts] -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | function foo(obj: { name?: string; id: number }) { } -//! 2 | var name:any, id: any; -//! 3 | foo({ name?, id? }); -//! : ^ -//! `---- -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | function foo(obj: { name?: string; id: number }) { } -//! 2 | var name:any, id: any; -//! 3 | foo({ name?, id? }); -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.2.minified.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.2.minified.js deleted file mode 100644 index 0b1abe5e833..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment1.2.minified.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserShorthandPropertyAssignment1.ts] -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | function foo(obj: { name?: string; id: number }) { } -//! 2 | var name:any, id: any; -//! 3 | foo({ name?, id? }); -//! : ^ -//! `---- -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | function foo(obj: { name?: string; id: number }) { } -//! 2 | var name:any, id: any; -//! 3 | foo({ name?, id? }); -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.1.normal.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.1.normal.js deleted file mode 100644 index aa15bd8415e..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment2.ts] -//! -//! x Cannot use a reserved word as a shorthand property -//! ,---- -//! 1 | var v = { class }; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.2.minified.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.2.minified.js deleted file mode 100644 index aa15bd8415e..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment2.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment2.ts] -//! -//! x Cannot use a reserved word as a shorthand property -//! ,---- -//! 1 | var v = { class }; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.1.normal.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.1.normal.js deleted file mode 100644 index bddcdad1fd8..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment3.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { "" }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.2.minified.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.2.minified.js deleted file mode 100644 index bddcdad1fd8..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment3.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment3.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { "" }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.1.normal.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.1.normal.js deleted file mode 100644 index d21b162c3ae..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment4.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { 0 }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.2.minified.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.2.minified.js deleted file mode 100644 index d21b162c3ae..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment4.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserShorthandPropertyAssignment4.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v = { 0 }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.1.normal.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.1.normal.js deleted file mode 100644 index 95ec29adb4f..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserShorthandPropertyAssignment5.ts] -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | var greet = "hello"; -//! 2 | var obj = { greet? }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.2.minified.js b/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.2.minified.js deleted file mode 100644 index 95ec29adb4f..00000000000 --- a/crates/swc/tests/tsc-references/parserShorthandPropertyAssignment5.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserShorthandPropertyAssignment5.ts] -//! -//! x An object member cannot be declared optional -//! ,-[1:1] -//! 1 | var greet = "hello"; -//! 2 | var obj = { greet? }; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.1.normal.js b/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.1.normal.js deleted file mode 100644 index 77d248b2711..00000000000 --- a/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.1.normal.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [parserStatementIsNotAMemberVariableDeclaration1.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | ,-> return { -//! 2 | | -//! 3 | `-> "set": function (key, value) { -//! 4 | -//! 5 | // 'private' should not be considered a member variable here. -//! 6 | private[key] = value; -//! `---- -//! -//! x Expression expected -//! ,-[3:1] -//! 3 | "set": function (key, value) { -//! 4 | -//! 5 | // 'private' should not be considered a member variable here. -//! 6 | private[key] = value; -//! : ^^^^^^^ -//! 7 | -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.2.minified.js b/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.2.minified.js deleted file mode 100644 index 77d248b2711..00000000000 --- a/crates/swc/tests/tsc-references/parserStatementIsNotAMemberVariableDeclaration1.2.minified.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [parserStatementIsNotAMemberVariableDeclaration1.ts] -//! -//! x Return statement is not allowed here -//! ,-[1:1] -//! 1 | ,-> return { -//! 2 | | -//! 3 | `-> "set": function (key, value) { -//! 4 | -//! 5 | // 'private' should not be considered a member variable here. -//! 6 | private[key] = value; -//! `---- -//! -//! x Expression expected -//! ,-[3:1] -//! 3 | "set": function (key, value) { -//! 4 | -//! 5 | // 'private' should not be considered a member variable here. -//! 6 | private[key] = value; -//! : ^^^^^^^ -//! 7 | -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode10.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode10.1.normal.js deleted file mode 100644 index 1855675d062..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode10.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode10.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | function f(eval) { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode10.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode10.2.minified.js deleted file mode 100644 index 1855675d062..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode10.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode10.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | function f(eval) { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode11.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode11.1.normal.js deleted file mode 100644 index 9de921a9264..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode11.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode11.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = function f(eval) { -//! : ^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode11.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode11.2.minified.js deleted file mode 100644 index 9de921a9264..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode11.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode11.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = function f(eval) { -//! : ^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode12.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode12.1.normal.js deleted file mode 100644 index 8ada8434285..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode12.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserStrictMode12.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = { set foo(eval) { } } -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode12.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode12.2.minified.js deleted file mode 100644 index 8ada8434285..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode12.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserStrictMode12.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = { set foo(eval) { } } -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode13.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode13.1.normal.js deleted file mode 100644 index 718ec373bfa..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode13.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserStrictMode13.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | try { -//! 3 | } -//! 4 | catch(eval) { -//! : ^^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode13.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode13.2.minified.js deleted file mode 100644 index 718ec373bfa..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode13.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parserStrictMode13.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | try { -//! 3 | } -//! 4 | catch(eval) { -//! : ^^^^ -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode14.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode14.1.normal.js deleted file mode 100644 index c69f83c3b89..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode14.1.normal.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserStrictMode14.ts] -//! -//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | with (a) { -//! : ^^^^ -//! 3 | } -//! `---- -//! -//! x With statement are not allowed in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | with (a) { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode14.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode14.2.minified.js deleted file mode 100644 index c69f83c3b89..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode14.2.minified.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserStrictMode14.ts] -//! -//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | with (a) { -//! : ^^^^ -//! 3 | } -//! `---- -//! -//! x With statement are not allowed in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | with (a) { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode15.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode15.1.normal.js deleted file mode 100644 index 8bf403a83f9..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode15.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode15.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | delete a; -//! : ^ -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | delete a; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode15.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode15.2.minified.js deleted file mode 100644 index 8bf403a83f9..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode15.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode15.ts] -//! -//! x 'delete' cannot be called on an identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | delete a; -//! : ^ -//! `---- -//! -//! x The operand of a delete operator must be a property reference. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | delete a; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode2.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode2.1.normal.js deleted file mode 100644 index 3eae67110ee..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode2.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserStrictMode2.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[2:1] -//! 2 | foo1(); -//! 3 | foo1(); -//! 4 | foo1(); -//! 5 | static(); -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode2.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode2.2.minified.js deleted file mode 100644 index 3eae67110ee..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode2.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parserStrictMode2.ts] -//! -//! x `static` cannot be used as an identifier in strict mode -//! ,-[2:1] -//! 2 | foo1(); -//! 3 | foo1(); -//! 4 | foo1(); -//! 5 | static(); -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode3.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode3.1.normal.js deleted file mode 100644 index aee666b3f7a..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode3.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval = 1; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval = 1; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode3.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode3.2.minified.js deleted file mode 100644 index aee666b3f7a..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode3.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode3.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval = 1; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval = 1; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode4.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode4.1.normal.js deleted file mode 100644 index 422aa389c0d..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode4.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode4.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | arguments = 1; -//! : ^^^^^^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | arguments = 1; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode4.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode4.2.minified.js deleted file mode 100644 index 422aa389c0d..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode4.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode4.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | arguments = 1; -//! : ^^^^^^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | arguments = 1; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode5.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode5.1.normal.js deleted file mode 100644 index 00cb9b8275e..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode5.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode5.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval += 1; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval += 1; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode5.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode5.2.minified.js deleted file mode 100644 index 00cb9b8275e..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode5.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode5.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval += 1; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval += 1; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode6.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode6.1.normal.js deleted file mode 100644 index 02bf9ba6ed6..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode6.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode6.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval++; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval++; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode6.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode6.2.minified.js deleted file mode 100644 index 02bf9ba6ed6..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode6.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode6.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval++; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | eval++; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode7.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode7.1.normal.js deleted file mode 100644 index a1b1784df19..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode7.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode7.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | ++eval; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | ++eval; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode7.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode7.2.minified.js deleted file mode 100644 index a1b1784df19..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode7.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserStrictMode7.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | ++eval; -//! : ^^^^ -//! `---- -//! -//! x Invalid use of 'arguments' in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | ++eval; -//! : ^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode8.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode8.1.normal.js deleted file mode 100644 index 3e06966144a..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode8.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode8.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | function eval() { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode8.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode8.2.minified.js deleted file mode 100644 index 3e06966144a..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode8.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode8.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | function eval() { -//! : ^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode9.1.normal.js b/crates/swc/tests/tsc-references/parserStrictMode9.1.normal.js deleted file mode 100644 index cf525bcead8..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode9.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode9.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = function eval() { -//! : ^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserStrictMode9.2.minified.js b/crates/swc/tests/tsc-references/parserStrictMode9.2.minified.js deleted file mode 100644 index cf525bcead8..00000000000 --- a/crates/swc/tests/tsc-references/parserStrictMode9.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserStrictMode9.ts] -//! -//! x 'eval' and 'arguments' cannot be used as a binding identifier in strict mode -//! ,-[1:1] -//! 1 | "use strict"; -//! 2 | var v = function eval() { -//! : ^^^^ -//! 3 | }; -//! `---- diff --git a/crates/swc/tests/tsc-references/parserSwitchStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserSwitchStatement1.d.1.normal.js deleted file mode 100644 index 0cedbca5e24..00000000000 --- a/crates/swc/tests/tsc-references/parserSwitchStatement1.d.1.normal.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [parserSwitchStatement1.d.ts] -switch(foo){ -} diff --git a/crates/swc/tests/tsc-references/parserSwitchStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserSwitchStatement1.d.2.minified.js deleted file mode 100644 index a4dd7ddd789..00000000000 --- a/crates/swc/tests/tsc-references/parserSwitchStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserSwitchStatement1.d.ts] -foo; diff --git a/crates/swc/tests/tsc-references/parserThrowStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserThrowStatement1.d.1.normal.js deleted file mode 100644 index 9c6c2c1d749..00000000000 --- a/crates/swc/tests/tsc-references/parserThrowStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserThrowStatement1.d.ts] -throw e; diff --git a/crates/swc/tests/tsc-references/parserThrowStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserThrowStatement1.d.2.minified.js deleted file mode 100644 index 9c6c2c1d749..00000000000 --- a/crates/swc/tests/tsc-references/parserThrowStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserThrowStatement1.d.ts] -throw e; diff --git a/crates/swc/tests/tsc-references/parserTryStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserTryStatement1.d.1.normal.js deleted file mode 100644 index f9a411d9d85..00000000000 --- a/crates/swc/tests/tsc-references/parserTryStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserTryStatement1.d.ts] -try {} catch (e) {} diff --git a/crates/swc/tests/tsc-references/parserTryStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserTryStatement1.d.2.minified.js deleted file mode 100644 index a87ce6840df..00000000000 --- a/crates/swc/tests/tsc-references/parserTryStatement1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserTryStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.1.normal.js b/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.1.normal.js deleted file mode 100644 index e2b4108cc48..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeAssertionInObjectCreationExpression1.ts] -//! -//! x Expression expected -//! ,---- -//! 1 | new Foo() -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.2.minified.js b/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.2.minified.js deleted file mode 100644 index e2b4108cc48..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeAssertionInObjectCreationExpression1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeAssertionInObjectCreationExpression1.ts] -//! -//! x Expression expected -//! ,---- -//! 1 | new Foo() -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserTypeQuery3.1.normal.js b/crates/swc/tests/tsc-references/parserTypeQuery3.1.normal.js deleted file mode 100644 index a51b5367b5d..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeQuery3.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeQuery3.ts] -//! -//! x Expected an identifier -//! ,---- -//! 1 | var v: typeof A. -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserTypeQuery3.2.minified.js b/crates/swc/tests/tsc-references/parserTypeQuery3.2.minified.js deleted file mode 100644 index a51b5367b5d..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeQuery3.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeQuery3.ts] -//! -//! x Expected an identifier -//! ,---- -//! 1 | var v: typeof A. -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserTypeQuery4.1.normal.js b/crates/swc/tests/tsc-references/parserTypeQuery4.1.normal.js deleted file mode 100644 index 45118a4a9e2..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeQuery4.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeQuery4.ts] -//! -//! x Expected an identifier -//! ,---- -//! 1 | var v: typeof A.; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserTypeQuery4.2.minified.js b/crates/swc/tests/tsc-references/parserTypeQuery4.2.minified.js deleted file mode 100644 index 45118a4a9e2..00000000000 --- a/crates/swc/tests/tsc-references/parserTypeQuery4.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserTypeQuery4.ts] -//! -//! x Expected an identifier -//! ,---- -//! 1 | var v: typeof A.; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression5.1.normal.js b/crates/swc/tests/tsc-references/parserUnaryExpression5.1.normal.js deleted file mode 100644 index 453218ce030..00000000000 --- a/crates/swc/tests/tsc-references/parserUnaryExpression5.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserUnaryExpression5.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,---- -//! 1 | ++ delete foo.bar -//! : ^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserUnaryExpression5.2.minified.js b/crates/swc/tests/tsc-references/parserUnaryExpression5.2.minified.js deleted file mode 100644 index 453218ce030..00000000000 --- a/crates/swc/tests/tsc-references/parserUnaryExpression5.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserUnaryExpression5.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,---- -//! 1 | ++ delete foo.bar -//! : ^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration10.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration10.1.normal.js deleted file mode 100644 index 438bb3c81a5..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration10.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration10.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var a,; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration10.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration10.2.minified.js deleted file mode 100644 index 438bb3c81a5..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration10.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration10.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var a,; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration4.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration4.1.normal.js deleted file mode 100644 index a3a1af61212..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration4.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserVariableDeclaration4.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare var v; -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration4.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration4.2.minified.js deleted file mode 100644 index a3a1af61212..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration4.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parserVariableDeclaration4.ts] -//! -//! x `declare` modifier not allowed for code already in an ambient context -//! ,-[1:1] -//! 1 | declare module M { -//! 2 | declare var v; -//! : ^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration5.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration5.1.normal.js deleted file mode 100644 index 00b94cc9df1..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration5.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration5.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var a, -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration5.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration5.2.minified.js deleted file mode 100644 index 00b94cc9df1..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration5.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration5.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var a, -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration6.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration6.1.normal.js deleted file mode 100644 index 5fc5ff14e9d..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration6.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration6.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration6.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration6.2.minified.js deleted file mode 100644 index 5fc5ff14e9d..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration6.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration6.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration8.1.normal.js b/crates/swc/tests/tsc-references/parserVariableDeclaration8.1.normal.js deleted file mode 100644 index 58247b8e92c..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration8.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration8.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableDeclaration8.2.minified.js b/crates/swc/tests/tsc-references/parserVariableDeclaration8.2.minified.js deleted file mode 100644 index 58247b8e92c..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableDeclaration8.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserVariableDeclaration8.ts] -//! -//! x Trailing comma is not allowed -//! ,---- -//! 1 | var ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parserVariableStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserVariableStatement1.d.1.normal.js deleted file mode 100644 index f64e0490649..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserVariableStatement1.d.ts] -var v = 1; diff --git a/crates/swc/tests/tsc-references/parserVariableStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserVariableStatement1.d.2.minified.js deleted file mode 100644 index fa57189c2e5..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableStatement1.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserVariableStatement1.d.ts] diff --git a/crates/swc/tests/tsc-references/parserVariableStatement2.d.1.normal.js b/crates/swc/tests/tsc-references/parserVariableStatement2.d.1.normal.js deleted file mode 100644 index c7e91b4d6f3..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableStatement2.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserVariableStatement2.d.ts] -var v; diff --git a/crates/swc/tests/tsc-references/parserVariableStatement2.d.2.minified.js b/crates/swc/tests/tsc-references/parserVariableStatement2.d.2.minified.js deleted file mode 100644 index 524ce031b5f..00000000000 --- a/crates/swc/tests/tsc-references/parserVariableStatement2.d.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [parserVariableStatement2.d.ts] diff --git a/crates/swc/tests/tsc-references/parserWhileStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserWhileStatement1.d.1.normal.js deleted file mode 100644 index 80170ecc291..00000000000 --- a/crates/swc/tests/tsc-references/parserWhileStatement1.d.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserWhileStatement1.d.ts] -while(e){} diff --git a/crates/swc/tests/tsc-references/parserWhileStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserWhileStatement1.d.2.minified.js deleted file mode 100644 index 5c13415d914..00000000000 --- a/crates/swc/tests/tsc-references/parserWhileStatement1.d.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [parserWhileStatement1.d.ts] -for(; e;); diff --git a/crates/swc/tests/tsc-references/parserWithStatement1.d.1.normal.js b/crates/swc/tests/tsc-references/parserWithStatement1.d.1.normal.js deleted file mode 100644 index 5d3595c29a9..00000000000 --- a/crates/swc/tests/tsc-references/parserWithStatement1.d.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserWithStatement1.d.ts] -//! -//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -//! ,-[1:1] -//! 1 | with (foo) { -//! : ^^^^ -//! 2 | } -//! `---- -//! -//! x With statement are not allowed in strict mode -//! ,-[1:1] -//! 1 | with (foo) { -//! : ^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parserWithStatement1.d.2.minified.js b/crates/swc/tests/tsc-references/parserWithStatement1.d.2.minified.js deleted file mode 100644 index 5d3595c29a9..00000000000 --- a/crates/swc/tests/tsc-references/parserWithStatement1.d.2.minified.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [parserWithStatement1.d.ts] -//! -//! x The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -//! ,-[1:1] -//! 1 | with (foo) { -//! : ^^^^ -//! 2 | } -//! `---- -//! -//! x With statement are not allowed in strict mode -//! ,-[1:1] -//! 1 | with (foo) { -//! : ^^^^ -//! 2 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.1.normal.js b/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.1.normal.js deleted file mode 100644 index 2f7635ba6dd..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser_breakNotInIterationOrSwitchStatement1.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,---- -//! 1 | break; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.2.minified.js b/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.2.minified.js deleted file mode 100644 index 2f7635ba6dd..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser_breakNotInIterationOrSwitchStatement1.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,---- -//! 1 | break; -//! : ^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.1.normal.js b/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.1.normal.js deleted file mode 100644 index 81fcf09790a..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser_breakNotInIterationOrSwitchStatement2.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | function f() { -//! 3 | break; -//! : ^^^^^^ -//! 4 | } -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.2.minified.js b/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.2.minified.js deleted file mode 100644 index 81fcf09790a..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakNotInIterationOrSwitchStatement2.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser_breakNotInIterationOrSwitchStatement2.ts] -//! -//! x A 'break' statement can only be used within an enclosing iteration or switch statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | function f() { -//! 3 | break; -//! : ^^^^^^ -//! 4 | } -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakTarget5.1.normal.js b/crates/swc/tests/tsc-references/parser_breakTarget5.1.normal.js deleted file mode 100644 index 05d2a48b57b..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakTarget5.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser_breakTarget5.ts] -//! -//! x A 'break' statement can only jump to a label of an enclosing statement -//! ,-[2:1] -//! 2 | while (true) { -//! 3 | function f() { -//! 4 | while (true) { -//! 5 | break target; -//! : ^^^^^^^^^^^^^ -//! 6 | } -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakTarget5.2.minified.js b/crates/swc/tests/tsc-references/parser_breakTarget5.2.minified.js deleted file mode 100644 index 05d2a48b57b..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakTarget5.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser_breakTarget5.ts] -//! -//! x A 'break' statement can only jump to a label of an enclosing statement -//! ,-[2:1] -//! 2 | while (true) { -//! 3 | function f() { -//! 4 | while (true) { -//! 5 | break target; -//! : ^^^^^^^^^^^^^ -//! 6 | } -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakTarget6.1.normal.js b/crates/swc/tests/tsc-references/parser_breakTarget6.1.normal.js deleted file mode 100644 index 46588ce14bc..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakTarget6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser_breakTarget6.ts] -//! -//! x A 'break' statement can only jump to a label of an enclosing statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | break target; -//! : ^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_breakTarget6.2.minified.js b/crates/swc/tests/tsc-references/parser_breakTarget6.2.minified.js deleted file mode 100644 index 46588ce14bc..00000000000 --- a/crates/swc/tests/tsc-references/parser_breakTarget6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser_breakTarget6.ts] -//! -//! x A 'break' statement can only jump to a label of an enclosing statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | break target; -//! : ^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.1.normal.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.1.normal.js deleted file mode 100644 index 9e919b93a4d..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser_continueNotInIterationStatement1.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,---- -//! 1 | continue; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.2.minified.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.2.minified.js deleted file mode 100644 index 9e919b93a4d..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parser_continueNotInIterationStatement1.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,---- -//! 1 | continue; -//! : ^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.1.normal.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.1.normal.js deleted file mode 100644 index f6f5b1fa542..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser_continueNotInIterationStatement2.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | function f() { -//! 3 | continue; -//! : ^^^^^^^^^ -//! 4 | } -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.2.minified.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.2.minified.js deleted file mode 100644 index f6f5b1fa542..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement2.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [parser_continueNotInIterationStatement2.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | function f() { -//! 3 | continue; -//! : ^^^^^^^^^ -//! 4 | } -//! 5 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.1.normal.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.1.normal.js deleted file mode 100644 index 23e47d0428c..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser_continueNotInIterationStatement3.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | switch (0) { -//! 2 | default: -//! 3 | continue; -//! : ^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.2.minified.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.2.minified.js deleted file mode 100644 index 23e47d0428c..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement3.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser_continueNotInIterationStatement3.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | switch (0) { -//! 2 | default: -//! 3 | continue; -//! : ^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.1.normal.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.1.normal.js deleted file mode 100644 index 866d22990c8..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parser_continueNotInIterationStatement4.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | TWO: -//! 2 | while (true){ -//! 3 | var x = () => { -//! 4 | continue TWO; -//! : ^^^^^^^^^^^^^ -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.2.minified.js b/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.2.minified.js deleted file mode 100644 index 866d22990c8..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueNotInIterationStatement4.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parser_continueNotInIterationStatement4.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | TWO: -//! 2 | while (true){ -//! 3 | var x = () => { -//! 4 | continue TWO; -//! : ^^^^^^^^^^^^^ -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget1.1.normal.js b/crates/swc/tests/tsc-references/parser_continueTarget1.1.normal.js deleted file mode 100644 index a6ae737064a..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget1.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parser_continueTarget1.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | target: -//! 2 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget1.2.minified.js b/crates/swc/tests/tsc-references/parser_continueTarget1.2.minified.js deleted file mode 100644 index a6ae737064a..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget1.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parser_continueTarget1.ts] -//! -//! x A 'continue' statement can only jump to a label of an enclosing iteration statement -//! ,-[1:1] -//! 1 | target: -//! 2 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget5.1.normal.js b/crates/swc/tests/tsc-references/parser_continueTarget5.1.normal.js deleted file mode 100644 index aa3fa370f46..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget5.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser_continueTarget5.ts] -//! -//! x Jump target cannot cross function boundary -//! ,-[2:1] -//! 2 | while (true) { -//! 3 | function f() { -//! 4 | while (true) { -//! 5 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! 6 | } -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget5.2.minified.js b/crates/swc/tests/tsc-references/parser_continueTarget5.2.minified.js deleted file mode 100644 index aa3fa370f46..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget5.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [parser_continueTarget5.ts] -//! -//! x Jump target cannot cross function boundary -//! ,-[2:1] -//! 2 | while (true) { -//! 3 | function f() { -//! 4 | while (true) { -//! 5 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! 6 | } -//! 7 | } -//! 8 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget6.1.normal.js b/crates/swc/tests/tsc-references/parser_continueTarget6.1.normal.js deleted file mode 100644 index b8025768fc1..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget6.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser_continueTarget6.ts] -//! -//! x Jump target cannot cross function boundary -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_continueTarget6.2.minified.js b/crates/swc/tests/tsc-references/parser_continueTarget6.2.minified.js deleted file mode 100644 index b8025768fc1..00000000000 --- a/crates/swc/tests/tsc-references/parser_continueTarget6.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [parser_continueTarget6.ts] -//! -//! x Jump target cannot cross function boundary -//! ,-[1:1] -//! 1 | while (true) { -//! 2 | continue target; -//! : ^^^^^^^^^^^^^^^^ -//! 3 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel1.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel1.1.normal.js deleted file mode 100644 index 23e0084c34e..00000000000 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel1.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser_duplicateLabel1.ts] -//! -//! x Label target is already declared -//! ,-[1:1] -//! 1 | target: -//! 2 | target: -//! : ^^^^^^ -//! 3 | while (true) { -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel1.2.minified.js b/crates/swc/tests/tsc-references/parser_duplicateLabel1.2.minified.js deleted file mode 100644 index 23e0084c34e..00000000000 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel1.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [parser_duplicateLabel1.ts] -//! -//! x Label target is already declared -//! ,-[1:1] -//! 1 | target: -//! 2 | target: -//! : ^^^^^^ -//! 3 | while (true) { -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel2.1.normal.js b/crates/swc/tests/tsc-references/parser_duplicateLabel2.1.normal.js deleted file mode 100644 index 16630a87d70..00000000000 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel2.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parser_duplicateLabel2.ts] -//! -//! x Label target is already declared -//! ,-[1:1] -//! 1 | target: -//! 2 | while (true) { -//! 3 | target: -//! : ^^^^^^ -//! 4 | while (true) { -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parser_duplicateLabel2.2.minified.js b/crates/swc/tests/tsc-references/parser_duplicateLabel2.2.minified.js deleted file mode 100644 index 16630a87d70..00000000000 --- a/crates/swc/tests/tsc-references/parser_duplicateLabel2.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [parser_duplicateLabel2.ts] -//! -//! x Label target is already declared -//! ,-[1:1] -//! 1 | target: -//! 2 | while (true) { -//! 3 | target: -//! : ^^^^^^ -//! 4 | while (true) { -//! 5 | } -//! 6 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/parservoidInQualifiedName1.1.normal.js b/crates/swc/tests/tsc-references/parservoidInQualifiedName1.1.normal.js deleted file mode 100644 index 7265d602599..00000000000 --- a/crates/swc/tests/tsc-references/parservoidInQualifiedName1.1.normal.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parservoidInQualifiedName1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v : void.x; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/parservoidInQualifiedName1.2.minified.js b/crates/swc/tests/tsc-references/parservoidInQualifiedName1.2.minified.js deleted file mode 100644 index 7265d602599..00000000000 --- a/crates/swc/tests/tsc-references/parservoidInQualifiedName1.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parservoidInQualifiedName1.ts] -//! -//! x Expected a semicolon -//! ,---- -//! 1 | var v : void.x; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/plainJSGrammarErrors2.1.normal.js b/crates/swc/tests/tsc-references/plainJSGrammarErrors2.1.normal.js new file mode 100644 index 00000000000..ca0a4ca30b2 --- /dev/null +++ b/crates/swc/tests/tsc-references/plainJSGrammarErrors2.1.normal.js @@ -0,0 +1,7 @@ +//// [plainJSGrammarErrors2.js] +//// [/a.js] +export default 1; +//// [/b.js] +/** + * @deprecated + */ export { default as A } from "./a"; diff --git a/crates/swc/tests/tsc-references/plainJSGrammarErrors2.2.minified.js b/crates/swc/tests/tsc-references/plainJSGrammarErrors2.2.minified.js new file mode 100644 index 00000000000..de0dc046ea2 --- /dev/null +++ b/crates/swc/tests/tsc-references/plainJSGrammarErrors2.2.minified.js @@ -0,0 +1,5 @@ +//// [plainJSGrammarErrors2.js] +//// [/a.js] +export default 1; +//// [/b.js] +export { default as A } from "./a"; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.1.normal.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.1.normal.js deleted file mode 100644 index 4a79c625dbd..00000000000 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.1.normal.js +++ /dev/null @@ -1,64 +0,0 @@ -//// [plusOperatorWithAnyOtherType.ts] -// + operator on any type -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var ANY; -var ANY1; -var ANY2 = [ - "", - "" -]; -var obj; -var obj1 = { - x: function(s) {}, - y: function(s1) {} -}; -function foo() { - var a; - return a; -} -var A = /*#__PURE__*/ function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - A.foo = function foo() { - var a; - return a; - }; - return A; -}(); -var M; -(function(M) { - var n; - M.n = n; -})(M || (M = {})); -var objA = new A(); -// any other type var -var ResultIsNumber1 = +ANY1; -var ResultIsNumber2 = +ANY2; -var ResultIsNumber3 = +A; -var ResultIsNumber4 = +M; -var ResultIsNumber5 = +obj; -var ResultIsNumber6 = +obj1; -// any type literal -var ResultIsNumber7 = +undefined; -var ResultIsNumber8 = +null; -// any type expressions -var ResultIsNumber9 = +ANY2[0]; -var ResultIsNumber10 = +obj1.x; -var ResultIsNumber11 = +obj1.y; -var ResultIsNumber12 = +objA.a; -var ResultIsNumber13 = +M.n; -var ResultIsNumber14 = +foo(); -var ResultIsNumber15 = +A.foo(); -var ResultIsNumber16 = +(ANY + ANY1); -var ResultIsNumber17 = +(null + undefined); -var ResultIsNumber18 = +(null + null); -var ResultIsNumber19 = +(undefined + undefined); -// miss assignment operators -+ANY; -+ANY1; -+ANY2[0]; -+ANY, ANY1; -+objA.a; -+M.n; diff --git a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.2.minified.js b/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.2.minified.js deleted file mode 100644 index 70a82417f4e..00000000000 --- a/crates/swc/tests/tsc-references/plusOperatorWithAnyOtherType.2.minified.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [plusOperatorWithAnyOtherType.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var M, obj1 = { - x: function(s) {}, - y: function(s1) {} -}, A = function() { - "use strict"; - function A() { - _class_call_check(this, A); - } - return A.foo = function() {}, A; -}(); -!function(M) { - var n; - M.n = n; -}(M || (M = {})); -var objA = new A(); -obj1.x, obj1.y, objA.a, M.n, A.foo(), objA.a, M.n; diff --git a/crates/swc/tests/tsc-references/privateIdentifierChain.1.1.normal.js b/crates/swc/tests/tsc-references/privateIdentifierChain.1.1.normal.js deleted file mode 100644 index ebfc6800b39..00000000000 --- a/crates/swc/tests/tsc-references/privateIdentifierChain.1.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [privateIdentifierChain.1.ts] -class A { - #b; - getA() { - return new A(); - } - constructor(){ - this?.#b; // Error - this?.a.#b; // Error - this?.getA().#b; // Error - } -} diff --git a/crates/swc/tests/tsc-references/privateIdentifierChain.1.2.minified.js b/crates/swc/tests/tsc-references/privateIdentifierChain.1.2.minified.js deleted file mode 100644 index b52eef1780e..00000000000 --- a/crates/swc/tests/tsc-references/privateIdentifierChain.1.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [privateIdentifierChain.1.ts] diff --git a/crates/swc/tests/tsc-references/privateNameAndPropertySignature.1.normal.js b/crates/swc/tests/tsc-references/privateNameAndPropertySignature.1.normal.js deleted file mode 100644 index 32f85de6612..00000000000 --- a/crates/swc/tests/tsc-references/privateNameAndPropertySignature.1.normal.js +++ /dev/null @@ -1,101 +0,0 @@ -//// [privateNameAndPropertySignature.ts] -//! -//! x private names are not allowed in interface -//! ,-[1:1] -//! 1 | type A = { -//! 2 | #foo: string; -//! : ^^^^ -//! 3 | #bar(): string; -//! 4 | } -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[1:1] -//! 1 | type A = { -//! 2 | #foo: string; -//! 3 | #bar(): string; -//! : ^^^^ -//! 4 | } -//! 5 | -//! 6 | interface B { -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | interface B { -//! 7 | #foo: string; -//! : ^^^^ -//! 8 | #bar(): string; -//! 9 | } -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[5:1] -//! 5 | -//! 6 | interface B { -//! 7 | #foo: string; -//! 8 | #bar(): string; -//! : ^^^^ -//! 9 | } -//! 10 | -//! 11 | declare const x: { -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[9:1] -//! 9 | } -//! 10 | -//! 11 | declare const x: { -//! 12 | #foo: number; -//! : ^^^^ -//! 13 | bar: { -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[11:1] -//! 11 | declare const x: { -//! 12 | #foo: number; -//! 13 | bar: { -//! 14 | #baz: string; -//! : ^^^^ -//! 15 | #taz(): string; -//! 16 | } -//! 17 | #baz(): string; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[12:1] -//! 12 | #foo: number; -//! 13 | bar: { -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! : ^^^^ -//! 16 | } -//! 17 | #baz(): string; -//! 18 | }; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[14:1] -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! 16 | } -//! 17 | #baz(): string; -//! : ^^^^ -//! 18 | }; -//! 19 | -//! 20 | declare const y: [{ qux: { #quux: 3 } }]; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[17:1] -//! 17 | #baz(): string; -//! 18 | }; -//! 19 | -//! 20 | declare const y: [{ qux: { #quux: 3 } }]; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameAndPropertySignature.2.minified.js b/crates/swc/tests/tsc-references/privateNameAndPropertySignature.2.minified.js deleted file mode 100644 index 32f85de6612..00000000000 --- a/crates/swc/tests/tsc-references/privateNameAndPropertySignature.2.minified.js +++ /dev/null @@ -1,101 +0,0 @@ -//// [privateNameAndPropertySignature.ts] -//! -//! x private names are not allowed in interface -//! ,-[1:1] -//! 1 | type A = { -//! 2 | #foo: string; -//! : ^^^^ -//! 3 | #bar(): string; -//! 4 | } -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[1:1] -//! 1 | type A = { -//! 2 | #foo: string; -//! 3 | #bar(): string; -//! : ^^^^ -//! 4 | } -//! 5 | -//! 6 | interface B { -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[4:1] -//! 4 | } -//! 5 | -//! 6 | interface B { -//! 7 | #foo: string; -//! : ^^^^ -//! 8 | #bar(): string; -//! 9 | } -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[5:1] -//! 5 | -//! 6 | interface B { -//! 7 | #foo: string; -//! 8 | #bar(): string; -//! : ^^^^ -//! 9 | } -//! 10 | -//! 11 | declare const x: { -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[9:1] -//! 9 | } -//! 10 | -//! 11 | declare const x: { -//! 12 | #foo: number; -//! : ^^^^ -//! 13 | bar: { -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[11:1] -//! 11 | declare const x: { -//! 12 | #foo: number; -//! 13 | bar: { -//! 14 | #baz: string; -//! : ^^^^ -//! 15 | #taz(): string; -//! 16 | } -//! 17 | #baz(): string; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[12:1] -//! 12 | #foo: number; -//! 13 | bar: { -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! : ^^^^ -//! 16 | } -//! 17 | #baz(): string; -//! 18 | }; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[14:1] -//! 14 | #baz: string; -//! 15 | #taz(): string; -//! 16 | } -//! 17 | #baz(): string; -//! : ^^^^ -//! 18 | }; -//! 19 | -//! 20 | declare const y: [{ qux: { #quux: 3 } }]; -//! `---- -//! -//! x private names are not allowed in interface -//! ,-[17:1] -//! 17 | #baz(): string; -//! 18 | }; -//! 19 | -//! 20 | declare const y: [{ qux: { #quux: 3 } }]; -//! : ^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameBadSuper.1.normal.js b/crates/swc/tests/tsc-references/privateNameBadSuper.1.normal.js deleted file mode 100644 index 8585fafcc6f..00000000000 --- a/crates/swc/tests/tsc-references/privateNameBadSuper.1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [privateNameBadSuper.ts] -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -class B { -} -var _x = /*#__PURE__*/ new WeakMap(); -class A extends B { - constructor(){ - this; - super(); - _class_private_field_init(this, _x, { - writable: true, - value: void 0 - }); - } -} diff --git a/crates/swc/tests/tsc-references/privateNameBadSuper.2.minified.js b/crates/swc/tests/tsc-references/privateNameBadSuper.2.minified.js deleted file mode 100644 index 96a24024fb8..00000000000 --- a/crates/swc/tests/tsc-references/privateNameBadSuper.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [privateNameBadSuper.ts] -import "@swc/helpers/src/_class_private_field_init.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.1.normal.js b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.1.normal.js deleted file mode 100644 index 492d56a1ff9..00000000000 --- a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [privateNameBadSuperUseDefineForClassFields.ts] -class B { -} -class A extends B { - #x; - constructor(){ - this; - super(); - } -} diff --git a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.2.minified.js b/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.2.minified.js deleted file mode 100644 index 02ee00c533f..00000000000 --- a/crates/swc/tests/tsc-references/privateNameBadSuperUseDefineForClassFields.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [privateNameBadSuperUseDefineForClassFields.ts] diff --git a/crates/swc/tests/tsc-references/privateNameConstructorReserved.1.normal.js b/crates/swc/tests/tsc-references/privateNameConstructorReserved.1.normal.js deleted file mode 100644 index a526505b6b8..00000000000 --- a/crates/swc/tests/tsc-references/privateNameConstructorReserved.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [privateNameConstructorReserved.ts] -//! -//! x Classes can't have a private field named '#constructor'. -//! ,-[1:1] -//! 1 | -//! 2 | class A { -//! 3 | #constructor() {} // Error: `#constructor` is a reserved word. -//! : ^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameConstructorReserved.2.minified.js b/crates/swc/tests/tsc-references/privateNameConstructorReserved.2.minified.js deleted file mode 100644 index a526505b6b8..00000000000 --- a/crates/swc/tests/tsc-references/privateNameConstructorReserved.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [privateNameConstructorReserved.ts] -//! -//! x Classes can't have a private field named '#constructor'. -//! ,-[1:1] -//! 1 | -//! 2 | class A { -//! 3 | #constructor() {} // Error: `#constructor` is a reserved word. -//! : ^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js b/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js deleted file mode 100644 index ce9396a583a..00000000000 --- a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).1.normal.js +++ /dev/null @@ -1,87 +0,0 @@ -//// [privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo, _Inner, _foo1; -var _prop = /*#__PURE__*/ new WeakMap(), _ref; -class TestWithErrors { - constructor(){ - _class_private_field_init(this, _prop, { - writable: true, - value: 0 - }); - } -} -TestWithErrors.dd = _class_private_field_get(_ref = new TestWithErrors(), _prop) // Err -; -TestWithErrors["X_ z_ zz"] = (_foo = /*#__PURE__*/ new WeakMap(), _Inner = class Inner { - m() { - var _ref; - _class_private_field_get(_ref = new TestWithErrors(), _prop // Err - ); - } - static M() { - return class { - m() { - var _ref, _ref1; - _class_private_field_get(_ref = new TestWithErrors(), _prop // Err - ); - _class_private_field_get(_ref1 = new Inner(), _foo); // OK - } - }; - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: true, - value: 10 - }); - } -}, _Inner.C = class InnerInner { - m() { - var _ref, _ref1; - _class_private_field_get(_ref = new TestWithErrors(), _prop // Err - ); - _class_private_field_get(_ref1 = new _Inner(), _foo); // Err - } -}, _Inner); -var _prop1 = /*#__PURE__*/ new WeakMap(), _ref1; -class TestNoErrors { - constructor(){ - _class_private_field_init(this, _prop1, { - writable: true, - value: 0 - }); - this.dd = _class_private_field_get(_ref1 = new TestNoErrors(), _prop1) // OK - ; - this["X_ z_ zz"] = (_foo1 = /*#__PURE__*/ new WeakMap(), class Inner { - m() { - var _ref; - _class_private_field_get(_ref = new TestNoErrors(), _prop1 // Ok - ); - } - static M() { - return class { - m() { - var _ref, _ref1; - _class_private_field_get(_ref = new TestNoErrors(), _prop1 // OK - ); - _class_private_field_get(_ref1 = new Inner(), _foo1); // OK - } - }; - } - constructor(){ - _class_private_field_init(this, _foo1, { - writable: true, - value: 10 - }); - this.C = class InnerInner { - m() { - var _ref, _ref1; - _class_private_field_get(_ref = new TestNoErrors(), _prop1 // Ok - ); - _class_private_field_get(_ref1 = new Inner(), _foo1); // Ok - } - }; - } - }); - } -} diff --git a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).2.minified.js b/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).2.minified.js deleted file mode 100644 index 811c1a2da07..00000000000 --- a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2020).2.minified.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo, _Inner, _prop = new WeakMap(); -class TestWithErrors { - constructor(){ - _class_private_field_init(this, _prop, { - writable: !0, - value: 0 - }); - } -} -TestWithErrors.dd = _class_private_field_get(new TestWithErrors(), _prop), TestWithErrors["X_ z_ zz"] = (_foo = new WeakMap(), (_Inner = class Inner { - m() { - _class_private_field_get(new TestWithErrors(), _prop); - } - static M() { - return class { - m() { - _class_private_field_get(new TestWithErrors(), _prop), _class_private_field_get(new Inner(), _foo); - } - }; - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: !0, - value: 10 - }); - } -}).C = class { - m() { - _class_private_field_get(new TestWithErrors(), _prop), _class_private_field_get(new _Inner(), _foo); - } -}, _Inner); diff --git a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).1.normal.js deleted file mode 100644 index 88803c08801..00000000000 --- a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).1.normal.js +++ /dev/null @@ -1,55 +0,0 @@ -//// [privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts] -class TestWithErrors { - #prop = 0; - static dd = new TestWithErrors().#prop; - static ["X_ z_ zz"] = class Inner { - #foo = 10; - m() { - new TestWithErrors().#prop // Err - ; - } - static C = class InnerInner { - m() { - new TestWithErrors().#prop // Err - ; - new Inner().#foo; // Err - } - }; - static M() { - return class { - m() { - new TestWithErrors().#prop // Err - ; - new Inner().#foo; // OK - } - }; - } - }; -} -class TestNoErrors { - #prop = 0; - dd = new TestNoErrors().#prop; - ["X_ z_ zz"] = class Inner { - #foo = 10; - m() { - new TestNoErrors().#prop // Ok - ; - } - C = class InnerInner { - m() { - new TestNoErrors().#prop // Ok - ; - new Inner().#foo; // Ok - } - }; - static M() { - return class { - m() { - new TestNoErrors().#prop // OK - ; - new Inner().#foo; // OK - } - }; - } - }; -} diff --git a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).2.minified.js deleted file mode 100644 index 39f2cab813b..00000000000 --- a/crates/swc/tests/tsc-references/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext(target=es2022).2.minified.js +++ /dev/null @@ -1,45 +0,0 @@ -//// [privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts] -class TestWithErrors { - #prop = 0; - static dd = new TestWithErrors().#prop; - static "X_ z_ zz" = class Inner { - #foo = 10; - m() { - new TestWithErrors().#prop; - } - static C = class { - m() { - new TestWithErrors().#prop, new Inner().#foo; - } - }; - static M() { - return class { - m() { - new TestWithErrors().#prop, new Inner().#foo; - } - }; - } - }; -} -class TestNoErrors { - #prop = 0; - dd = new TestNoErrors().#prop; - "X_ z_ zz" = class Inner { - #foo = 10; - m() { - new TestNoErrors().#prop; - } - C = class { - m() { - new TestNoErrors().#prop, new Inner().#foo; - } - }; - static M() { - return class { - m() { - new TestNoErrors().#prop, new Inner().#foo; - } - }; - } - }; -} diff --git a/crates/swc/tests/tsc-references/privateNameInInExpression.1.normal.js b/crates/swc/tests/tsc-references/privateNameInInExpression.1.normal.js deleted file mode 100644 index a5ece64d908..00000000000 --- a/crates/swc/tests/tsc-references/privateNameInInExpression.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [privateNameInInExpression.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[25:1] -//! 25 | -//! 26 | const c = (#field) in v; // Bad - privateID is not an expression on its own -//! 27 | -//! 28 | for (#field in v) { /**/ } // Bad - 'in' not allowed -//! : ^^^^^^ -//! 29 | -//! 30 | for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any -//! 31 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameInInExpression.2.minified.js b/crates/swc/tests/tsc-references/privateNameInInExpression.2.minified.js deleted file mode 100644 index a5ece64d908..00000000000 --- a/crates/swc/tests/tsc-references/privateNameInInExpression.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [privateNameInInExpression.ts] -//! -//! x The left-hand side of an assignment expression must be a variable or a property access. -//! ,-[25:1] -//! 25 | -//! 26 | const c = (#field) in v; // Bad - privateID is not an expression on its own -//! 27 | -//! 28 | for (#field in v) { /**/ } // Bad - 'in' not allowed -//! : ^^^^^^ -//! 29 | -//! 30 | for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any -//! 31 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameMethodClassExpression.1.normal.js b/crates/swc/tests/tsc-references/privateNameMethodClassExpression.1.normal.js deleted file mode 100644 index 3a332d73be6..00000000000 --- a/crates/swc/tests/tsc-references/privateNameMethodClassExpression.1.normal.js +++ /dev/null @@ -1,27 +0,0 @@ -//// [privateNameMethodClassExpression.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -var _field, _method, _class; -const C = (_field = /*#__PURE__*/ new WeakMap(), _method = /*#__PURE__*/ new WeakSet(), _class = class { - static getInstance() { - return new C(); - } - getField() { - return _class_private_field_get(this, _field); - } - constructor(){ - _class_private_method_init(this, _method); - _class_private_field_init(this, _field, { - writable: true, - value: _class_private_method_get(this, _method, method).call(this) - }); - } -}, _class); -console.log(C.getInstance().getField()); -C.getInstance().#method; // Error -C.getInstance().#field; // Error -function method() { - return 42; -} diff --git a/crates/swc/tests/tsc-references/privateNameMethodClassExpression.2.minified.js b/crates/swc/tests/tsc-references/privateNameMethodClassExpression.2.minified.js deleted file mode 100644 index 712854a58d7..00000000000 --- a/crates/swc/tests/tsc-references/privateNameMethodClassExpression.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [privateNameMethodClassExpression.ts] -var _field, _method; -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -let C = (_field = new WeakMap(), _method = new WeakSet(), class { - static getInstance() { - return new C(); - } - getField() { - return _class_private_field_get(this, _field); - } - constructor(){ - _class_private_method_init(this, _method), _class_private_field_init(this, _field, { - writable: !0, - value: _class_private_method_get(this, _method, method).call(this) - }); - } -}); -function method() { - return 42; -} -console.log(C.getInstance().getField()), C.getInstance().#method, C.getInstance().#field; diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.1.normal.js b/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.1.normal.js deleted file mode 100644 index 88db556eae2..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.1.normal.js +++ /dev/null @@ -1,33 +0,0 @@ -//// [privateNameNestedClassAccessorsShadowing.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _x = /*#__PURE__*/ new WeakMap(); -class Base { - constructor(){ - _class_private_field_init(this, _x, { - get: get_x, - set: void 0 - }); - var _x1 = /*#__PURE__*/ new WeakMap(); - class Derived { - testBase(x) { - console.log(_class_private_field_get(x, _x1)); - } - testDerived(x) { - console.log(_class_private_field_get(x, _x1)); - } - constructor(){ - _class_private_field_init(this, _x1, { - get: get_x1, - set: void 0 - }); - } - } - function get_x1() { - return 1; - } - } -} -function get_x() { - return 1; -} diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.2.minified.js b/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.2.minified.js deleted file mode 100644 index 07880525dca..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassAccessorsShadowing.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNameNestedClassAccessorsShadowing.ts] -import "@swc/helpers/src/_class_private_field_get.mjs"; -import "@swc/helpers/src/_class_private_field_init.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.1.normal.js b/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.1.normal.js deleted file mode 100644 index cfa504f7757..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.1.normal.js +++ /dev/null @@ -1,27 +0,0 @@ -//// [privateNameNestedClassFieldShadowing.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _x = /*#__PURE__*/ new WeakMap(); -class Base { - constructor(){ - _class_private_field_init(this, _x, { - writable: true, - value: void 0 - }); - var _x1 = /*#__PURE__*/ new WeakMap(); - class Derived { - testBase(x) { - console.log(_class_private_field_get(x, _x1)); - } - testDerived(x) { - console.log(_class_private_field_get(x, _x1)); - } - constructor(){ - _class_private_field_init(this, _x1, { - writable: true, - value: void 0 - }); - } - } - } -} diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.2.minified.js b/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.2.minified.js deleted file mode 100644 index 45b18e689ac..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassFieldShadowing.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNameNestedClassFieldShadowing.ts] -import "@swc/helpers/src/_class_private_field_get.mjs"; -import "@swc/helpers/src/_class_private_field_init.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.1.normal.js b/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.1.normal.js deleted file mode 100644 index 9418d8b27a8..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.1.normal.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [privateNameNestedClassMethodShadowing.ts] -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -var _x = /*#__PURE__*/ new WeakSet(); -class Base { - constructor(){ - _class_private_method_init(this, _x); - var _x1 = /*#__PURE__*/ new WeakSet(); - class Derived { - testBase(x1) { - console.log(_class_private_method_get(x1, _x1, x)); - } - testDerived(x1) { - console.log(_class_private_method_get(x1, _x1, x)); - } - constructor(){ - _class_private_method_init(this, _x1); - } - } - function x() {} - } -} -function x() {} diff --git a/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.2.minified.js b/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.2.minified.js deleted file mode 100644 index 451e3308c31..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNestedClassMethodShadowing.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNameNestedClassMethodShadowing.ts] -import "@swc/helpers/src/_class_private_method_get.mjs"; -import "@swc/helpers/src/_class_private_method_init.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.1.normal.js b/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.1.normal.js deleted file mode 100644 index 16ef892b2ca..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [privateNameNotAccessibleOutsideDefiningClass.ts] -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo = /*#__PURE__*/ new WeakMap(); -class A { - constructor(){ - _class_private_field_init(this, _foo, { - writable: true, - value: 3 - }); - } -} -new A().#foo = 4; // Error diff --git a/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.2.minified.js b/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.2.minified.js deleted file mode 100644 index 369b03222b6..00000000000 --- a/crates/swc/tests/tsc-references/privateNameNotAccessibleOutsideDefiningClass.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [privateNameNotAccessibleOutsideDefiningClass.ts] -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo = new WeakMap(); -new class { - constructor(){ - _class_private_field_init(this, _foo, { - writable: !0, - value: 3 - }); - } -}().#foo = 4; diff --git a/crates/swc/tests/tsc-references/privateNameStaticAccessorssDerivedClasses.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticAccessorssDerivedClasses.1.normal.js new file mode 100644 index 00000000000..9dbfbf43b49 --- /dev/null +++ b/crates/swc/tests/tsc-references/privateNameStaticAccessorssDerivedClasses.1.normal.js @@ -0,0 +1,12 @@ +//// [privateNameStaticAccessorssDerivedClasses.ts] +//! +//! x private name #prop is not defined. +//! ,-[7:1] +//! 7 | } +//! 8 | class Derived extends Base { +//! 9 | static method(x: typeof Derived) { +//! 10 | console.log(x.#prop); +//! : ^^^^ +//! 11 | } +//! 12 | } +//! `---- diff --git a/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.1.normal.js b/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.1.normal.js deleted file mode 100644 index 97cfda873a8..00000000000 --- a/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.1.normal.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [privateNameStaticMethodClassExpression.ts] -import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs"; -import _class_static_private_method_get from "@swc/helpers/src/_class_static_private_method_get.mjs"; -var _D, _field; -const C = (_D = class D { - static getClass() { - return D; - } - static getField() { - return _class_static_private_field_spec_get(C, _D, _field); - } -}, _field = { - writable: true, - value: _class_static_private_method_get(_D, _D, method).call(_D) -}, _D); -console.log(C.getClass().getField()); -C.getClass().#method; // Error -C.getClass().#field; // Error -function method() { - return 42; -} diff --git a/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.2.minified.js b/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.2.minified.js deleted file mode 100644 index bedbfce5a4e..00000000000 --- a/crates/swc/tests/tsc-references/privateNameStaticMethodClassExpression.2.minified.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [privateNameStaticMethodClassExpression.ts] -var _D, _field; -import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs"; -import _class_static_private_method_get from "@swc/helpers/src/_class_static_private_method_get.mjs"; -let C = (_field = { - writable: !0, - value: _class_static_private_method_get(_D = class D { - static getClass() { - return D; - } - static getField() { - return _class_static_private_field_spec_get(C, _D, _field); - } - }, _D, function() { - return 42; - }).call(_D) -}, _D); -console.log(C.getClass().getField()), C.getClass().#method, C.getClass().#field; diff --git a/crates/swc/tests/tsc-references/privateNamesAndDecorators.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndDecorators.1.normal.js deleted file mode 100644 index 5ee81ba8f2c..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndDecorators.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [privateNamesAndDecorators.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | declare function dec(target: T): T; -//! 2 | -//! 3 | class A { -//! 4 | @dec // Error -//! : ^ -//! 5 | #foo = 1; -//! 6 | @dec // Error -//! 7 | #bar(): void { } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNamesAndDecorators.2.minified.js b/crates/swc/tests/tsc-references/privateNamesAndDecorators.2.minified.js deleted file mode 100644 index 5ee81ba8f2c..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndDecorators.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [privateNamesAndDecorators.ts] -//! -//! x Unexpected token `@`. Expected identifier, string literal, numeric literal or [ for the computed key -//! ,-[1:1] -//! 1 | declare function dec(target: T): T; -//! 2 | -//! 3 | class A { -//! 4 | @dec // Error -//! : ^ -//! 5 | #foo = 1; -//! 6 | @dec // Error -//! 7 | #bar(): void { } -//! `---- diff --git a/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.1.normal.js deleted file mode 100644 index a7536716c72..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.1.normal.js +++ /dev/null @@ -1,36 +0,0 @@ -//// [privateNamesAndGenericClasses-2.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_field_set from "@swc/helpers/src/_class_private_field_set.mjs"; -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -var _foo = /*#__PURE__*/ new WeakMap(), _bar = /*#__PURE__*/ new WeakSet(); -class C { - set baz(t) { - _class_private_field_set(this, _foo, t); - } - get baz() { - return _class_private_field_get(this, _foo); - } - constructor(t){ - _class_private_method_init(this, _bar); - _class_private_field_init(this, _foo, { - writable: true, - value: void 0 - }); - _class_private_field_set(this, _foo, t); - t = _class_private_method_get(this, _bar, bar).call(this); - } -} -function bar() { - return _class_private_field_get(this, _foo); -} -let a = new C(3); -let b = new C("hello"); -a.baz = 5 // OK -; -const x = a.baz // OK -; -a.#foo; // Error -a = b; // Error -b = a; // Error diff --git a/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.2.minified.js b/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.2.minified.js deleted file mode 100644 index 6adf3fd2088..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndGenericClasses-2.2.minified.js +++ /dev/null @@ -1,26 +0,0 @@ -//// [privateNamesAndGenericClasses-2.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_field_set from "@swc/helpers/src/_class_private_field_set.mjs"; -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -var _foo = new WeakMap(), _bar = new WeakSet(); -class C { - set baz(t) { - _class_private_field_set(this, _foo, t); - } - get baz() { - return _class_private_field_get(this, _foo); - } - constructor(t){ - _class_private_method_init(this, _bar), _class_private_field_init(this, _foo, { - writable: !0, - value: void 0 - }), _class_private_field_set(this, _foo, t), t = _class_private_method_get(this, _bar, bar).call(this); - } -} -function bar() { - return _class_private_field_get(this, _foo); -} -let a = new C(3), b = new C("hello"); -a.baz = 5, a.baz, a.#foo, b = a = b; diff --git a/crates/swc/tests/tsc-references/privateNamesAndStaticFields.1.normal.js b/crates/swc/tests/tsc-references/privateNamesAndStaticFields.1.normal.js deleted file mode 100644 index 9a6c90f249d..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndStaticFields.1.normal.js +++ /dev/null @@ -1,32 +0,0 @@ -//// [privateNamesAndStaticFields.ts] -import _class_static_private_field_spec_get from "@swc/helpers/src/_class_static_private_field_spec_get.mjs"; -import _class_static_private_field_spec_set from "@swc/helpers/src/_class_static_private_field_spec_set.mjs"; -class A { - constructor(){ - _class_static_private_field_spec_set(A, A, _foo, 3); - _class_static_private_field_spec_get(B, A, _foo); // Error - _class_static_private_field_spec_get(B, A, _bar); // Error - } -} -var _foo = { - writable: true, - value: void 0 -}; -var _bar = { - writable: true, - value: void 0 -}; -class B extends A { - constructor(){ - super(); - _class_static_private_field_spec_set(B, B, _foo1, "some string"); - } -} -var _foo1 = { - writable: true, - value: void 0 -}; -// We currently filter out static private identifier fields in `getUnmatchedProperties`. -// We will need a more robust solution when we support static fields -const willErrorSomeDay = class { -}; // OK for now diff --git a/crates/swc/tests/tsc-references/privateNamesAndStaticFields.2.minified.js b/crates/swc/tests/tsc-references/privateNamesAndStaticFields.2.minified.js deleted file mode 100644 index 01ba28a76bd..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesAndStaticFields.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNamesAndStaticFields.ts] -import "@swc/helpers/src/_class_static_private_field_spec_get.mjs"; -import "@swc/helpers/src/_class_static_private_field_spec_set.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNamesInGenericClasses.1.normal.js b/crates/swc/tests/tsc-references/privateNamesInGenericClasses.1.normal.js deleted file mode 100644 index be56f4a0641..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInGenericClasses.1.normal.js +++ /dev/null @@ -1,61 +0,0 @@ -//// [privateNamesInGenericClasses.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_field_set from "@swc/helpers/src/_class_private_field_set.mjs"; -import _class_private_method_get from "@swc/helpers/src/_class_private_method_get.mjs"; -import _class_private_method_init from "@swc/helpers/src/_class_private_method_init.mjs"; -var _foo = /*#__PURE__*/ new WeakMap(), _method = /*#__PURE__*/ new WeakSet(), _prop = /*#__PURE__*/ new WeakMap(); -class C { - bar(x) { - return _class_private_field_get(x, _foo); - } - bar2(x) { - return _class_private_method_get(x, _method, method).call(x); - } - bar3(x) { - return _class_private_field_get(x, _prop); - } - baz(x) { - return _class_private_field_get(x, _foo); - } - baz2(x) { - return _class_private_method_get(x, _method, method); - } - baz3(x) { - return _class_private_field_get(x, _prop); - } - quux(x) { - return _class_private_field_get(x, _foo); - } - quux2(x) { - return _class_private_method_get(x, _method, method); - } - quux3(x) { - return _class_private_field_get(x, _prop); - } - constructor(){ - _class_private_method_init(this, _method); - _class_private_field_init(this, _prop, { - get: get_prop, - set: set_prop - }); - _class_private_field_init(this, _foo, { - writable: true, - value: void 0 - }); - } -} -function method() { - return _class_private_field_get(this, _foo); -} -function get_prop() { - return _class_private_field_get(this, _foo); -} -function set_prop(value) { - _class_private_field_set(this, _foo, value); -} -a.#foo; // Error -a.#method; // Error -a.#prop; // Error -a = b; // Error -b = a; // Error diff --git a/crates/swc/tests/tsc-references/privateNamesInGenericClasses.2.minified.js b/crates/swc/tests/tsc-references/privateNamesInGenericClasses.2.minified.js deleted file mode 100644 index 144dacea1ff..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInGenericClasses.2.minified.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [privateNamesInGenericClasses.ts] -import "@swc/helpers/src/_class_private_field_get.mjs"; -import "@swc/helpers/src/_class_private_field_init.mjs"; -import "@swc/helpers/src/_class_private_field_set.mjs"; -import "@swc/helpers/src/_class_private_method_get.mjs"; -import "@swc/helpers/src/_class_private_method_init.mjs"; -a.#foo, a.#method, a.#prop, b = a = b; diff --git a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.1.normal.js b/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.1.normal.js deleted file mode 100644 index 0d79580efa8..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [privateNamesInNestedClasses-1.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo = /*#__PURE__*/ new WeakMap(), _bar = /*#__PURE__*/ new WeakMap(); -class A { - method() { - var _foo = /*#__PURE__*/ new WeakMap(); - class B { - bar(a) { - _class_private_field_get(a, _foo); // OK, no compile-time error, don't know what `a` is - } - baz(a) { - _class_private_field_get(a, _foo); // compile-time error, shadowed - } - quux(b) { - _class_private_field_get(b, _foo); // OK - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: true, - value: "B's #foo" - }); - } - } - const a = new A(); - new B().bar(a); - new B().baz(a); - const b = new B(); - new B().quux(b); - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: true, - value: "A's #foo" - }); - _class_private_field_init(this, _bar, { - writable: true, - value: "A's #bar" - }); - } -} -new A().method(); diff --git a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.2.minified.js b/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.2.minified.js deleted file mode 100644 index bd49bda20f5..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-1.2.minified.js +++ /dev/null @@ -1,40 +0,0 @@ -//// [privateNamesInNestedClasses-1.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _foo = new WeakMap(), _bar = new WeakMap(); -class A { - method() { - var _foo = new WeakMap(); - class B { - bar(a) { - _class_private_field_get(a, _foo); - } - baz(a) { - _class_private_field_get(a, _foo); - } - quux(b) { - _class_private_field_get(b, _foo); - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: !0, - value: "B's #foo" - }); - } - } - let a = new A(); - new B().bar(a), new B().baz(a); - let b = new B(); - new B().quux(b); - } - constructor(){ - _class_private_field_init(this, _foo, { - writable: !0, - value: "A's #foo" - }), _class_private_field_init(this, _bar, { - writable: !0, - value: "A's #bar" - }); - } -} -new A().method(); diff --git a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.1.normal.js b/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.1.normal.js deleted file mode 100644 index ef90980c4a2..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.1.normal.js +++ /dev/null @@ -1,26 +0,0 @@ -//// [privateNamesInNestedClasses-2.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -class A { - constructor(){ - var _x = /*#__PURE__*/ new WeakMap(); - class B { - constructor(){ - _class_private_field_init(this, _x, { - writable: true, - value: 5 - }); - class C { - constructor(){ - _class_private_field_get(A, _x // error - ); - } - } - } - } - } -} -var _x = { - writable: true, - value: 5 -}; diff --git a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.2.minified.js b/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.2.minified.js deleted file mode 100644 index e9383203575..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInNestedClasses-2.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNamesInNestedClasses-2.ts] -import "@swc/helpers/src/_class_private_field_get.mjs"; -import "@swc/helpers/src/_class_private_field_init.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.1.normal.js b/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.1.normal.js deleted file mode 100644 index 3c8ac02fb80..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.1.normal.js +++ /dev/null @@ -1,18 +0,0 @@ -//// [privateNamesInterfaceExtendingClass.ts] -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -import _class_private_field_set from "@swc/helpers/src/_class_private_field_set.mjs"; -var _prop = /*#__PURE__*/ new WeakMap(); -class C { - func(x) { - _class_private_field_set(x, _prop, 123); - } - constructor(){ - _class_private_field_init(this, _prop, { - writable: true, - value: void 0 - }); - } -} -function func(x) { - x.#prop = 123; -} diff --git a/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.2.minified.js b/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.2.minified.js deleted file mode 100644 index e293d8d3db0..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesInterfaceExtendingClass.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNamesInterfaceExtendingClass.ts] -import "@swc/helpers/src/_class_private_field_init.mjs"; -import "@swc/helpers/src/_class_private_field_set.mjs"; diff --git a/crates/swc/tests/tsc-references/privateNamesNoDelete.1.normal.js b/crates/swc/tests/tsc-references/privateNamesNoDelete.1.normal.js deleted file mode 100644 index e9be0cc1cd2..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesNoDelete.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [privateNamesNoDelete.ts] -import _class_private_field_get from "@swc/helpers/src/_class_private_field_get.mjs"; -import _class_private_field_init from "@swc/helpers/src/_class_private_field_init.mjs"; -var _v = /*#__PURE__*/ new WeakMap(); -class A { - constructor(){ - _class_private_field_init(this, _v, { - writable: true, - value: 1 - }); - delete _class_private_field_get(this, _v); // Error: The operand of a delete operator cannot be a private name. - } -} diff --git a/crates/swc/tests/tsc-references/privateNamesNoDelete.2.minified.js b/crates/swc/tests/tsc-references/privateNamesNoDelete.2.minified.js deleted file mode 100644 index 352de54fd0c..00000000000 --- a/crates/swc/tests/tsc-references/privateNamesNoDelete.2.minified.js +++ /dev/null @@ -1,3 +0,0 @@ -//// [privateNamesNoDelete.ts] -import "@swc/helpers/src/_class_private_field_get.mjs"; -import "@swc/helpers/src/_class_private_field_init.mjs"; diff --git a/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js b/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js new file mode 100644 index 00000000000..fb5658caf54 --- /dev/null +++ b/crates/swc/tests/tsc-references/reExportJsFromTs.1.normal.js @@ -0,0 +1,8 @@ +//// [reExportJsFromTs.ts] +//// [/lib/constants.js] +module.exports = { + str: "x" +}; +//// [/src/constants.ts] +import * as tsConstants from "../lib/constants"; +export { tsConstants }; diff --git a/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js b/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js new file mode 100644 index 00000000000..fb5658caf54 --- /dev/null +++ b/crates/swc/tests/tsc-references/reExportJsFromTs.2.minified.js @@ -0,0 +1,8 @@ +//// [reExportJsFromTs.ts] +//// [/lib/constants.js] +module.exports = { + str: "x" +}; +//// [/src/constants.ts] +import * as tsConstants from "../lib/constants"; +export { tsConstants }; diff --git a/crates/swc/tests/tsc-references/readonlyInConstructorParameters.1.normal.js b/crates/swc/tests/tsc-references/readonlyInConstructorParameters.1.normal.js deleted file mode 100644 index 5562211af93..00000000000 --- a/crates/swc/tests/tsc-references/readonlyInConstructorParameters.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [readonlyInConstructorParameters.ts] -//! -//! x A parameter property is only allowed in a constructor implementation -//! ,-[4:1] -//! 4 | new C(1).x = 2; -//! 5 | -//! 6 | class E { -//! 7 | constructor(readonly public x: number) {} -//! : ^^^^^^^^^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | class F { -//! `---- diff --git a/crates/swc/tests/tsc-references/readonlyInConstructorParameters.2.minified.js b/crates/swc/tests/tsc-references/readonlyInConstructorParameters.2.minified.js deleted file mode 100644 index 5562211af93..00000000000 --- a/crates/swc/tests/tsc-references/readonlyInConstructorParameters.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [readonlyInConstructorParameters.ts] -//! -//! x A parameter property is only allowed in a constructor implementation -//! ,-[4:1] -//! 4 | new C(1).x = 2; -//! 5 | -//! 6 | class E { -//! 7 | constructor(readonly public x: number) {} -//! : ^^^^^^^^^^^^^^^^ -//! 8 | } -//! 9 | -//! 10 | class F { -//! `---- diff --git a/crates/swc/tests/tsc-references/readonlyReadonly.1.normal.js b/crates/swc/tests/tsc-references/readonlyReadonly.1.normal.js deleted file mode 100644 index c098ee84369..00000000000 --- a/crates/swc/tests/tsc-references/readonlyReadonly.1.normal.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [readonlyReadonly.ts] -//! -//! x 'readonly' modifier already seen. -//! ,-[1:1] -//! 1 | class C { -//! 2 | readonly readonly x: number; -//! : ^^^^^^^^ -//! 3 | constructor(readonly readonly y: number) {} -//! 4 | } -//! `---- -//! -//! x A parameter property is only allowed in a constructor implementation -//! ,-[1:1] -//! 1 | class C { -//! 2 | readonly readonly x: number; -//! 3 | constructor(readonly readonly y: number) {} -//! : ^^^^^^^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/readonlyReadonly.2.minified.js b/crates/swc/tests/tsc-references/readonlyReadonly.2.minified.js deleted file mode 100644 index c098ee84369..00000000000 --- a/crates/swc/tests/tsc-references/readonlyReadonly.2.minified.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [readonlyReadonly.ts] -//! -//! x 'readonly' modifier already seen. -//! ,-[1:1] -//! 1 | class C { -//! 2 | readonly readonly x: number; -//! : ^^^^^^^^ -//! 3 | constructor(readonly readonly y: number) {} -//! 4 | } -//! `---- -//! -//! x A parameter property is only allowed in a constructor implementation -//! ,-[1:1] -//! 1 | class C { -//! 2 | readonly readonly x: number; -//! 3 | constructor(readonly readonly y: number) {} -//! : ^^^^^^^^^^^^^^^^^^ -//! 4 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js new file mode 100644 index 00000000000..4a8abb84e1a --- /dev/null +++ b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.1.normal.js @@ -0,0 +1,18 @@ +//// [ex.d.ts] +// based on assert in @types/node +export { }; +//// [ex2.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare function art(value: any, message?: string | Error): asserts value; +//! 2 | export = art; +//! : ^^^^^^^^^^^^^ +//! `---- +//// [38379.js] +var art = require("./ex").art; +var artoo = require("./ex2"); +var x = 1; +art(x); +var y = 1; +artoo(y); diff --git a/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js new file mode 100644 index 00000000000..105b70dacbb --- /dev/null +++ b/crates/swc/tests/tsc-references/requireAssertsFromTypescript.2.minified.js @@ -0,0 +1,13 @@ +//// [ex.d.ts] +export { }; +//// [ex2.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare function art(value: any, message?: string | Error): asserts value; +//! 2 | export = art; +//! : ^^^^^^^^^^^^^ +//! `---- +//// [38379.js] +var art = require("./ex").art, artoo = require("./ex2"); +art(1), artoo(1); diff --git a/crates/swc/tests/tsc-references/restElementWithInitializer2.1.normal.js b/crates/swc/tests/tsc-references/restElementWithInitializer2.1.normal.js deleted file mode 100644 index 7e5b51b5800..00000000000 --- a/crates/swc/tests/tsc-references/restElementWithInitializer2.1.normal.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [restElementWithInitializer2.ts] -//! -//! x A rest parameter cannot have an initializer -//! ,-[1:1] -//! 1 | var a: number[]; -//! 2 | var x: number[]; -//! 3 | [...x = a] = a; // Error, rest element cannot have initializer -//! : ^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/restElementWithInitializer2.2.minified.js b/crates/swc/tests/tsc-references/restElementWithInitializer2.2.minified.js deleted file mode 100644 index 7e5b51b5800..00000000000 --- a/crates/swc/tests/tsc-references/restElementWithInitializer2.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [restElementWithInitializer2.ts] -//! -//! x A rest parameter cannot have an initializer -//! ,-[1:1] -//! 1 | var a: number[]; -//! 2 | var x: number[]; -//! 3 | [...x = a] = a; // Error, rest element cannot have initializer -//! : ^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/seeTag4.1.normal.js b/crates/swc/tests/tsc-references/seeTag4.1.normal.js new file mode 100644 index 00000000000..26092e85483 --- /dev/null +++ b/crates/swc/tests/tsc-references/seeTag4.1.normal.js @@ -0,0 +1,8 @@ +//// [seeTag4.js] +/** + * @typedef {any} A + */ /** + * @see {@link A} + * @see {@linkcode A} + * @see {@linkplain A} + */ var foo; diff --git a/crates/swc/tests/tsc-references/seeTag4.2.minified.js b/crates/swc/tests/tsc-references/seeTag4.2.minified.js new file mode 100644 index 00000000000..3bd47c4175f --- /dev/null +++ b/crates/swc/tests/tsc-references/seeTag4.2.minified.js @@ -0,0 +1 @@ +//// [seeTag4.js] diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule.1.normal.js b/crates/swc/tests/tsc-references/shadowedInternalModule.1.normal.js index 785763338d6..c6ca858f1bb 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule.1.normal.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule.1.normal.js @@ -13,4 +13,20 @@ //! : | //! : `-- `Y` redefined here //! 33 | } +//! 34 | +//! 35 | // +//! `---- +//! +//! x the name `Q` is defined multiple times +//! ,-[59:1] +//! 59 | } +//! 60 | +//! 61 | module s { +//! 62 | import Q = r.Q; +//! : | +//! : `-- previous definition of `Q` here +//! 63 | const Q = 0; +//! : | +//! : `-- `Q` redefined here +//! 64 | } //! `---- diff --git a/crates/swc/tests/tsc-references/shadowedInternalModule.2.minified.js b/crates/swc/tests/tsc-references/shadowedInternalModule.2.minified.js index 785763338d6..c6ca858f1bb 100644 --- a/crates/swc/tests/tsc-references/shadowedInternalModule.2.minified.js +++ b/crates/swc/tests/tsc-references/shadowedInternalModule.2.minified.js @@ -13,4 +13,20 @@ //! : | //! : `-- `Y` redefined here //! 33 | } +//! 34 | +//! 35 | // +//! `---- +//! +//! x the name `Q` is defined multiple times +//! ,-[59:1] +//! 59 | } +//! 60 | +//! 61 | module s { +//! 62 | import Q = r.Q; +//! : | +//! : `-- previous definition of `Q` here +//! 63 | const Q = 0; +//! : | +//! : `-- `Q` redefined here +//! 64 | } //! `---- diff --git a/crates/swc/tests/tsc-references/staticPropertyNameConflicts.1.normal.js b/crates/swc/tests/tsc-references/staticPropertyNameConflicts.1.normal.js deleted file mode 100644 index abe6da509aa..00000000000 --- a/crates/swc/tests/tsc-references/staticPropertyNameConflicts.1.normal.js +++ /dev/null @@ -1,184 +0,0 @@ -//// [staticPropertyNameConflicts.ts] -//! -//! x the name `default` is exported multiple times -//! ,-[132:1] -//! 132 | -//! 133 | // length -//! 134 | module TestOnDefaultExportedClass_3 { -//! 135 | ,-> export default class StaticLength { -//! 136 | | static length: number; // error -//! 137 | | length: string; // ok -//! 138 | |-> } -//! : `---- previous exported here -//! 139 | } -//! 140 | -//! 141 | module TestOnDefaultExportedClass_4 { -//! 142 | ,-> export default class StaticLengthFn { -//! 143 | | static length() {} // error -//! 144 | | length() {} // ok -//! 145 | |-> } -//! : `---- exported more than once -//! 146 | } -//! 147 | -//! 148 | // prototype -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[139:1] -//! 139 | } -//! 140 | -//! 141 | module TestOnDefaultExportedClass_4 { -//! 142 | ,-> export default class StaticLengthFn { -//! 143 | | static length() {} // error -//! 144 | | length() {} // ok -//! 145 | |-> } -//! : `---- previous exported here -//! 146 | } -//! 147 | -//! 148 | // prototype -//! 149 | module TestOnDefaultExportedClass_5 { -//! 150 | ,-> export default class StaticPrototype { -//! 151 | | static prototype: number; // error -//! 152 | | prototype: string; // ok -//! 153 | |-> } -//! : `---- exported more than once -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[147:1] -//! 147 | -//! 148 | // prototype -//! 149 | module TestOnDefaultExportedClass_5 { -//! 150 | ,-> export default class StaticPrototype { -//! 151 | | static prototype: number; // error -//! 152 | | prototype: string; // ok -//! 153 | |-> } -//! : `---- previous exported here -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! 157 | ,-> export default class StaticPrototypeFn { -//! 158 | | static prototype() {} // error -//! 159 | | prototype() {} // ok -//! 160 | |-> } -//! : `---- exported more than once -//! 161 | } -//! 162 | -//! 163 | // caller -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[154:1] -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! 157 | ,-> export default class StaticPrototypeFn { -//! 158 | | static prototype() {} // error -//! 159 | | prototype() {} // ok -//! 160 | |-> } -//! : `---- previous exported here -//! 161 | } -//! 162 | -//! 163 | // caller -//! 164 | module TestOnDefaultExportedClass_7 { -//! 165 | ,-> export default class StaticCaller { -//! 166 | | static caller: number; // error -//! 167 | | caller: string; // ok -//! 168 | |-> } -//! : `---- exported more than once -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[162:1] -//! 162 | -//! 163 | // caller -//! 164 | module TestOnDefaultExportedClass_7 { -//! 165 | ,-> export default class StaticCaller { -//! 166 | | static caller: number; // error -//! 167 | | caller: string; // ok -//! 168 | |-> } -//! : `---- previous exported here -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! 172 | ,-> export default class StaticCallerFn { -//! 173 | | static caller() {} // error -//! 174 | | caller() {} // ok -//! 175 | |-> } -//! : `---- exported more than once -//! 176 | } -//! 177 | -//! 178 | // arguments -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[169:1] -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! 172 | ,-> export default class StaticCallerFn { -//! 173 | | static caller() {} // error -//! 174 | | caller() {} // ok -//! 175 | |-> } -//! : `---- previous exported here -//! 176 | } -//! 177 | -//! 178 | // arguments -//! 179 | module TestOnDefaultExportedClass_9 { -//! 180 | ,-> export default class StaticArguments { -//! 181 | | static arguments: number; // error -//! 182 | | arguments: string; // ok -//! 183 | |-> } -//! : `---- exported more than once -//! 184 | } -//! 185 | -//! 186 | module TestOnDefaultExportedClass_10 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[177:1] -//! 177 | -//! 178 | // arguments -//! 179 | module TestOnDefaultExportedClass_9 { -//! 180 | ,-> export default class StaticArguments { -//! 181 | | static arguments: number; // error -//! 182 | | arguments: string; // ok -//! 183 | |-> } -//! : `---- previous exported here -//! 184 | } -//! 185 | -//! 186 | module TestOnDefaultExportedClass_10 { -//! 187 | ,-> export default class StaticArgumentsFn { -//! 188 | | static arguments() {} // error -//! 189 | | arguments() {} // ok -//! 190 | |-> } -//! : `---- exported more than once -//! 191 | } -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique diff --git a/crates/swc/tests/tsc-references/staticPropertyNameConflicts.2.minified.js b/crates/swc/tests/tsc-references/staticPropertyNameConflicts.2.minified.js deleted file mode 100644 index abe6da509aa..00000000000 --- a/crates/swc/tests/tsc-references/staticPropertyNameConflicts.2.minified.js +++ /dev/null @@ -1,184 +0,0 @@ -//// [staticPropertyNameConflicts.ts] -//! -//! x the name `default` is exported multiple times -//! ,-[132:1] -//! 132 | -//! 133 | // length -//! 134 | module TestOnDefaultExportedClass_3 { -//! 135 | ,-> export default class StaticLength { -//! 136 | | static length: number; // error -//! 137 | | length: string; // ok -//! 138 | |-> } -//! : `---- previous exported here -//! 139 | } -//! 140 | -//! 141 | module TestOnDefaultExportedClass_4 { -//! 142 | ,-> export default class StaticLengthFn { -//! 143 | | static length() {} // error -//! 144 | | length() {} // ok -//! 145 | |-> } -//! : `---- exported more than once -//! 146 | } -//! 147 | -//! 148 | // prototype -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[139:1] -//! 139 | } -//! 140 | -//! 141 | module TestOnDefaultExportedClass_4 { -//! 142 | ,-> export default class StaticLengthFn { -//! 143 | | static length() {} // error -//! 144 | | length() {} // ok -//! 145 | |-> } -//! : `---- previous exported here -//! 146 | } -//! 147 | -//! 148 | // prototype -//! 149 | module TestOnDefaultExportedClass_5 { -//! 150 | ,-> export default class StaticPrototype { -//! 151 | | static prototype: number; // error -//! 152 | | prototype: string; // ok -//! 153 | |-> } -//! : `---- exported more than once -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[147:1] -//! 147 | -//! 148 | // prototype -//! 149 | module TestOnDefaultExportedClass_5 { -//! 150 | ,-> export default class StaticPrototype { -//! 151 | | static prototype: number; // error -//! 152 | | prototype: string; // ok -//! 153 | |-> } -//! : `---- previous exported here -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! 157 | ,-> export default class StaticPrototypeFn { -//! 158 | | static prototype() {} // error -//! 159 | | prototype() {} // ok -//! 160 | |-> } -//! : `---- exported more than once -//! 161 | } -//! 162 | -//! 163 | // caller -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[154:1] -//! 154 | } -//! 155 | -//! 156 | module TestOnDefaultExportedClass_6 { -//! 157 | ,-> export default class StaticPrototypeFn { -//! 158 | | static prototype() {} // error -//! 159 | | prototype() {} // ok -//! 160 | |-> } -//! : `---- previous exported here -//! 161 | } -//! 162 | -//! 163 | // caller -//! 164 | module TestOnDefaultExportedClass_7 { -//! 165 | ,-> export default class StaticCaller { -//! 166 | | static caller: number; // error -//! 167 | | caller: string; // ok -//! 168 | |-> } -//! : `---- exported more than once -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[162:1] -//! 162 | -//! 163 | // caller -//! 164 | module TestOnDefaultExportedClass_7 { -//! 165 | ,-> export default class StaticCaller { -//! 166 | | static caller: number; // error -//! 167 | | caller: string; // ok -//! 168 | |-> } -//! : `---- previous exported here -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! 172 | ,-> export default class StaticCallerFn { -//! 173 | | static caller() {} // error -//! 174 | | caller() {} // ok -//! 175 | |-> } -//! : `---- exported more than once -//! 176 | } -//! 177 | -//! 178 | // arguments -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[169:1] -//! 169 | } -//! 170 | -//! 171 | module TestOnDefaultExportedClass_8 { -//! 172 | ,-> export default class StaticCallerFn { -//! 173 | | static caller() {} // error -//! 174 | | caller() {} // ok -//! 175 | |-> } -//! : `---- previous exported here -//! 176 | } -//! 177 | -//! 178 | // arguments -//! 179 | module TestOnDefaultExportedClass_9 { -//! 180 | ,-> export default class StaticArguments { -//! 181 | | static arguments: number; // error -//! 182 | | arguments: string; // ok -//! 183 | |-> } -//! : `---- exported more than once -//! 184 | } -//! 185 | -//! 186 | module TestOnDefaultExportedClass_10 { -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique -//! -//! x the name `default` is exported multiple times -//! ,-[177:1] -//! 177 | -//! 178 | // arguments -//! 179 | module TestOnDefaultExportedClass_9 { -//! 180 | ,-> export default class StaticArguments { -//! 181 | | static arguments: number; // error -//! 182 | | arguments: string; // ok -//! 183 | |-> } -//! : `---- previous exported here -//! 184 | } -//! 185 | -//! 186 | module TestOnDefaultExportedClass_10 { -//! 187 | ,-> export default class StaticArgumentsFn { -//! 188 | | static arguments() {} // error -//! 189 | | arguments() {} // ok -//! 190 | |-> } -//! : `---- exported more than once -//! 191 | } -//! `---- -//! -//! Error: -//! > Exported identifiers must be unique diff --git a/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js b/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js index ff063fdccf6..32ead08c50c 100644 --- a/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js +++ b/crates/swc/tests/tsc-references/strictPropertyInitialization.1.normal.js @@ -135,3 +135,13 @@ class C12 { this['c'] = 1; } } +var E; +(function(E) { + E["A"] = "A"; + E["B"] = "B"; +})(E || (E = {})); +class C13 { + constructor(){ + this[E.A] = 1; + } +} diff --git a/crates/swc/tests/tsc-references/strictPropertyInitialization.2.minified.js b/crates/swc/tests/tsc-references/strictPropertyInitialization.2.minified.js index 54d0bfb33f6..471db9891ca 100644 --- a/crates/swc/tests/tsc-references/strictPropertyInitialization.2.minified.js +++ b/crates/swc/tests/tsc-references/strictPropertyInitialization.2.minified.js @@ -1,5 +1,8 @@ //// [strictPropertyInitialization.ts] +var E; import "@swc/helpers/src/_class_private_field_get.mjs"; import "@swc/helpers/src/_class_private_field_init.mjs"; import "@swc/helpers/src/_class_private_field_set.mjs"; -Symbol(); +Symbol(), function(E) { + E.A = "A", E.B = "B"; +}(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.1.normal.js b/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.1.normal.js new file mode 100644 index 00000000000..74dd5239ac8 --- /dev/null +++ b/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.1.normal.js @@ -0,0 +1,10 @@ +//// [stringLiteralsAssignedToStringMappings.ts] +// good +x = "A"; +// bad +x = "a"; +// good +y = "1"; +// bad +y = "a"; +y = "A"; diff --git a/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.2.minified.js b/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.2.minified.js new file mode 100644 index 00000000000..05fb33ac65a --- /dev/null +++ b/crates/swc/tests/tsc-references/stringLiteralsAssignedToStringMappings.2.minified.js @@ -0,0 +1,2 @@ +//// [stringLiteralsAssignedToStringMappings.ts] +x = "A", x = "a", y = "1", y = "a", y = "A"; diff --git a/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.1.normal.js b/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.1.normal.js new file mode 100644 index 00000000000..81c7dbca5e2 --- /dev/null +++ b/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.1.normal.js @@ -0,0 +1,94 @@ +//// [stringMappingOverPatternLiterals.ts] +// non-template +function f1(a, b, c, a_template, b_template, c_template) { + // non-template versions should be assignable to templated versions (empty string matches string) + a_template = a; + b_template = b; + c_template = c; + // not the other way around + a = a_template; + b = b_template; + c = c_template; + // Additionally, all the template versions should be mutually incompatible (they describe differing sets) + a_template = b_template; + a_template = c_template; + b_template = a_template; + b_template = c_template; + c_template = a_template; + c_template = b_template; +} +// Raw string mapping assignability +function f2(x1, x2, x3) { + // ok + x1 = x2; + x1 = x3; + x2 = "ABC"; + x3 = "abc"; + // should fail (sets do not match) + x2 = x1; + x2 = x3; + x3 = x1; + x3 = x2; + x2 = "AbC"; + x3 = "AbC"; +} +// Mappings over mappings +function f3(x1, x2, x3) { + // _ideally_ these would all be equivalent + x1 = x2; + x1 = x3; + x2 = x1; + x2 = x3; + // you'd think these were equivalent - the outer `Uppercase` conceptually + // makes the inner `Lowercase` effectively a noop - but that's not so; + // the german sharp s makes that not completely true (lowercases to ss, + // which then uppercases to SS), so arbitrary nestings of mappings make differing sets! + x3 = x1; + x3 = x2; + // and this should also not be equivlent to any others + var x4 = null; + x1 = x4; + x2 = x4; + x3 = x4; + x4 = x1; + x4 = x2; + x4 = x3; +} +function f4(x1, x2) { + // Should both work + x1 = x2; + x2 = x1; +} +// Capitalize and uncapitalize on template literals +function f5(cap_tem, cap_str, cap_tem_map, cap_tem_map2, uncap_tem, uncap_str, uncap_tem_map, uncap_tem_map2) { + // All these are capitalized + cap_str = cap_tem; + cap_str = cap_tem_map; + cap_str = cap_tem_map2; + // these are all equivalent + cap_tem = cap_tem_map; + cap_tem = cap_tem_map2; + cap_tem_map = cap_tem_map2; + cap_tem_map = cap_tem; + cap_tem_map2 = cap_tem_map; + cap_tem_map2 = cap_tem; + // meanwhile, these all require a `A` prefix + cap_tem = cap_str; + cap_tem_map = cap_str; + cap_tem_map2 = cap_str; + // All these are uncapitalized + uncap_str = uncap_tem; + uncap_str = uncap_tem_map; + uncap_str = uncap_tem_map2; + // these are all equivalent + uncap_tem = uncap_tem_map; + uncap_tem = uncap_tem_map2; + uncap_tem_map = uncap_tem_map2; + uncap_tem_map = uncap_tem; + uncap_tem_map2 = uncap_tem_map; + uncap_tem_map2 = uncap_tem; + // meanwhile, these all require a `a` prefix + uncap_tem = uncap_str; + uncap_tem_map = uncap_str; + uncap_tem_map2 = uncap_str; +} diff --git a/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.2.minified.js b/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.2.minified.js new file mode 100644 index 00000000000..14b7c303047 --- /dev/null +++ b/crates/swc/tests/tsc-references/stringMappingOverPatternLiterals.2.minified.js @@ -0,0 +1 @@ +//// [stringMappingOverPatternLiterals.ts] diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.1.normal.js deleted file mode 100644 index ff91fc957ee..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.1.normal.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [superCallBeforeThisAccessing3.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Base = function Base(c) { - "use strict"; - _class_call_check(this, Base); -}; -var D = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(D, Base); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - var _this; - var x = function() { - _this._t; - }; - x(); // no error; we only check super is called before this when the container is a constructor - _this._t; // error - _this = _super.call(this, undefined); - return _this; - } - return D; -}(Base); diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.2.minified.js deleted file mode 100644 index a07973f61c2..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing3.2.minified.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [superCallBeforeThisAccessing3.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.1.normal.js deleted file mode 100644 index ca253f86e07..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.1.normal.js +++ /dev/null @@ -1,30 +0,0 @@ -//// [superCallBeforeThisAccessing4.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var D = /*#__PURE__*/ function(_superClass) { - "use strict"; - _inherits(D, _superClass); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - var _this; - _this._t; - _this = _super.call(this); - return _this; - } - return D; -}(null); -var E = /*#__PURE__*/ function(_superClass) { - "use strict"; - _inherits(E, _superClass); - var _super = _create_super(E); - function E() { - _class_call_check(this, E); - var _this; - _this = _super.call(this); - _this._t; - return _this; - } - return E; -}(null); diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.2.minified.js deleted file mode 100644 index b641f6e5027..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing4.2.minified.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [superCallBeforeThisAccessing4.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.1.normal.js deleted file mode 100644 index 87cbe343cf4..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.1.normal.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [superCallBeforeThisAccessing6.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Base = function Base(c) { - "use strict"; - _class_call_check(this, Base); -}; -var D = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(D, Base); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); - return _this; - } - return D; -}(Base); diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.2.minified.js deleted file mode 100644 index 115c2525e31..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing6.2.minified.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [superCallBeforeThisAccessing6.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.1.normal.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.1.normal.js deleted file mode 100644 index c0ab41cd035..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.1.normal.js +++ /dev/null @@ -1,23 +0,0 @@ -//// [superCallBeforeThisAccessing7.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Base = function Base(c) { - "use strict"; - _class_call_check(this, Base); -}; -var D = /*#__PURE__*/ function(Base) { - "use strict"; - _inherits(D, Base); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - var _this; - var x = { - j: _this._t - }; - _this = _super.call(this, undefined); - return _this; - } - return D; -}(Base); diff --git a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.2.minified.js b/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.2.minified.js deleted file mode 100644 index 5be0db76830..00000000000 --- a/crates/swc/tests/tsc-references/superCallBeforeThisAccessing7.2.minified.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [superCallBeforeThisAccessing7.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.1.normal.js b/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.1.normal.js deleted file mode 100644 index 5d79feb5bce..00000000000 --- a/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.1.normal.js +++ /dev/null @@ -1,42 +0,0 @@ -//// [superPropertyInConstructorBeforeSuperCall.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var B = /*#__PURE__*/ function() { - "use strict"; - function B(x) { - _class_call_check(this, B); - } - var _proto = B.prototype; - _proto.x = function x() { - return ""; - }; - return B; -}(); -var C1 = /*#__PURE__*/ function(B) { - "use strict"; - _inherits(C1, B); - var _super = _create_super(C1); - function C1() { - _class_call_check(this, C1); - var _this; - _get((_assert_this_initialized(_this), _get_prototype_of(C1.prototype)), "x", _this).call(_this); - _this = _super.call(this); - return _possible_constructor_return(_this); - } - return C1; -}(B); -var C2 = /*#__PURE__*/ function(B) { - "use strict"; - _inherits(C2, B); - var _super = _create_super(C2); - function C2() { - _class_call_check(this, C2); - return _super.call(this, _get(_get_prototype_of(C2.prototype), "x", this).call(this)); - } - return C2; -}(B); diff --git a/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.2.minified.js b/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.2.minified.js deleted file mode 100644 index 1d3d25402af..00000000000 --- a/crates/swc/tests/tsc-references/superPropertyInConstructorBeforeSuperCall.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [superPropertyInConstructorBeforeSuperCall.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _possible_constructor_return from "@swc/helpers/src/_possible_constructor_return.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; diff --git a/crates/swc/tests/tsc-references/symbolProperty59.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty59.1.normal.js deleted file mode 100644 index 60d117bf2d0..00000000000 --- a/crates/swc/tests/tsc-references/symbolProperty59.1.normal.js +++ /dev/null @@ -1 +0,0 @@ -//// [symbolProperty59.ts] diff --git a/crates/swc/tests/tsc-references/symbolProperty59.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty59.2.minified.js deleted file mode 100644 index 60d117bf2d0..00000000000 --- a/crates/swc/tests/tsc-references/symbolProperty59.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [symbolProperty59.ts] diff --git a/crates/swc/tests/tsc-references/symbolProperty7.1.normal.js b/crates/swc/tests/tsc-references/symbolProperty7.1.normal.js deleted file mode 100644 index c34a947d7a1..00000000000 --- a/crates/swc/tests/tsc-references/symbolProperty7.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [symbolProperty7.ts] -let _Symbol = Symbol(), _Symbol1 = Symbol(), _Symbol2 = Symbol(); -class C { - [_Symbol1]() {} - get [_Symbol2]() { - return 0; - } - constructor(){ - this[_Symbol] = 0; - } -} diff --git a/crates/swc/tests/tsc-references/symbolProperty7.2.minified.js b/crates/swc/tests/tsc-references/symbolProperty7.2.minified.js deleted file mode 100644 index 5706aa8700e..00000000000 --- a/crates/swc/tests/tsc-references/symbolProperty7.2.minified.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [symbolProperty7.ts] -Symbol(), Symbol(), Symbol(); diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.1.normal.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.1.normal.js deleted file mode 100644 index 5a5fec73bc2..00000000000 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [taggedTemplatesWithTypeArguments2.ts] -//! -//! x Expression expected -//! ,-[34:1] -//! 34 | -//! 35 | class SomeDerived extends SomeBase { -//! 36 | constructor() { -//! 37 | super `hello world`; -//! : ^ -//! 38 | } -//! 39 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.2.minified.js deleted file mode 100644 index 5a5fec73bc2..00000000000 --- a/crates/swc/tests/tsc-references/taggedTemplatesWithTypeArguments2.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [taggedTemplatesWithTypeArguments2.ts] -//! -//! x Expression expected -//! ,-[34:1] -//! 34 | -//! 35 | class SomeDerived extends SomeBase { -//! 36 | constructor() { -//! 37 | super `hello world`; -//! : ^ -//! 38 | } -//! 39 | } -//! `---- diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js deleted file mode 100644 index ee1d99f623c..00000000000 --- a/crates/swc/tests/tsc-references/templateLiteralTypes3.1.normal.js +++ /dev/null @@ -1,97 +0,0 @@ -//// [templateLiteralTypes3.ts] -// Inference from template literal type to template literal type -function f1(s, n, b, t) { - var x1 = foo1("hello"); // Error - var x2 = foo1("*hello*"); - var x3 = foo1("**hello**"); - var x4 = foo1("*".concat(s, "*")); - var x5 = foo1("*".concat(n, "*")); - var x6 = foo1("*".concat(b, "*")); - var x7 = foo1("*".concat(t, "*")); - var x8 = foo1("**".concat(s, "**")); -} -function f2() { - var x; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; - x = "1.1.1"; -} -function f3(s, n, b, t) { - var x; - x = "hello"; // Error - x = "*hello*"; - x = "**hello**"; - x = "*".concat(s, "*"); - x = "*".concat(n, "*"); - x = "*".concat(b, "*"); - x = "*".concat(t, "*"); - x = "**".concat(s, "**"); -} -function f4(s, n, b, t) { - var x; - x = "123"; // Error - x = "*123*"; - x = "**123**"; // Error - x = "*".concat(s, "*"); // Error - x = "*".concat(n, "*"); - x = "*".concat(b, "*"); // Error - x = "*".concat(t, "*"); -} -var value1 = "abc"; -var templated1 = "".concat(value1, " abc"); -// Type '`${string} abc`' is not assignable to type '`${string} ${string}`'. -var value2 = "abc"; -var templated2 = "".concat(value2, " abc"); -chain("a"); -// Repro from #46125 -function ff1(x, y, z) { - if (x === y) { - x; // `foo-${string}` - } - if (x === z) {} -} -function ff2(x, y, z) { - if (x === y) { - x; // `foo-${T}` - } - if (x === z) {} -} -function ff3(x, y) { - if (x === y) { - x; // `foo-${string}` | 'bar' - } -} -function ff4(x, y) { - if (x === "foo-test") { - x; // 'foo-test' - } - if (y === "foo-test") { - y; // 'foo-test' - } -} -function reducer(action) { - if (action.type === "FOO_SUCCESS") { - action.type; - action.response; - } -} -noSpread([ - "1.2.3", - "1.2.4" -]); -noSpread([ - "1.2.3", - "1.2.4" -]); -spread("1.2.3", "1.2.4"); -spread("1.2.3", "1.2.4"); -function ft1(t, u, u1, u2) { - spread("1.".concat(t, ".3"), "1.".concat(t, ".4")); - spread("1.".concat(u, ".3"), "1.".concat(u, ".4")); - spread(u1, u2); -} diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes3.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypes3.2.minified.js deleted file mode 100644 index de4733d0463..00000000000 --- a/crates/swc/tests/tsc-references/templateLiteralTypes3.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [templateLiteralTypes3.ts] -chain("a"), noSpread([ - "1.2.3", - "1.2.4" -]), noSpread([ - "1.2.3", - "1.2.4" -]), spread("1.2.3", "1.2.4"), spread("1.2.3", "1.2.4"); diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes4.1.normal.js b/crates/swc/tests/tsc-references/templateLiteralTypes4.1.normal.js new file mode 100644 index 00000000000..e64cf4f1992 --- /dev/null +++ b/crates/swc/tests/tsc-references/templateLiteralTypes4.1.normal.js @@ -0,0 +1,33 @@ +//// [templateLiteralTypes4.ts] +// infer from number +var // infer from literal enums +StringLiteralEnum; +(function(StringLiteralEnum) { + StringLiteralEnum["Zero"] = "0"; + StringLiteralEnum["True"] = "true"; + StringLiteralEnum["False"] = "false"; + StringLiteralEnum["Undefined"] = "undefined"; + StringLiteralEnum["Null"] = "null"; +})(StringLiteralEnum || (StringLiteralEnum = {})); +var NumberLiteralEnum; +(function(NumberLiteralEnum) { + NumberLiteralEnum[NumberLiteralEnum["Zero"] = 0] = "Zero"; + NumberLiteralEnum[NumberLiteralEnum["One"] = 1] = "One"; +})(NumberLiteralEnum || (NumberLiteralEnum = {})); +var // infer from non-literal enums +NonLiteralEnum; +(function(NonLiteralEnum) { + NonLiteralEnum[NonLiteralEnum["Zero"] = 0] = "Zero"; + NonLiteralEnum[NonLiteralEnum["One"] = 1] = "One"; +})(NonLiteralEnum || (NonLiteralEnum = {})); +p.getIndex(0); // ok, 0 is a valid index +p.getIndex(1); // ok, 1 is a valid index +p.getIndex(2); // error, 2 is not a valid index +p.setIndex(0, 0); // ok, 0 is a valid index +p.setIndex(1, 0); // ok, 1 is a valid index +p.setIndex(2, 3); // error, 2 is not a valid index +f1("**123**"); // "123" +f2("**123**"); // 123 +f3("**123**"); // 123n +f4("**true**"); // true | "true" +f4("**false**"); // false | "false" diff --git a/crates/swc/tests/tsc-references/templateLiteralTypes4.2.minified.js b/crates/swc/tests/tsc-references/templateLiteralTypes4.2.minified.js new file mode 100644 index 00000000000..495741e42e6 --- /dev/null +++ b/crates/swc/tests/tsc-references/templateLiteralTypes4.2.minified.js @@ -0,0 +1,9 @@ +//// [templateLiteralTypes4.ts] +var StringLiteralEnum, NumberLiteralEnum, NonLiteralEnum; +!function(StringLiteralEnum) { + StringLiteralEnum.Zero = "0", StringLiteralEnum.True = "true", StringLiteralEnum.False = "false", StringLiteralEnum.Undefined = "undefined", StringLiteralEnum.Null = "null"; +}(StringLiteralEnum || (StringLiteralEnum = {})), function(NumberLiteralEnum) { + NumberLiteralEnum[NumberLiteralEnum.Zero = 0] = "Zero", NumberLiteralEnum[NumberLiteralEnum.One = 1] = "One"; +}(NumberLiteralEnum || (NumberLiteralEnum = {})), function(NonLiteralEnum) { + NonLiteralEnum[NonLiteralEnum.Zero = 0] = "Zero", NonLiteralEnum[NonLiteralEnum.One = 1] = "One"; +}(NonLiteralEnum || (NonLiteralEnum = {})), p.getIndex(0), p.getIndex(1), p.getIndex(2), p.setIndex(0, 0), p.setIndex(1, 0), p.setIndex(2, 3), f1("**123**"), f2("**123**"), f3("**123**"), f4("**true**"), f4("**false**"); diff --git a/crates/swc/tests/tsc-references/templateStringMultiline3.1.normal.js b/crates/swc/tests/tsc-references/templateStringMultiline3.1.normal.js index a6dcc059a4c..c5885946964 100644 --- a/crates/swc/tests/tsc-references/templateStringMultiline3.1.normal.js +++ b/crates/swc/tests/tsc-references/templateStringMultiline3.1.normal.js @@ -1,3 +1,2 @@ //// [templateStringMultiline3.ts] -// newlines are -"\n"; +// newlines are `\` diff --git a/crates/swc/tests/tsc-references/thisInInvalidContexts.1.normal.js b/crates/swc/tests/tsc-references/thisInInvalidContexts.1.normal.js deleted file mode 100644 index 4fda5c39bd3..00000000000 --- a/crates/swc/tests/tsc-references/thisInInvalidContexts.1.normal.js +++ /dev/null @@ -1,61 +0,0 @@ -//// [thisInInvalidContexts.ts] -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var BaseErrClass = function BaseErrClass(t) { - "use strict"; - _class_call_check(this, BaseErrClass); -}; -var ClassWithNoInitializer = /*#__PURE__*/ function(BaseErrClass) { - "use strict"; - _inherits(ClassWithNoInitializer, BaseErrClass); - var _super = _create_super(ClassWithNoInitializer); - function ClassWithNoInitializer() { - _class_call_check(this, ClassWithNoInitializer); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); // Error - return _this; - } - return ClassWithNoInitializer; -}(BaseErrClass); -var ClassWithInitializer = /*#__PURE__*/ function(BaseErrClass) { - "use strict"; - _inherits(ClassWithInitializer, BaseErrClass); - var _super = _create_super(ClassWithInitializer); - function ClassWithInitializer() { - _class_call_check(this, ClassWithInitializer); - var _this; - _this = _super.call(this, _assert_this_initialized(_this)); // Error - _this.t = 4; - return _this; - } - return ClassWithInitializer; -}(BaseErrClass); -var M; -(function(M) { - //'this' in module variable - var x = this; // Error -})(M || (M = {})); -//'this' as type parameter constraint -// function fn() { } // Error -//'this' as a type argument -function genericFunc(x) {} -genericFunc(undefined); // Should be an error -var ErrClass3 = /*#__PURE__*/ function(_this) { - "use strict"; - _inherits(ErrClass3, _this); - var _super = _create_super(ErrClass3); - function ErrClass3() { - _class_call_check(this, ErrClass3); - return _super.apply(this, arguments); - } - return ErrClass3; -}(this); -var //'this' as a computed enum value -SomeEnum; -(function(SomeEnum) { - SomeEnum[SomeEnum["A"] = this] = "A"; - SomeEnum[SomeEnum["B"] = this.spaaaace // Also should not be allowed - ] = "B"; -})(SomeEnum || (SomeEnum = {})); diff --git a/crates/swc/tests/tsc-references/thisInInvalidContexts.2.minified.js b/crates/swc/tests/tsc-references/thisInInvalidContexts.2.minified.js deleted file mode 100644 index 35d869910be..00000000000 --- a/crates/swc/tests/tsc-references/thisInInvalidContexts.2.minified.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [thisInInvalidContexts.ts] -var M, SomeEnum; -import _assert_this_initialized from "@swc/helpers/src/_assert_this_initialized.mjs"; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -M || (M = {}), function(SomeEnum) { - SomeEnum[SomeEnum.A = this] = "A", SomeEnum[SomeEnum.B = this.spaaaace] = "B"; -}(SomeEnum || (SomeEnum = {})); diff --git a/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.1.normal.js b/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.1.normal.js deleted file mode 100644 index c018627efde..00000000000 --- a/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.1.normal.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [thisInInvalidContextsExternalModule.ts] -//! -//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. -//! ,-[40:1] -//! 40 | B = this.spaaaace // Also should not be allowed -//! 41 | } -//! 42 | -//! 43 | export = this; // Should be an error -//! : ^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.2.minified.js b/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.2.minified.js deleted file mode 100644 index c018627efde..00000000000 --- a/crates/swc/tests/tsc-references/thisInInvalidContextsExternalModule.2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [thisInInvalidContextsExternalModule.ts] -//! -//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. -//! ,-[40:1] -//! 40 | B = this.spaaaace // Also should not be allowed -//! 41 | } -//! 42 | -//! 43 | export = this; // Should be an error -//! : ^^^^^^^^^^^^^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.1.normal.js b/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.1.normal.js deleted file mode 100644 index 9c86582ebb4..00000000000 --- a/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.1.normal.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [trailingCommasInBindingPatterns.ts] -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! : ^ -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! 2 | const {...b,} = {}; -//! : ^ -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! 5 | ({...d,} = {}); -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! : ^ -//! 5 | ({...d,} = {}); -//! 6 | -//! 7 | // Allowed for non-rest elements -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[2:1] -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! 5 | ({...d,} = {}); -//! : ^ -//! 6 | -//! 7 | // Allowed for non-rest elements -//! 8 | const [e,] = []; -//! `---- diff --git a/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.2.minified.js b/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.2.minified.js deleted file mode 100644 index 9c86582ebb4..00000000000 --- a/crates/swc/tests/tsc-references/trailingCommasInBindingPatterns.2.minified.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [trailingCommasInBindingPatterns.ts] -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! : ^ -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! 2 | const {...b,} = {}; -//! : ^ -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! 5 | ({...d,} = {}); -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[1:1] -//! 1 | const [...a,] = []; -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! : ^ -//! 5 | ({...d,} = {}); -//! 6 | -//! 7 | // Allowed for non-rest elements -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[2:1] -//! 2 | const {...b,} = {}; -//! 3 | let c, d; -//! 4 | ([...c,] = []); -//! 5 | ({...d,} = {}); -//! : ^ -//! 6 | -//! 7 | // Allowed for non-rest elements -//! 8 | const [e,] = []; -//! `---- diff --git a/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.1.normal.js b/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.1.normal.js deleted file mode 100644 index 77a76a6c8c0..00000000000 --- a/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.1.normal.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [trailingCommasInFunctionParametersAndArguments.ts] -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[3:1] -//! 3 | -//! 4 | f1(1,); -//! 5 | -//! 6 | function f2(...args,) {} -//! : ^ -//! 7 | -//! 8 | // Allowed for ambient declarations -//! 9 | declare function f25(...args,): void; -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[6:1] -//! 6 | function f2(...args,) {} -//! 7 | -//! 8 | // Allowed for ambient declarations -//! 9 | declare function f25(...args,): void; -//! : ^ -//! 10 | -//! 11 | f2(...[],); -//! `---- diff --git a/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.2.minified.js b/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.2.minified.js deleted file mode 100644 index 77a76a6c8c0..00000000000 --- a/crates/swc/tests/tsc-references/trailingCommasInFunctionParametersAndArguments.2.minified.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [trailingCommasInFunctionParametersAndArguments.ts] -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[3:1] -//! 3 | -//! 4 | f1(1,); -//! 5 | -//! 6 | function f2(...args,) {} -//! : ^ -//! 7 | -//! 8 | // Allowed for ambient declarations -//! 9 | declare function f25(...args,): void; -//! `---- -//! -//! x Trailing comma isn't permitted after a rest element -//! ,-[6:1] -//! 6 | function f2(...args,) {} -//! 7 | -//! 8 | // Allowed for ambient declarations -//! 9 | declare function f25(...args,): void; -//! : ^ -//! 10 | -//! 11 | f2(...[],); -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.1.normal.js b/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.1.normal.js deleted file mode 100644 index 5e1b39a06dc..00000000000 --- a/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [file.tsx] -//! -//! x Unexpected token `test1`. Expected jsx identifier -//! ,-[7:1] -//! 7 | } -//! 8 | -//! 9 | // Invalid names -//! 10 | ; -//! : ^^^^^ -//! 11 | ; -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.2.minified.js b/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.2.minified.js deleted file mode 100644 index 5e1b39a06dc..00000000000 --- a/crates/swc/tests/tsc-references/tsxAttributeInvalidNames.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [file.tsx] -//! -//! x Unexpected token `test1`. Expected jsx identifier -//! ,-[7:1] -//! 7 | } -//! 8 | -//! 9 | // Invalid names -//! 10 | ; -//! : ^^^^^ -//! 11 | ; -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).1.normal.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).2.minified.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2015).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).1.normal.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).1.normal.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).2.minified.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).2.minified.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2018).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).1.normal.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).2.minified.js deleted file mode 100644 index 6b0da642f68..00000000000 --- a/crates/swc/tests/tsc-references/tsxEmitSpreadAttribute(target=es2022).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[2:1] -//! 2 | declare const React: any; -//! 3 | -//! 4 | export function T1(a: any) { -//! 5 | return
T1
; -//! : ^^^^^^^^^ -//! 6 | } -//! 7 | -//! 8 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery1.1.normal.js b/crates/swc/tests/tsc-references/tsxErrorRecovery1.1.normal.js deleted file mode 100644 index ed883641c75..00000000000 --- a/crates/swc/tests/tsc-references/tsxErrorRecovery1.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [file.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[2:1] -//! 2 | declare namespace JSX { interface Element { } } -//! 3 | -//! 4 | function foo() { -//! 5 | var x =
{
-//! : ^^^ -//! 6 | } -//! 7 | // Shouldn't see any errors down here -//! 8 | var y = { a: 1 }; -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxErrorRecovery1.2.minified.js b/crates/swc/tests/tsc-references/tsxErrorRecovery1.2.minified.js deleted file mode 100644 index ed883641c75..00000000000 --- a/crates/swc/tests/tsc-references/tsxErrorRecovery1.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [file.tsx] -//! -//! x Unexpected token `div`. Expected jsx identifier -//! ,-[2:1] -//! 2 | declare namespace JSX { interface Element { } } -//! 3 | -//! 4 | function foo() { -//! 5 | var x =
{
-//! : ^^^ -//! 6 | } -//! 7 | // Shouldn't see any errors down here -//! 8 | var y = { a: 1 }; -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxFragmentErrors.1.normal.js b/crates/swc/tests/tsc-references/tsxFragmentErrors.1.normal.js deleted file mode 100644 index 4d33b8c7929..00000000000 --- a/crates/swc/tests/tsc-references/tsxFragmentErrors.1.normal.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [file.tsx] -//! -//! x Expression expected -//! ,-[7:1] -//! 7 | } -//! 8 | declare var React: any; -//! 9 | -//! 10 | <>hi
// Error -//! : ^ -//! 11 | -//! 12 | <>eof // Error -//! `---- -//! -//! x Expression expected -//! ,-[9:1] -//! 9 | -//! 10 | <>hi
// Error -//! 11 | -//! 12 | <>eof // Error -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxFragmentErrors.2.minified.js b/crates/swc/tests/tsc-references/tsxFragmentErrors.2.minified.js deleted file mode 100644 index 4d33b8c7929..00000000000 --- a/crates/swc/tests/tsc-references/tsxFragmentErrors.2.minified.js +++ /dev/null @@ -1,21 +0,0 @@ -//// [file.tsx] -//! -//! x Expression expected -//! ,-[7:1] -//! 7 | } -//! 8 | declare var React: any; -//! 9 | -//! 10 | <>hi
// Error -//! : ^ -//! 11 | -//! 12 | <>eof // Error -//! `---- -//! -//! x Expression expected -//! ,-[9:1] -//! 9 | -//! 10 | <>hi
// Error -//! 11 | -//! 12 | <>eof // Error -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).1.normal.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).2.minified.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2015).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).1.normal.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).2.minified.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2018).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).1.normal.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).2.minified.js deleted file mode 100644 index 28ce38ab4f7..00000000000 --- a/crates/swc/tests/tsc-references/tsxReactEmitSpreadAttribute(target=es2022).2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [test.tsx] -//! -//! x Expected '>', got 'className' -//! ,-[1:1] -//! 1 | /// -//! 2 | -//! 3 | export function T1(a: any) { -//! 4 | return
T1
; -//! : ^^^^^^^^^ -//! 5 | } -//! 6 | -//! 7 | export function T2(a: any, b: any) { -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.1.normal.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.1.normal.js deleted file mode 100644 index 44fead436aa..00000000000 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.1.normal.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [file.tsx] -//! -//! x Expected ',', got ';' -//! ,-[39:1] -//! 39 | let i1 = x.greeting.substr(10)} /> -//! 40 | -//! 41 | let o = { -//! 42 | prop1: true; -//! : ^ -//! 43 | } -//! 44 | -//! 45 | // OK as access properties are allow when spread -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.2.minified.js b/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.2.minified.js deleted file mode 100644 index 44fead436aa..00000000000 --- a/crates/swc/tests/tsc-references/tsxStatelessFunctionComponents1.2.minified.js +++ /dev/null @@ -1,13 +0,0 @@ -//// [file.tsx] -//! -//! x Expected ',', got ';' -//! ,-[39:1] -//! 39 | let i1 = x.greeting.substr(10)} /> -//! 40 | -//! 41 | let o = { -//! 42 | prop1: true; -//! : ^ -//! 43 | } -//! 44 | -//! 45 | // OK as access properties are allow when spread -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.1.normal.js b/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.1.normal.js deleted file mode 100644 index 17620e199a1..00000000000 --- a/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [file.tsx] -//! -//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. -//! ,-[1:1] -//! 1 | -//! 2 | import React = require('react'); -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 3 | -//! 4 | interface Prop { -//! 5 | a: number, -//! `---- diff --git a/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.2.minified.js b/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.2.minified.js deleted file mode 100644 index 17620e199a1..00000000000 --- a/crates/swc/tests/tsc-references/tsxTypeArgumentResolution.2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [file.tsx] -//! -//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. -//! ,-[1:1] -//! 1 | -//! 2 | import React = require('react'); -//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -//! 3 | -//! 4 | interface Prop { -//! 5 | a: number, -//! `---- diff --git a/crates/swc/tests/tsc-references/twoAccessorsWithSameName.1.normal.js b/crates/swc/tests/tsc-references/twoAccessorsWithSameName.1.normal.js deleted file mode 100644 index 3b77760a324..00000000000 --- a/crates/swc/tests/tsc-references/twoAccessorsWithSameName.1.normal.js +++ /dev/null @@ -1,63 +0,0 @@ -//// [twoAccessorsWithSameName.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _define_enumerable_properties from "@swc/helpers/src/_define_enumerable_properties.mjs"; -var C = /*#__PURE__*/ function() { - "use strict"; - function C() { - _class_call_check(this, C); - } - _create_class(C, [ - { - key: "x", - get: function get() { - return 1; - } // error - } - ]); - return C; -}(); -var D = /*#__PURE__*/ function() { - "use strict"; - function D() { - _class_call_check(this, D); - } - _create_class(D, [ - { - key: "x", - set: function set(v1) {} // error - } - ]); - return D; -}(); -var E = /*#__PURE__*/ function() { - "use strict"; - function E() { - _class_call_check(this, E); - } - _create_class(E, [ - { - key: "x", - get: function get() { - return 1; - }, - set: function set(v1) {} - } - ]); - return E; -}(); -var _obj, _mutatorMap = {}; -var x = (_obj = { - get x () { - return 1; - } -}, // error -_mutatorMap["x"] = _mutatorMap["x"] || {}, _mutatorMap["x"].get = function() { - return 1; -}, _define_enumerable_properties(_obj, _mutatorMap), _obj); -var y = { - get x () { - return 1; - }, - set x (v){} -}; diff --git a/crates/swc/tests/tsc-references/twoAccessorsWithSameName.2.minified.js b/crates/swc/tests/tsc-references/twoAccessorsWithSameName.2.minified.js deleted file mode 100644 index 4ede462dfe0..00000000000 --- a/crates/swc/tests/tsc-references/twoAccessorsWithSameName.2.minified.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [twoAccessorsWithSameName.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _define_enumerable_properties from "@swc/helpers/src/_define_enumerable_properties.mjs"; -var _mutatorMap = {}; -_mutatorMap.x = _mutatorMap.x || {}, _mutatorMap.x.get = function() { - return 1; -}, _define_enumerable_properties({ - get x () { - return 1; - } -}, _mutatorMap); diff --git a/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.1.normal.js b/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.1.normal.js new file mode 100644 index 00000000000..14ca7628333 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.1.normal.js @@ -0,0 +1,12 @@ +//// [typeAndNamespaceExportMerge.ts] +// @strict +//// [constants.ts] +export var COFFEE = 0; +export var TEA = 1; +//// [drink.ts] +import * as _Drink from "./constants"; +export { _Drink as Drink }; +//// [index.ts] +import { Drink } from "./drink"; +// 'Drink' only refers to a type, but is being used as a value here +var x = Drink.TEA; diff --git a/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.2.minified.js b/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.2.minified.js new file mode 100644 index 00000000000..0d162230d53 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeAndNamespaceExportMerge.2.minified.js @@ -0,0 +1,10 @@ +//// [typeAndNamespaceExportMerge.ts] +//// [constants.ts] +export var COFFEE = 0; +export var TEA = 1; +//// [drink.ts] +import * as _Drink from "./constants"; +export { _Drink as Drink }; +//// [index.ts] +import { Drink } from "./drink"; +Drink.TEA; diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.1.normal.js deleted file mode 100644 index 5a52b7df908..00000000000 --- a/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.1.normal.js +++ /dev/null @@ -1,87 +0,0 @@ -//// [typeGuardOfFormThisMember.ts] -// There's a 'File' class in the stdlib, wrap with a namespace to avoid collision -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _instanceof from "@swc/helpers/src/_instanceof.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Test; -(function(Test) { - var FileSystemObject = /*#__PURE__*/ function() { - "use strict"; - function FileSystemObject(path) { - _class_call_check(this, FileSystemObject); - this.path = path; - } - _create_class(FileSystemObject, [ - { - key: "isFile", - get: function get() { - return _instanceof(this, File); - }, - set: function set(param) { - // noop - } - }, - { - key: "isDirectory", - get: function get() { - return _instanceof(this, Directory); - } - } - ]); - return FileSystemObject; - }(); - Test.FileSystemObject = FileSystemObject; - var File = /*#__PURE__*/ function(FileSystemObject) { - "use strict"; - _inherits(File, FileSystemObject); - var _super = _create_super(File); - function File(path, content) { - _class_call_check(this, File); - var _this; - _this = _super.call(this, path); - _this.content = content; - return _this; - } - return File; - }(FileSystemObject); - Test.File = File; - var Directory = /*#__PURE__*/ function(FileSystemObject) { - "use strict"; - _inherits(Directory, FileSystemObject); - var _super = _create_super(Directory); - function Directory() { - _class_call_check(this, Directory); - return _super.apply(this, arguments); - } - return Directory; - }(FileSystemObject); - Test.Directory = Directory; - var file = new File("foo/bar.txt", "foo"); - file.isNetworked = false; - file.isFSO = file.isFile; - file.isFile = true; - var x = file.isFile; - if (file.isFile) { - file.content; - if (file.isNetworked) { - file.host; - file.content; - } - } else if (file.isDirectory) { - file.children; - } else if (file.isNetworked) { - file.host; - } - var guard; - if (guard.isLeader) { - guard.lead(); - } else if (guard.isFollower) { - guard.follow(); - } - var general; - if (general.isMoreSpecific) { - general.do(); - } -})(Test || (Test = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.2.minified.js deleted file mode 100644 index 1773a81f905..00000000000 --- a/crates/swc/tests/tsc-references/typeGuardOfFormThisMember.2.minified.js +++ /dev/null @@ -1,54 +0,0 @@ -//// [typeGuardOfFormThisMember.ts] -var Test; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _instanceof from "@swc/helpers/src/_instanceof.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -!function(Test) { - var guard, general, FileSystemObject = function() { - "use strict"; - function FileSystemObject(path) { - _class_call_check(this, FileSystemObject), this.path = path; - } - return _create_class(FileSystemObject, [ - { - key: "isFile", - get: function() { - return _instanceof(this, File); - }, - set: function(param) {} - }, - { - key: "isDirectory", - get: function() { - return _instanceof(this, Directory); - } - } - ]), FileSystemObject; - }(); - Test.FileSystemObject = FileSystemObject; - var File = function(FileSystemObject) { - "use strict"; - _inherits(File, FileSystemObject); - var _super = _create_super(File); - function File(path, content) { - var _this; - return _class_call_check(this, File), (_this = _super.call(this, path)).content = content, _this; - } - return File; - }(FileSystemObject); - Test.File = File; - var Directory = function(FileSystemObject) { - "use strict"; - _inherits(Directory, FileSystemObject); - var _super = _create_super(Directory); - function Directory() { - return _class_call_check(this, Directory), _super.apply(this, arguments); - } - return Directory; - }(FileSystemObject); - Test.Directory = Directory; - var file = new File("foo/bar.txt", "foo"); - file.isNetworked = !1, file.isFSO = file.isFile, file.isFile = !0, file.isFile, file.isFile ? (file.content, file.isNetworked && (file.host, file.content)) : file.isDirectory ? file.children : file.isNetworked && file.host, guard.isLeader ? guard.lead() : guard.isFollower && guard.follow(), general.isMoreSpecific && general.do(); -}(Test || (Test = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.1.normal.js b/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.1.normal.js deleted file mode 100644 index 3cd93393b03..00000000000 --- a/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.1.normal.js +++ /dev/null @@ -1,65 +0,0 @@ -//// [typeGuardOfFormThisMemberErrors.ts] -// There's a 'File' class in the stdlib, wrap with a namespace to avoid collision -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _instanceof from "@swc/helpers/src/_instanceof.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -var Test; -(function(Test) { - var FileSystemObject = /*#__PURE__*/ function() { - "use strict"; - function FileSystemObject(path) { - _class_call_check(this, FileSystemObject); - this.path = path; - } - _create_class(FileSystemObject, [ - { - key: "isFile", - get: function get() { - return _instanceof(this, File); - }, - set: function set(param) { - // noop - } - }, - { - key: "isDirectory", - get: function get() { - return _instanceof(this, Directory); - } - } - ]); - return FileSystemObject; - }(); - Test.FileSystemObject = FileSystemObject; - var File = /*#__PURE__*/ function(FileSystemObject) { - "use strict"; - _inherits(File, FileSystemObject); - var _super = _create_super(File); - function File(path, content) { - _class_call_check(this, File); - var _this; - _this = _super.call(this, path); - _this.content = content; - return _this; - } - return File; - }(FileSystemObject); - Test.File = File; - var Directory = /*#__PURE__*/ function(FileSystemObject) { - "use strict"; - _inherits(Directory, FileSystemObject); - var _super = _create_super(Directory); - function Directory() { - _class_call_check(this, Directory); - return _super.apply(this, arguments); - } - return Directory; - }(FileSystemObject); - Test.Directory = Directory; - var file = new File("foo/bar.txt", "foo"); - file.isNetworked = file.isFile; - file.isFSO = file.isNetworked; - file.isFile = file.isFSO; -})(Test || (Test = {})); diff --git a/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.2.minified.js b/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.2.minified.js deleted file mode 100644 index 84a3fd5ae2a..00000000000 --- a/crates/swc/tests/tsc-references/typeGuardOfFormThisMemberErrors.2.minified.js +++ /dev/null @@ -1,54 +0,0 @@ -//// [typeGuardOfFormThisMemberErrors.ts] -var Test; -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _instanceof from "@swc/helpers/src/_instanceof.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -!function(Test) { - var FileSystemObject = function() { - "use strict"; - function FileSystemObject(path) { - _class_call_check(this, FileSystemObject), this.path = path; - } - return _create_class(FileSystemObject, [ - { - key: "isFile", - get: function() { - return _instanceof(this, File); - }, - set: function(param) {} - }, - { - key: "isDirectory", - get: function() { - return _instanceof(this, Directory); - } - } - ]), FileSystemObject; - }(); - Test.FileSystemObject = FileSystemObject; - var File = function(FileSystemObject) { - "use strict"; - _inherits(File, FileSystemObject); - var _super = _create_super(File); - function File(path, content) { - var _this; - return _class_call_check(this, File), (_this = _super.call(this, path)).content = content, _this; - } - return File; - }(FileSystemObject); - Test.File = File; - var Directory = function(FileSystemObject) { - "use strict"; - _inherits(Directory, FileSystemObject); - var _super = _create_super(Directory); - function Directory() { - return _class_call_check(this, Directory), _super.apply(this, arguments); - } - return Directory; - }(FileSystemObject); - Test.Directory = Directory; - var file = new File("foo/bar.txt", "foo"); - file.isNetworked = file.isFile, file.isFSO = file.isNetworked, file.isFile = file.isFSO; -}(Test || (Test = {})); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).1.normal.js deleted file mode 100644 index dc896fef33d..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).1.normal.js +++ /dev/null @@ -1,48 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D; -let C = (_C = class C { -}, _C.a = 1, _C.b = _C.a + 1, _C); -C = _ts_decorate([ - foo -], C); -let D = (_D = class D extends C { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}, _D.c = 2, _D.d = _D.c + 1, _D.e = _get(_get_prototype_of(_D), "a", _D) + _D.c + 1, _D.f = ()=>_D.c + 1, _D.ff = function() { - this.c + 1; -}, _D); -D = _ts_decorate([ - foo -], D); -class CC { -} -CC.a = 1; -CC.b = CC.a + 1; -class DD extends CC { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} -DD.c = 2; -DD.d = DD.c + 1; -DD.e = _get(_get_prototype_of(DD), "a", DD) + DD.c + 1; -DD.f = ()=>DD.c + 1; -DD.ff = function() { - this.c + 1; -}; diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).2.minified.js deleted file mode 100644 index 3ed50e3bf4a..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2015).2.minified.js +++ /dev/null @@ -1,43 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -var _C, _D; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = ((_C = class { -}).a = 1, _C.b = _C.a + 1, _C); -C = _ts_decorate([ - foo -], C); -let D = ((_D = class extends C { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}).c = 2, _D.d = _D.c + 1, _D.e = _get(_get_prototype_of(_D), "a", _D) + _D.c + 1, _D.f = ()=>_D.c + 1, _D.ff = function() { - this.c; -}, _D); -D = _ts_decorate([ - foo -], D); -class CC { -} -CC.a = 1, CC.b = CC.a + 1; -class DD extends CC { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} -DD.c = 2, DD.d = DD.c + 1, DD.e = _get(_get_prototype_of(DD), "a", DD) + DD.c + 1, DD.f = ()=>DD.c + 1, DD.ff = function() { - this.c; -}; diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).1.normal.js deleted file mode 100644 index 99edb087284..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).1.normal.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class C { - static a = 1; - static b = this.a + 1; -}; -C = _ts_decorate([ - foo -], C); -let D = class D extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c + 1; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}; -D = _ts_decorate([ - foo -], D); -class CC { - static a = 1; - static b = this.a + 1; -} -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c + 1; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).2.minified.js deleted file mode 100644 index 2877e858558..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es2022).2.minified.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class { - static a = 1; - static b = this.a + 1; -}; -C = _ts_decorate([ - foo -], C); -let D = class extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}; -D = _ts_decorate([ - foo -], D); -class CC { - static a = 1; - static b = this.a + 1; -} -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js deleted file mode 100644 index e032a5f6d4b..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).1.normal.js +++ /dev/null @@ -1,86 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D; -var C = (_C = function C() { - "use strict"; - _class_call_check(this, C); -}, _C.a = 1, _C.b = _C.a + 1, _C); -C = _ts_decorate([ - foo -], C); -var D = (_D = /*#__PURE__*/ function(C) { - "use strict"; - _inherits(D, C); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - return _super.apply(this, arguments); - } - D.foo = function foo1() { - return this.c + 1; - }; - _create_class(D, null, [ - { - key: "fa", - get: function get() { - return this.c + 1; - }, - set: function set(v) { - this.c = v + 1; - } - } - ]); - return D; -}(C), _D.c = 2, _D.d = _D.c + 1, _D.e = _get(_get_prototype_of(_D), "a", _D) + _D.c + 1, _D.f = function() { - return _D.c + 1; -}, _D.ff = function D() { - this.c + 1; -}, _D); -D = _ts_decorate([ - foo -], D); -var CC = function CC() { - "use strict"; - _class_call_check(this, CC); -}; -CC.a = 1; -CC.b = CC.a + 1; -var DD = /*#__PURE__*/ function(CC) { - "use strict"; - _inherits(DD, CC); - var _super = _create_super(DD); - function DD() { - _class_call_check(this, DD); - return _super.apply(this, arguments); - } - DD.foo = function foo1() { - return this.c + 1; - }; - _create_class(DD, null, [ - { - key: "fa", - get: function get() { - return this.c + 1; - }, - set: function set(v) { - this.c = v + 1; - } - } - ]); - return DD; -}(CC); -DD.c = 2; -DD.d = DD.c + 1; -DD.e = _get(_get_prototype_of(DD), "a", DD) + DD.c + 1; -DD.f = function() { - return DD.c + 1; -}; -DD.ff = function() { - this.c + 1; -}; diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js deleted file mode 100644 index a9cdbda9e50..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers10(target=es5).2.minified.js +++ /dev/null @@ -1,72 +0,0 @@ -//// [typeOfThisInStaticMembers10.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D, C = ((_C = function C() { - "use strict"; - _class_call_check(this, C); -}).a = 1, _C.b = _C.a + 1, _C), D = ((_D = function(C) { - "use strict"; - _inherits(D, C); - var _super = _create_super(D); - function D() { - return _class_call_check(this, D), _super.apply(this, arguments); - } - return D.foo = function() { - return this.c + 1; - }, _create_class(D, null, [ - { - key: "fa", - get: function() { - return this.c + 1; - }, - set: function(v) { - this.c = v + 1; - } - } - ]), D; -}(C = _ts_decorate([ - foo -], C))).c = 2, _D.d = _D.c + 1, _D.e = _get(_get_prototype_of(_D), "a", _D) + _D.c + 1, _D.f = function() { - return _D.c + 1; -}, _D.ff = function() { - this.c; -}, _D); -D = _ts_decorate([ - foo -], D); -var CC = function CC() { - "use strict"; - _class_call_check(this, CC); -}; -CC.a = 1, CC.b = CC.a + 1; -var DD = function(CC) { - "use strict"; - _inherits(DD, CC); - var _super = _create_super(DD); - function DD() { - return _class_call_check(this, DD), _super.apply(this, arguments); - } - return DD.foo = function() { - return this.c + 1; - }, _create_class(DD, null, [ - { - key: "fa", - get: function() { - return this.c + 1; - }, - set: function(v) { - this.c = v + 1; - } - } - ]), DD; -}(CC); -DD.c = 2, DD.d = DD.c + 1, DD.e = _get(_get_prototype_of(DD), "a", DD) + DD.c + 1, DD.f = function() { - return DD.c + 1; -}, DD.ff = function() { - this.c; -}; diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).1.normal.js deleted file mode 100644 index eb5906809f3..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).1.normal.js +++ /dev/null @@ -1,49 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D; -let C = (_C = class C { -}, _define_property(_C, "a", 1), _define_property(_C, "b", _C.a + 1), _C); -C = _ts_decorate([ - foo -], C); -let D = (_D = class D extends C { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}, _define_property(_D, "c", 2), _define_property(_D, "d", _D.c + 1), _define_property(_D, "e", _get(_get_prototype_of(_D), "a", _D) + _D.c + 1), _define_property(_D, "f", ()=>_D.c + 1), _define_property(_D, "ff", function() { - this.c + 1; -}), _D); -D = _ts_decorate([ - foo -], D); -class CC { -} -_define_property(CC, "a", 1); -_define_property(CC, "b", CC.a + 1); -class DD extends CC { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} -_define_property(DD, "c", 2); -_define_property(DD, "d", DD.c + 1); -_define_property(DD, "e", _get(_get_prototype_of(DD), "a", DD) + DD.c + 1); -_define_property(DD, "f", ()=>DD.c + 1); -_define_property(DD, "ff", function() { - this.c + 1; -}); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).2.minified.js deleted file mode 100644 index 5e293ae0ce4..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2015).2.minified.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -var _C, _D; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = (_define_property(_C = class { -}, "a", 1), _define_property(_C, "b", _C.a + 1), _C); -C = _ts_decorate([ - foo -], C); -let D = (_define_property(_D = class extends C { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}, "c", 2), _define_property(_D, "d", _D.c + 1), _define_property(_D, "e", _get(_get_prototype_of(_D), "a", _D) + _D.c + 1), _define_property(_D, "f", ()=>_D.c + 1), _define_property(_D, "ff", function() { - this.c; -}), _D); -D = _ts_decorate([ - foo -], D); -class CC { -} -_define_property(CC, "a", 1), _define_property(CC, "b", CC.a + 1); -class DD extends CC { - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} -_define_property(DD, "c", 2), _define_property(DD, "d", DD.c + 1), _define_property(DD, "e", _get(_get_prototype_of(DD), "a", DD) + DD.c + 1), _define_property(DD, "f", ()=>DD.c + 1), _define_property(DD, "ff", function() { - this.c; -}); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).1.normal.js deleted file mode 100644 index 7eefe475630..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).1.normal.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class C { - static a = 1; - static b = this.a + 1; -}; -C = _ts_decorate([ - foo -], C); -let D = class D extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c + 1; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}; -D = _ts_decorate([ - foo -], D); -class CC { - static a = 1; - static b = this.a + 1; -} -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c + 1; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).2.minified.js deleted file mode 100644 index f8f9f21a86e..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es2022).2.minified.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -let C = class { - static a = 1; - static b = this.a + 1; -}; -C = _ts_decorate([ - foo -], C); -let D = class extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -}; -D = _ts_decorate([ - foo -], D); -class CC { - static a = 1; - static b = this.a + 1; -} -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = ()=>this.c + 1; - static ff = function() { - this.c; - }; - static foo() { - return this.c + 1; - } - static get fa() { - return this.c + 1; - } - static set fa(v) { - this.c = v + 1; - } -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js deleted file mode 100644 index ed4bb25abe1..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).1.normal.js +++ /dev/null @@ -1,93 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D; -var C = (_C = function C() { - "use strict"; - _class_call_check(this, C); -}, _define_property(_C, "a", 1), _define_property(_C, "b", _C.a + 1), _C); -C = _ts_decorate([ - foo -], C); -var D = (_D = /*#__PURE__*/ function(C) { - "use strict"; - _inherits(D, C); - var _super = _create_super(D); - function D() { - _class_call_check(this, D); - return _super.apply(this, arguments); - } - _create_class(D, null, [ - { - key: "foo", - value: function foo1() { - return this.c + 1; - } - }, - { - key: "fa", - get: function get() { - return this.c + 1; - }, - set: function set(v) { - this.c = v + 1; - } - } - ]); - return D; -}(C), _define_property(_D, "c", 2), _define_property(_D, "d", _D.c + 1), _define_property(_D, "e", _get(_get_prototype_of(_D), "a", _D) + _D.c + 1), _define_property(_D, "f", function() { - return _D.c + 1; -}), _define_property(_D, "ff", function() { - this.c + 1; -}), _D); -D = _ts_decorate([ - foo -], D); -var CC = function CC() { - "use strict"; - _class_call_check(this, CC); -}; -_define_property(CC, "a", 1); -_define_property(CC, "b", CC.a + 1); -var DD = /*#__PURE__*/ function(CC) { - "use strict"; - _inherits(DD, CC); - var _super = _create_super(DD); - function DD() { - _class_call_check(this, DD); - return _super.apply(this, arguments); - } - _create_class(DD, null, [ - { - key: "foo", - value: function foo1() { - return this.c + 1; - } - }, - { - key: "fa", - get: function get() { - return this.c + 1; - }, - set: function set(v) { - this.c = v + 1; - } - } - ]); - return DD; -}(CC); -_define_property(DD, "c", 2); -_define_property(DD, "d", DD.c + 1); -_define_property(DD, "e", _get(_get_prototype_of(DD), "a", DD) + DD.c + 1); -_define_property(DD, "f", function() { - return DD.c + 1; -}); -_define_property(DD, "ff", function() { - this.c + 1; -}); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js deleted file mode 100644 index 5ce7a103486..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers11(target=es5).2.minified.js +++ /dev/null @@ -1,81 +0,0 @@ -//// [typeOfThisInStaticMembers11.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _create_class from "@swc/helpers/src/_create_class.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -import _get from "@swc/helpers/src/_get.mjs"; -import _get_prototype_of from "@swc/helpers/src/_get_prototype_of.mjs"; -import _inherits from "@swc/helpers/src/_inherits.mjs"; -import _create_super from "@swc/helpers/src/_create_super.mjs"; -import _ts_decorate from "@swc/helpers/src/_ts_decorate.mjs"; -var _C, _D, C = (_define_property(_C = function C() { - "use strict"; - _class_call_check(this, C); -}, "a", 1), _define_property(_C, "b", _C.a + 1), _C), D = (_define_property(_D = function(C) { - "use strict"; - _inherits(D, C); - var _super = _create_super(D); - function D() { - return _class_call_check(this, D), _super.apply(this, arguments); - } - return _create_class(D, null, [ - { - key: "foo", - value: function() { - return this.c + 1; - } - }, - { - key: "fa", - get: function() { - return this.c + 1; - }, - set: function(v) { - this.c = v + 1; - } - } - ]), D; -}(C = _ts_decorate([ - foo -], C)), "c", 2), _define_property(_D, "d", _D.c + 1), _define_property(_D, "e", _get(_get_prototype_of(_D), "a", _D) + _D.c + 1), _define_property(_D, "f", function() { - return _D.c + 1; -}), _define_property(_D, "ff", function() { - this.c; -}), _D); -D = _ts_decorate([ - foo -], D); -var CC = function CC() { - "use strict"; - _class_call_check(this, CC); -}; -_define_property(CC, "a", 1), _define_property(CC, "b", CC.a + 1); -var DD = function(CC) { - "use strict"; - _inherits(DD, CC); - var _super = _create_super(DD); - function DD() { - return _class_call_check(this, DD), _super.apply(this, arguments); - } - return _create_class(DD, null, [ - { - key: "foo", - value: function() { - return this.c + 1; - } - }, - { - key: "fa", - get: function() { - return this.c + 1; - }, - set: function(v) { - this.c = v + 1; - } - } - ]), DD; -}(CC); -_define_property(DD, "c", 2), _define_property(DD, "d", DD.c + 1), _define_property(DD, "e", _get(_get_prototype_of(DD), "a", DD) + DD.c + 1), _define_property(DD, "f", function() { - return DD.c + 1; -}), _define_property(DD, "ff", function() { - this.c; -}); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).1.normal.js deleted file mode 100644 index afb1dfe7002..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).1.normal.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -let _this_c, _this_c1; -var _Inner; -class C { -} -C.c = "foo"; -C.bar = (_this_c = C.c, _this_c1 = C.c, _Inner = class Inner { - constructor(){ - this[_this_c1] = 123; - } -}, _Inner[_this_c] = 123, _Inner); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).2.minified.js deleted file mode 100644 index 268a28aee94..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2015).2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -var _Inner; -let _this_c, _this_c1; -class C { -} -C.c = "foo", C.bar = (_this_c = C.c, _this_c1 = C.c, (_Inner = class { - constructor(){ - this[_this_c1] = 123; - } -})[_this_c] = 123, _Inner); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).1.normal.js deleted file mode 100644 index 781fd2ab86b..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -class C { - static c = "foo"; - static bar = class Inner { - static [this.c] = 123; - [this.c] = 123; - }; -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).2.minified.js deleted file mode 100644 index 75c66bef271..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es2022).2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -class C { - static c = "foo"; - static bar = class { - static [this.c] = 123; - [this.c] = 123; - }; -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).1.normal.js deleted file mode 100644 index 77492bf1a06..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).1.normal.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var _this_c, _this_c1; -var _Inner; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; -C.c = "foo"; -C.bar = (_this_c = C.c, _this_c1 = C.c, _Inner = function Inner() { - "use strict"; - _class_call_check(this, Inner); - this[_this_c1] = 123; -}, _Inner[_this_c] = 123, _Inner); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).2.minified.js deleted file mode 100644 index b006ea28596..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers12(target=es5).2.minified.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [typeOfThisInStaticMembers12.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -var _this_c, _this_c1, _Inner, C = function C() { - "use strict"; - _class_call_check(this, C); -}; -C.c = "foo", C.bar = (_this_c = C.c, _this_c1 = C.c, (_Inner = function Inner() { - "use strict"; - _class_call_check(this, Inner), this[_this_c1] = 123; -})[_this_c] = 123, _Inner); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).1.normal.js deleted file mode 100644 index 1607299e3bb..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).1.normal.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -import _define_property from "@swc/helpers/src/_define_property.mjs"; -let _this_c, _this_c1; -var _Inner; -class C { -} -_define_property(C, "c", "foo"); -_define_property(C, "bar", (_this_c = C.c, _this_c1 = C.c, _Inner = class Inner { - constructor(){ - _define_property(this, _this_c1, 123); - } -}, _define_property(_Inner, _this_c, 123), _Inner)); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).2.minified.js deleted file mode 100644 index 533beae2773..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2015).2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -var _Inner; -let _this_c, _this_c1; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -class C { -} -_define_property(C, "c", "foo"), _define_property(C, "bar", (_this_c = C.c, _this_c1 = C.c, _Inner = class { - constructor(){ - _define_property(this, _this_c1, 123); - } -}, _define_property(_Inner, _this_c, 123), _Inner)); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).1.normal.js deleted file mode 100644 index 310bcf0a1a1..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -class C { - static c = "foo"; - static bar = class Inner { - static [this.c] = 123; - [this.c] = 123; - }; -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).2.minified.js deleted file mode 100644 index 4a0502ac82d..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es2022).2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -class C { - static c = "foo"; - static bar = class { - static [this.c] = 123; - [this.c] = 123; - }; -} diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).1.normal.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).1.normal.js deleted file mode 100644 index 7bfbaf07592..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).1.normal.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -var _this_c, _this_c1; -var _Inner; -var C = function C() { - "use strict"; - _class_call_check(this, C); -}; -_define_property(C, "c", "foo"); -_define_property(C, "bar", (_this_c = C.c, _this_c1 = C.c, _Inner = function Inner() { - "use strict"; - _class_call_check(this, Inner); - _define_property(this, _this_c1, 123); -}, _define_property(_Inner, _this_c, 123), _Inner)); diff --git a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).2.minified.js b/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).2.minified.js deleted file mode 100644 index 1e88a5887d8..00000000000 --- a/crates/swc/tests/tsc-references/typeOfThisInStaticMembers13(target=es5).2.minified.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [typeOfThisInStaticMembers13.ts] -import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; -import _define_property from "@swc/helpers/src/_define_property.mjs"; -var _this_c, _this_c1, _Inner, C = function C() { - "use strict"; - _class_call_check(this, C); -}; -_define_property(C, "c", "foo"), _define_property(C, "bar", (_this_c = C.c, _this_c1 = C.c, _Inner = function Inner() { - "use strict"; - _class_call_check(this, Inner), _define_property(this, _this_c1, 123); -}, _define_property(_Inner, _this_c, 123), _Inner)); diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge1.1.normal.js b/crates/swc/tests/tsc-references/typeOnlyMerge1.1.normal.js new file mode 100644 index 00000000000..cbf7c6fcf59 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge1.1.normal.js @@ -0,0 +1,18 @@ +//// [a.ts] +export { }; +//// [b.ts] +//! +//! x the name `A` is defined multiple times +//! ,-[1:1] +//! 1 | import { A } from "./a"; +//! : | +//! : `-- previous definition of `A` here +//! 2 | const A = 0; +//! : | +//! : `-- `A` redefined here +//! 3 | export { A }; +//! 4 | +//! `---- +//// [c.ts] +import { A } from "./b"; +A; diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge1.2.minified.js b/crates/swc/tests/tsc-references/typeOnlyMerge1.2.minified.js new file mode 100644 index 00000000000..4a6c1fe3935 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge1.2.minified.js @@ -0,0 +1,17 @@ +//// [a.ts] +export { }; +//// [b.ts] +//! +//! x the name `A` is defined multiple times +//! ,-[1:1] +//! 1 | import { A } from "./a"; +//! : | +//! : `-- previous definition of `A` here +//! 2 | const A = 0; +//! : | +//! : `-- `A` redefined here +//! 3 | export { A }; +//! 4 | +//! `---- +//// [c.ts] +import { A } from "./b"; diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge2.1.normal.js b/crates/swc/tests/tsc-references/typeOnlyMerge2.1.normal.js new file mode 100644 index 00000000000..affe5354364 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge2.1.normal.js @@ -0,0 +1,10 @@ +//// [a.ts] +var A = {}; +export { A }; +//// [b.ts] +export { }; +//// [c.ts] +import { A } from "./b"; +//// [d.ts] +import { A } from "./c"; +A; diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge2.2.minified.js b/crates/swc/tests/tsc-references/typeOnlyMerge2.2.minified.js new file mode 100644 index 00000000000..b667bf49726 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge2.2.minified.js @@ -0,0 +1,9 @@ +//// [a.ts] +var A = {}; +export { A }; +//// [b.ts] +export { }; +//// [c.ts] +import "./b"; +//// [d.ts] +import { A } from "./c"; diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge3.1.normal.js b/crates/swc/tests/tsc-references/typeOnlyMerge3.1.normal.js new file mode 100644 index 00000000000..207c1c2748f --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge3.1.normal.js @@ -0,0 +1,14 @@ +//// [a.ts] +function A() {} +export { }; +//// [b.ts] +var A; +(function(A) { + var displayName = A.displayName = "A"; +})(A || (A = {})); +export { A }; +//// [c.ts] +import { A } from "./b"; +A; +A.displayName; +A(); diff --git a/crates/swc/tests/tsc-references/typeOnlyMerge3.2.minified.js b/crates/swc/tests/tsc-references/typeOnlyMerge3.2.minified.js new file mode 100644 index 00000000000..f0b10e19c5f --- /dev/null +++ b/crates/swc/tests/tsc-references/typeOnlyMerge3.2.minified.js @@ -0,0 +1,9 @@ +//// [a.ts] +export { }; +//// [b.ts] +var A; +(A || (A = {})).displayName = "A"; +export { A }; +//// [c.ts] +import { A } from "./b"; +A.displayName, A(); diff --git a/crates/swc/tests/tsc-references/typeParameterConstModifiers.1.normal.js b/crates/swc/tests/tsc-references/typeParameterConstModifiers.1.normal.js deleted file mode 100644 index 705d745fd2f..00000000000 --- a/crates/swc/tests/tsc-references/typeParameterConstModifiers.1.normal.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [typeParameterConstModifiers.ts] -//! -//! x 'const' modifier can only appear on a type parameter of a function, method or class -//! ,-[41:1] -//! 41 | const fx1 = (x: T) => x; -//! 42 | const fx2 = (x: T) => x; -//! 43 | -//! 44 | interface I1 { x: T } // Error -//! : ^^^^^ -//! 45 | -//! 46 | interface I2 { -//! 47 | f(x: T): T; -//! `---- -//! -//! x 'const' modifier can only appear on a type parameter of a function, method or class -//! ,-[47:1] -//! 47 | f(x: T): T; -//! 48 | } -//! 49 | -//! 50 | type T1 = T; // Error -//! : ^^^^^ -//! 51 | -//! 52 | type T2 = (x: T) => T; -//! 53 | type T3 = { (x: T): T }; -//! `---- diff --git a/crates/swc/tests/tsc-references/typeParameterConstModifiers.2.minified.js b/crates/swc/tests/tsc-references/typeParameterConstModifiers.2.minified.js deleted file mode 100644 index 705d745fd2f..00000000000 --- a/crates/swc/tests/tsc-references/typeParameterConstModifiers.2.minified.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [typeParameterConstModifiers.ts] -//! -//! x 'const' modifier can only appear on a type parameter of a function, method or class -//! ,-[41:1] -//! 41 | const fx1 = (x: T) => x; -//! 42 | const fx2 = (x: T) => x; -//! 43 | -//! 44 | interface I1 { x: T } // Error -//! : ^^^^^ -//! 45 | -//! 46 | interface I2 { -//! 47 | f(x: T): T; -//! `---- -//! -//! x 'const' modifier can only appear on a type parameter of a function, method or class -//! ,-[47:1] -//! 47 | f(x: T): T; -//! 48 | } -//! 49 | -//! 50 | type T1 = T; // Error -//! : ^^^^^ -//! 51 | -//! 52 | type T2 = (x: T) => T; -//! 53 | type T3 = { (x: T): T }; -//! `---- diff --git a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.1.normal.js b/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.1.normal.js deleted file mode 100644 index 08de8f4430f..00000000000 --- a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.1.normal.js +++ /dev/null @@ -1,2 +0,0 @@ -//// [typePredicateOnVariableDeclaration01.ts] -var x; diff --git a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.2.minified.js b/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.2.minified.js deleted file mode 100644 index 76513c2dfa1..00000000000 --- a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration01.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [typePredicateOnVariableDeclaration01.ts] diff --git a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.1.normal.js b/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.1.normal.js deleted file mode 100644 index 30ec9ccd174..00000000000 --- a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.1.normal.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typePredicateOnVariableDeclaration02.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | -//! 2 | var y: z is number; -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.2.minified.js b/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.2.minified.js deleted file mode 100644 index 30ec9ccd174..00000000000 --- a/crates/swc/tests/tsc-references/typePredicateOnVariableDeclaration02.2.minified.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [typePredicateOnVariableDeclaration02.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | -//! 2 | var y: z is number; -//! : ^^ -//! `---- diff --git a/crates/swc/tests/tsc-references/typeSatisfaction.1.normal.js b/crates/swc/tests/tsc-references/typeSatisfaction.1.normal.js deleted file mode 100644 index 6ccf99c0097..00000000000 --- a/crates/swc/tests/tsc-references/typeSatisfaction.1.normal.js +++ /dev/null @@ -1,26 +0,0 @@ -//// [typeSatisfaction.ts] -var t1 = { - a: 1 -}; // Ok -var t2 = { - a: 1, - b: 1 -}; // Error -var t3 = {}; // Error -var t4 = { - a: "a" -}; // Ok -var t5 = function(m) { - return m.substring(0); -}; // Ok -var t6 = [ - 1, - 2 -]; -var t7 = { - a: "test" -}; -var t8 = { - a: "test", - b: "test" -}; diff --git a/crates/swc/tests/tsc-references/typeSatisfaction.2.minified.js b/crates/swc/tests/tsc-references/typeSatisfaction.2.minified.js deleted file mode 100644 index b5194cb6997..00000000000 --- a/crates/swc/tests/tsc-references/typeSatisfaction.2.minified.js +++ /dev/null @@ -1 +0,0 @@ -//// [typeSatisfaction.ts] diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.1.normal.js b/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.1.normal.js new file mode 100644 index 00000000000..4b39cc57c86 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.1.normal.js @@ -0,0 +1,9 @@ +//// [typeSatisfaction_contextualTyping2.ts] +var obj = { + f: function f(s) {}, + g: function g(s) {} +}; +// This needs to not crash (outer node is not expression) +({ + f: function f(x) {} +}); diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.2.minified.js b/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.2.minified.js new file mode 100644 index 00000000000..e6bbda582a2 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeSatisfaction_contextualTyping2.2.minified.js @@ -0,0 +1 @@ +//// [typeSatisfaction_contextualTyping2.ts] diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.1.normal.js b/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.1.normal.js new file mode 100644 index 00000000000..07cb6bc8fbe --- /dev/null +++ b/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.1.normal.js @@ -0,0 +1,5 @@ +//// [typeSatisfaction_vacuousIntersectionOfContextualTypes.ts] +var a = "foo"; +var b = { + xyz: "foo" +}; diff --git a/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.2.minified.js b/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.2.minified.js new file mode 100644 index 00000000000..d967cc824fc --- /dev/null +++ b/crates/swc/tests/tsc-references/typeSatisfaction_vacuousIntersectionOfContextualTypes.2.minified.js @@ -0,0 +1 @@ +//// [typeSatisfaction_vacuousIntersectionOfContextualTypes.ts] diff --git a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js new file mode 100644 index 00000000000..82eccf1f785 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.1.normal.js @@ -0,0 +1,18 @@ +//// [typeofImportTypeOnlyExport.ts] +//// [button.ts] +import { classMap } from "./lit.js"; +export var c = classMap(); +//// [lit.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +var ClassMapDirective = function ClassMapDirective() { + "use strict"; + _class_call_check(this, ClassMapDirective); +}; +export var directive = function(class_) { + return function() { + return { + directive: class_ + }; + }; +}; +export var classMap = directive(ClassMapDirective); diff --git a/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js new file mode 100644 index 00000000000..433ff1a41c9 --- /dev/null +++ b/crates/swc/tests/tsc-references/typeofImportTypeOnlyExport.2.minified.js @@ -0,0 +1,17 @@ +//// [typeofImportTypeOnlyExport.ts] +//// [button.ts] +import { classMap } from "./lit.js"; +export var c = classMap(); +//// [lit.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +export var directive = function(class_) { + return function() { + return { + directive: class_ + }; + }; +}; +export var classMap = directive(function ClassMapDirective() { + "use strict"; + _class_call_check(this, ClassMapDirective); +}); diff --git a/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.1.normal.js deleted file mode 100644 index af522d960d4..00000000000 --- a/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.1.normal.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [typeofOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // Unary operator typeof -//! 2 | -//! 3 | // opreand before typeof -//! 4 | var ANY = ANY typeof ; //expect error -//! : ^^^^^^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! `---- -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | // Unary operator typeof -//! 2 | -//! 3 | // opreand before typeof -//! 4 | var ANY = ANY typeof ; //expect error -//! : ^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! `---- -//! -//! x Expression expected -//! ,-[4:1] -//! 4 | var ANY = ANY typeof ; //expect error -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.2.minified.js deleted file mode 100644 index af522d960d4..00000000000 --- a/crates/swc/tests/tsc-references/typeofOperatorInvalidOperations.2.minified.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [typeofOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // Unary operator typeof -//! 2 | -//! 3 | // opreand before typeof -//! 4 | var ANY = ANY typeof ; //expect error -//! : ^^^^^^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! `---- -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | // Unary operator typeof -//! 2 | -//! 3 | // opreand before typeof -//! 4 | var ANY = ANY typeof ; //expect error -//! : ^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! `---- -//! -//! x Expression expected -//! ,-[4:1] -//! 4 | var ANY = ANY typeof ; //expect error -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = typeof ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference3.1.normal.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference3.1.normal.js index 1d413438cae..35923a2ec03 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference3.1.normal.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference3.1.normal.js @@ -19,4 +19,5 @@ let x2 = foo2(sa); // unknown let y2 = foo2(sx); // { extra: number } withRouter(MyComponent); let z = foo(ab); // [AB, string] +a = b; export { }; diff --git a/crates/swc/tests/tsc-references/unionAndIntersectionInference3.2.minified.js b/crates/swc/tests/tsc-references/unionAndIntersectionInference3.2.minified.js index 39dbc79aaab..08cb5ff1976 100644 --- a/crates/swc/tests/tsc-references/unionAndIntersectionInference3.2.minified.js +++ b/crates/swc/tests/tsc-references/unionAndIntersectionInference3.2.minified.js @@ -3,5 +3,5 @@ concatMaybe([ 1, 2, 3 -], 4), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab); +], 4), f2 = f1 = f2, g2 = g1 = g2, foo1(sa), foo1(sx), foo2(sa), foo2(sx), withRouter(MyComponent), foo(ab), a = b; export { }; diff --git a/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js b/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js new file mode 100644 index 00000000000..253d9aef0b4 --- /dev/null +++ b/crates/swc/tests/tsc-references/unknownControlFlow.1.normal.js @@ -0,0 +1,323 @@ +//// [unknownControlFlow.ts] +function f01(u) { + var x1 = u; // Error + var x2 = u; + var x3 = u; + var x4 = u; +} +function f10(x) { + if (x) { + x; // {} + } else { + x; // unknown + } + if (!x) { + x; // unknown + } else { + x; // {} + } +} +function f11(x) { + if (x) { + x; // T & {} + } else { + x; // T + } + if (!x) { + x; // T + } else { + x; // T & {} + } +} +function f12(x) { + if (x) { + x; // T + } else { + x; // T + } +} +function f20(x) { + if (x !== undefined) { + x; // {} | null + } else { + x; // undefined + } + if (x !== null) { + x; // {} | undefined + } else { + x; // null + } + if (x !== undefined && x !== null) { + x; // {} + } else { + x; // null | undefined + } + if (x != undefined) { + x; // {} + } else { + x; // null | undefined + } + if (x != null) { + x; // {} + } else { + x; // null | undefined + } +} +function f21(x) { + if (x !== undefined) { + x; // T & ({} | null) + } else { + x; // T + } + if (x !== null) { + x; // T & ({} | undefined) + } else { + x; // T + } + if (x !== undefined && x !== null) { + x; // T & {} + } else { + x; // T + } + if (x != undefined) { + x; // T & {} + } else { + x; // T + } + if (x != null) { + x; // T & {} + } else { + x; // T + } +} +function f22(x) { + if (x !== undefined) { + x; // T & {} + } else { + x; // T + } + if (x !== null) { + x; // T + } else { + x; // T + } + if (x !== undefined && x !== null) { + x; // T & {} + } else { + x; // T + } + if (x != undefined) { + x; // T & {} + } else { + x; // T + } + if (x != null) { + x; // T & {} + } else { + x; // T + } +} +function f23(x) { + if (x !== undefined) { + x; // T & {} | null + } + if (x !== null) { + x; // T & {} | undefined + } + if (x != undefined) { + x; // T & {} + } + if (x != null) { + x; // T & {} + } +} +function f30(x) { + if (typeof x === "object") { + x; // object + } +} +function f31(x) { + if (typeof x === "object") { + x; // T & object | T & null + } + if (x && typeof x === "object") { + x; // T & object + } + if (typeof x === "object" && x) { + x; // T & object + } +} +function f32(x) { + if (typeof x === "object") { + x; // T & object + } +} +function possiblyNull(x) { + return !!true ? x : null; // T | null +} +function possiblyUndefined(x) { + return !!true ? x : undefined; // T | undefined +} +function possiblyNullOrUndefined(x) { + return possiblyUndefined(possiblyNull(x)); // T | null | undefined +} +function ensureNotNull(x) { + if (x === null) throw Error(); + return x; // T & ({} | undefined) +} +function ensureNotUndefined(x) { + if (x === undefined) throw Error(); + return x; // T & ({} | null) +} +function ensureNotNullOrUndefined(x) { + return ensureNotUndefined(ensureNotNull(x)); // T & {} +} +function f40(a, b) { + var a1 = ensureNotNullOrUndefined(a); // string + var b1 = ensureNotNullOrUndefined(b); // number +} +function f41(a) { + var a1 = ensureNotUndefined(ensureNotNull(a)); // T & {} + var a2 = ensureNotNull(ensureNotUndefined(a)); // T & {} + var a3 = ensureNotNull(ensureNotNull(a)); // T & {} | T & undefined + var a4 = ensureNotUndefined(ensureNotUndefined(a)); // T & {} | T & null + var a5 = ensureNotNullOrUndefined(ensureNotNullOrUndefined(a)); // T & {} + var a6 = ensureNotNull(possiblyNullOrUndefined(a)); // T & {} | undefined + var a7 = ensureNotUndefined(possiblyNullOrUndefined(a)); // T & {} | null + var a8 = ensureNotNull(possiblyUndefined(a)); // T & {} | undefined + var a9 = ensureNotUndefined(possiblyNull(a)); // T & {} | null +} +// Repro from #48468 +function deepEquals(a, b) { + if (typeof a !== "object" || typeof b !== "object" || !a || !b) { + return false; + } + if (Array.isArray(a) || Array.isArray(b)) { + return false; + } + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + return true; +} +// Repro from #49386 +function foo(x) { + var y = x; + if (y !== null) { + y; + } +} +// We allow an unconstrained object of a generic type `T` to be indexed by a key of type `keyof T` +// without a check that the object is non-undefined and non-null. This is safe because `keyof T` +// is `never` (meaning no possible keys) for any `T` that includes `undefined` or `null`. +function ff1(t, k) { + t[k]; +} +function ff2(t, k) { + t[k]; +} +function ff3(t, k) { + t[k]; // Error +} +function ff4(t, k) { + t[k]; +} +ff1(null, "foo"); // Error +ff2(null, "foo"); // Error +ff3(null, "foo"); +ff4(null, "foo"); // Error +// Generics and intersections with {} +function fx0(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +function fx1(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +function fx2(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +function fx3(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +function fx4(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +function fx5(value) { + if (value === 42) { + value; // T & {} + } else { + value; // T & ({} | null) + } +} +// Double-equals narrowing +function fx10(x, y) { + if (x == y) { + x; // string | number + } else { + x; // string | number + } + if (x != y) { + x; // string | number + } else { + x; // string | number + } +} +// Repros from #50706 +function SendBlob(encoding) { + if (encoding !== undefined && encoding !== "utf8") { + throw new Error("encoding"); + } + encoding; +} +function doSomething1(value) { + if (value === undefined) { + return value; + } + if (value === 42) { + throw Error("Meaning of life value"); + } + return value; +} +function doSomething2(value) { + if (value === undefined) { + return; + } + if (value === 42) { + value; + } +} +function x(x, y) { + var r2 = y; +} +function assertNever(v) { + throw new Error("never"); +} +function fx20(value) { + if (value === "left") { + var foo = value; + } else if (value === "right") { + var bar = value; + } else { + assertNever(value); + } +} diff --git a/crates/swc/tests/tsc-references/unknownControlFlow.2.minified.js b/crates/swc/tests/tsc-references/unknownControlFlow.2.minified.js new file mode 100644 index 00000000000..3d28118a419 --- /dev/null +++ b/crates/swc/tests/tsc-references/unknownControlFlow.2.minified.js @@ -0,0 +1,2 @@ +//// [unknownControlFlow.ts] +null.foo, null.foo, null.foo, null.foo; diff --git a/crates/swc/tests/tsc-references/valuesMergingAcrossModules.1.normal.js b/crates/swc/tests/tsc-references/valuesMergingAcrossModules.1.normal.js new file mode 100644 index 00000000000..838a7e07da5 --- /dev/null +++ b/crates/swc/tests/tsc-references/valuesMergingAcrossModules.1.normal.js @@ -0,0 +1,13 @@ +//// [a.ts] +function A() {} +export { A }; +//// [b.ts] +import { A } from "./a"; +//// [c.ts] +var A; +(function(A) { + var displayName = A.displayName = "A"; +})(A || (A = {})); +A(); +A.displayName; +export { }; diff --git a/crates/swc/tests/tsc-references/valuesMergingAcrossModules.2.minified.js b/crates/swc/tests/tsc-references/valuesMergingAcrossModules.2.minified.js new file mode 100644 index 00000000000..9e635867dac --- /dev/null +++ b/crates/swc/tests/tsc-references/valuesMergingAcrossModules.2.minified.js @@ -0,0 +1,9 @@ +//// [a.ts] +function A() {} +export { A }; +//// [b.ts] +import "./a"; +//// [c.ts] +var A; +(A || (A = {})).displayName = "A", A(), A.displayName; +export { }; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.1.normal.js new file mode 100644 index 00000000000..1f0faff5ef1 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.1.normal.js @@ -0,0 +1,8 @@ +//// [verbatimModuleSyntaxCompat.ts] +System.register([], function(_export, _context) { + "use strict"; + return { + setters: [], + execute: function() {} + }; +}); diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.2.minified.js new file mode 100644 index 00000000000..1835c104939 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxCompat.2.minified.js @@ -0,0 +1,7 @@ +//// [verbatimModuleSyntaxCompat.ts] +System.register([], function(_export, _context) { + return { + setters: [], + execute: function() {} + }; +}); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3.d.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.1.normal.js similarity index 52% rename from crates/swc/tests/tsc-references/parserEnumDeclaration3.d.1.normal.js rename to crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.1.normal.js index 2015b25280d..e31a7ba710c 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3.d.1.normal.js +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.1.normal.js @@ -1,5 +1,5 @@ -//// [parserEnumDeclaration3.d.ts] -var E; +//// [verbatimModuleSyntaxConstEnum.ts] +export var E; (function(E) { E[E["A"] = 1] = "A"; })(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/parserEnumDeclaration3.d.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.2.minified.js similarity index 50% rename from crates/swc/tests/tsc-references/parserEnumDeclaration3.d.2.minified.js rename to crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.2.minified.js index ced3756c91f..2856520aa9e 100644 --- a/crates/swc/tests/tsc-references/parserEnumDeclaration3.d.2.minified.js +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxConstEnum.2.minified.js @@ -1,5 +1,5 @@ -//// [parserEnumDeclaration3.d.ts] -var E; +//// [verbatimModuleSyntaxConstEnum.ts] +export var E; !function(E) { E[E.A = 1] = "A"; }(E || (E = {})); diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.1.normal.js new file mode 100644 index 00000000000..9add16f804e --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.1.normal.js @@ -0,0 +1,6 @@ +//// [verbatimModuleSyntaxInternalImportEquals.ts] +var Foo; +(function(Foo) { + var foo = Foo.foo = 1; +})(Foo || (Foo = {})); +export { }; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js new file mode 100644 index 00000000000..d0a63693c40 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxInternalImportEquals.2.minified.js @@ -0,0 +1,4 @@ +//// [verbatimModuleSyntaxInternalImportEquals.ts] +var Foo; +(Foo || (Foo = {})).foo = 1; +export { }; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.1.normal.js new file mode 100644 index 00000000000..6b168b88869 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.1.normal.js @@ -0,0 +1,32 @@ +//// [verbatimModuleSyntaxNoElisionCJS.ts] +"use strict"; +//// [/a.ts] +"use strict"; +module.exports = I; +//// [/b.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +const I = require("./a"); +//// [/c.ts] +"use strict"; +var I; +(function(I) { + var x = I.x = 1; +})(I || (I = {})); +module.exports = I; +//// [/d.ts] +"use strict"; +const I = require("./c"); +module.exports = J; +//// [/e.d.ts] +"use strict"; +module.exports = I; +//// [/f.ts] +"use strict"; +const I = {}; +module.exports = I; +//// [/z.ts] +// test harness is weird if the last file includs a require >:( +"use strict"; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.2.minified.js new file mode 100644 index 00000000000..e9c921e7876 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionCJS.2.minified.js @@ -0,0 +1,25 @@ +//// [verbatimModuleSyntaxNoElisionCJS.ts] +"use strict"; +//// [/a.ts] +"use strict"; +module.exports = I; +//// [/b.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), require("./a"); +//// [/c.ts] +"use strict"; +var I; +(I || (I = {})).x = 1, module.exports = I; +//// [/d.ts] +"use strict"; +require("./c"), module.exports = J; +//// [/e.d.ts] +"use strict"; +module.exports = I; +//// [/f.ts] +"use strict"; +module.exports = {}; +//// [/z.ts] +"use strict"; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.1.normal.js new file mode 100644 index 00000000000..72262aed433 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.1.normal.js @@ -0,0 +1,28 @@ +//// [verbatimModuleSyntaxNoElisionESM.ts] +//// [/a.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +export var a = 0; +export var AClass = function AClass() { + "use strict"; + _class_call_check(this, AClass); +}; +//// [/b.ts] +import { A } from "./a"; +export { A }; +export { A as A2 } from "./a"; +//// [/c.ts] +export { }; +//// [/main4.ts] +export default 1; // ok +//// [/main5.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +var C = function C() { + "use strict"; + _class_call_check(this, C); +} // ok +; +export { C as default }; +//// [/main6.ts] +export { }; // error +//// [/main7.ts] +export { }; // error diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.2.minified.js new file mode 100644 index 00000000000..63336c9c20f --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxNoElisionESM.2.minified.js @@ -0,0 +1,27 @@ +//// [verbatimModuleSyntaxNoElisionESM.ts] +//// [/a.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +export var a = 0; +export var AClass = function AClass() { + "use strict"; + _class_call_check(this, AClass); +}; +//// [/b.ts] +import { A } from "./a"; +export { A as A2 } from "./a"; +export { A }; +//// [/c.ts] +export { }; +//// [/main4.ts] +export default 1; +//// [/main5.ts] +import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; +var C = function C() { + "use strict"; + _class_call_check(this, C); +}; +export { C as default }; +//// [/main6.ts] +export { }; +//// [/main7.ts] +export { }; diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.1.normal.js new file mode 100644 index 00000000000..bb645ae36c8 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.1.normal.js @@ -0,0 +1,84 @@ +//// [verbatimModuleSyntaxRestrictionsCJS.ts] +"use strict"; +//// [/decl.d.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: ()=>_default +}); +const _default = esmy; +//// [/ambient.d.ts] +"use strict"; +//// [/main.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + Values: ()=>Values, + x: ()=>x +}); +const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; +Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./decl"))); // error +const x = 1; // error +var Values; +(function(Values) { + var x = Values.x = 1; +})(Values || (Values = {})); + // sketchy, but ok +//// [/main2.ts] +"use strict"; +module.exports = { + x: 1 +}; +//// [/main3.ts] +"use strict"; +var ns; +(function(ns) { + var x = ns.x = 1; +})(ns || (ns = {})); +module.exports = ns; +//// [/main4.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default" // error +, { + enumerable: true, + get: ()=>_default +}); +const _default = 1; +//// [/main5.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default" // error +, { + enumerable: true, + get: ()=>C +}); +class C { +} +//// [/main6.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + // error +//// [/main7.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + // error diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.2.minified.js new file mode 100644 index 00000000000..2c955175496 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsCJS.2.minified.js @@ -0,0 +1,69 @@ +//// [verbatimModuleSyntaxRestrictionsCJS.ts] +"use strict"; +//// [/decl.d.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), Object.defineProperty(exports, "default", { + enumerable: !0, + get: ()=>_default +}); +const _default = esmy; +//// [/ambient.d.ts] +"use strict"; +//// [/main.ts] +"use strict"; +var Values; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), function(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: !0, + get: all[name] + }); +}(exports, { + Values: ()=>Values, + x: ()=>x +}); +const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default; +Promise.resolve().then(()=>_interopRequireWildcard(require("./decl"))); +const x = 1; +(Values || (Values = {})).x = 1; +//// [/main2.ts] +"use strict"; +module.exports = { + x: 1 +}; +//// [/main3.ts] +"use strict"; +var ns; +(ns || (ns = {})).x = 1, module.exports = ns; +//// [/main4.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), Object.defineProperty(exports, "default", { + enumerable: !0, + get: ()=>_default +}); +const _default = 1; +//// [/main5.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}), Object.defineProperty(exports, "default", { + enumerable: !0, + get: ()=>C +}); +class C { +} +//// [/main6.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}); +//// [/main7.ts] +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: !0 +}); diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.1.normal.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.1.normal.js new file mode 100644 index 00000000000..75039067b80 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.1.normal.js @@ -0,0 +1,29 @@ +//// [verbatimModuleSyntaxRestrictionsESM.ts] +//// [/decl.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare class CJSy {} +//! 2 | export = CJSy; +//! : ^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/ambient.d.ts] +//// [/types.ts] +export { }; +//// [/main.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import CJSy = require("./decl"); // error +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 2 | import type CJSy2 = require("./decl"); // ok I guess? +//! 3 | import CJSy3 from "./decl"; // ok in esModuleInterop +//! 4 | import * as types from "./types"; // ok +//! `---- +//// [/ns.ts] +export var ns; +(function(ns) { + let A; + (function(A) {})(A = ns.A || (ns.A = {})); +})(ns || (ns = {})); diff --git a/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.2.minified.js b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.2.minified.js new file mode 100644 index 00000000000..07ad21080e9 --- /dev/null +++ b/crates/swc/tests/tsc-references/verbatimModuleSyntaxRestrictionsESM.2.minified.js @@ -0,0 +1,28 @@ +//// [verbatimModuleSyntaxRestrictionsESM.ts] +//// [/decl.d.ts] +//! +//! x Export assignment cannot be used when targeting ECMAScript modules. Consider using `export default` or another module format instead. +//! ,-[1:1] +//! 1 | declare class CJSy {} +//! 2 | export = CJSy; +//! : ^^^^^^^^^^^^^^ +//! 3 | +//! `---- +//// [/ambient.d.ts] +//// [/types.ts] +export { }; +//// [/main.ts] +//! +//! x Import assignment cannot be used when targeting ECMAScript modules. Consider using `import * as ns from "mod"`, `import {a} from "mod"`, `import d from "mod"`, or another module format instead. +//! ,-[1:1] +//! 1 | import CJSy = require("./decl"); // error +//! : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//! 2 | import type CJSy2 = require("./decl"); // ok I guess? +//! 3 | import CJSy3 from "./decl"; // ok in esModuleInterop +//! 4 | import * as types from "./types"; // ok +//! `---- +//// [/ns.ts] +export var ns; +!function(ns) { + ns.A || (ns.A = {}); +}(ns || (ns = {})); diff --git a/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.1.normal.js b/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.1.normal.js deleted file mode 100644 index 0a7bb8608a9..00000000000 --- a/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.1.normal.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [voidOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // Unary operator void -//! 2 | -//! 3 | // operand before void -//! 4 | var ANY = ANY void ; //expect error -//! : ^^^^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! `---- -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | // Unary operator void -//! 2 | -//! 3 | // operand before void -//! 4 | var ANY = ANY void ; //expect error -//! : ^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! `---- -//! -//! x Expression expected -//! ,-[4:1] -//! 4 | var ANY = ANY void ; //expect error -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.2.minified.js b/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.2.minified.js deleted file mode 100644 index 0a7bb8608a9..00000000000 --- a/crates/swc/tests/tsc-references/voidOperatorInvalidOperations.2.minified.js +++ /dev/null @@ -1,34 +0,0 @@ -//// [voidOperatorInvalidOperations.ts] -//! -//! x Expected a semicolon -//! ,-[1:1] -//! 1 | // Unary operator void -//! 2 | -//! 3 | // operand before void -//! 4 | var ANY = ANY void ; //expect error -//! : ^^^^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! `---- -//! -//! x Expression expected -//! ,-[1:1] -//! 1 | // Unary operator void -//! 2 | -//! 3 | // operand before void -//! 4 | var ANY = ANY void ; //expect error -//! : ^ -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! `---- -//! -//! x Expression expected -//! ,-[4:1] -//! 4 | var ANY = ANY void ; //expect error -//! 5 | -//! 6 | // miss an operand -//! 7 | var ANY1 = void ; -//! : ^ -//! `---- diff --git a/crates/swc/tests/tsc-references/weakTypesAndLiterals01.1.normal.js b/crates/swc/tests/tsc-references/weakTypesAndLiterals01.1.normal.js new file mode 100644 index 00000000000..bf063e2f96c --- /dev/null +++ b/crates/swc/tests/tsc-references/weakTypesAndLiterals01.1.normal.js @@ -0,0 +1,29 @@ +//// [weakTypesAndLiterals01.ts] +var f = function(arg) { + if (arg === "A") { + return arg; + } else { + return arg; + } +}; +var g = function(arg) { + if (arg === "A") { + return arg; + } else { + return arg; + } +}; +var h = function(arg) { + if (arg === aOrB) { + return arg; + } else { + return arg; + } +}; +var i = function(arg) { + if (arg === aOrB) { + return arg; + } else { + return arg; + } +}; diff --git a/crates/swc/tests/tsc-references/weakTypesAndLiterals01.2.minified.js b/crates/swc/tests/tsc-references/weakTypesAndLiterals01.2.minified.js new file mode 100644 index 00000000000..1eee76afecc --- /dev/null +++ b/crates/swc/tests/tsc-references/weakTypesAndLiterals01.2.minified.js @@ -0,0 +1 @@ +//// [weakTypesAndLiterals01.ts] diff --git a/crates/swc/tests/tsc.rs b/crates/swc/tests/tsc.rs index 6dd1c547153..8431c87cdf7 100644 --- a/crates/swc/tests/tsc.rs +++ b/crates/swc/tests/tsc.rs @@ -32,6 +32,7 @@ use testing::NormalizedOutput; "privateNameAndIndexSignature.ts", "privateNameImplicitDeclaration.ts", "privateNameStaticAccessorsDerivedClasses.ts", + "privateNameStaticAccessorssDerivedClasses.ts", ) )] #[testing::fixture( diff --git a/crates/swc_ecma_parser/scripts/crlf.sh b/crates/swc_ecma_parser/scripts/crlf.sh index 104dcfc9148..26db618cb99 100755 --- a/crates/swc_ecma_parser/scripts/crlf.sh +++ b/crates/swc_ecma_parser/scripts/crlf.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -find tests/typescript -type f -exec ./scripts/dos2unix.sh {} \; +find tests/tsc -type f -exec ./scripts/dos2unix.sh {} \; diff --git a/crates/swc_ecma_parser/scripts/tsc/copy-all-tests.sh b/crates/swc_ecma_parser/scripts/tsc/copy-all-tests.sh index b4b039aa62a..a13cb8cfcd3 100755 --- a/crates/swc_ecma_parser/scripts/tsc/copy-all-tests.sh +++ b/crates/swc_ecma_parser/scripts/tsc/copy-all-tests.sh @@ -9,4 +9,4 @@ set -eu npx tsc ./scripts/tsc/copy-test.ts -find "$1/tests/cases/conformance" -type f | xargs -P 8 -L 1 -I {} node "$SCRIPT_DIR/copy-test.js" {} \; \ No newline at end of file +find "$1/tests/cases/conformance" -type f | sort -R | xargs -P 10 -L 1 -I {} node "$SCRIPT_DIR/copy-test.js" {} \; \ No newline at end of file diff --git a/crates/swc_ecma_parser/scripts/tsc/copy-test.ts b/crates/swc_ecma_parser/scripts/tsc/copy-test.ts index 25ce63c1d86..27ccb138b4b 100755 --- a/crates/swc_ecma_parser/scripts/tsc/copy-test.ts +++ b/crates/swc_ecma_parser/scripts/tsc/copy-test.ts @@ -28,8 +28,8 @@ async function compile( if (!d.file) continue; // Parse failure if (1000 <= d.code && d.code < 2000) return false; - if (10000 <= d.code) return false; if (2000 <= d.code && d.code < 3000) continue; + if (10000 <= d.code) return false; let { line, character } = d.file.getLineAndCharacterOfPosition( d.start! @@ -46,6 +46,7 @@ async function compile( } async function check(f: string) { + console.log(`Checking ${f}...`); const ok = await compile([f], { noEmitOnError: true, target: ts.ScriptTarget.Latest, @@ -61,6 +62,8 @@ async function check(f: string) { // We use rename as resumable copy fs.renameSync(f, target); // console.log('Created', target) + } else { + await fs.promises.unlink(f); } } diff --git a/crates/swc_ecma_parser/tests/tsc/1.0lib-noErrors.ts b/crates/swc_ecma_parser/tests/tsc/1.0lib-noErrors.ts index 74f6bd28043..32b094a9f93 100644 --- a/crates/swc_ecma_parser/tests/tsc/1.0lib-noErrors.ts +++ b/crates/swc_ecma_parser/tests/tsc/1.0lib-noErrors.ts @@ -1141,4 +1141,4 @@ declare var Array: { (...items: T[]): T[]; isArray(arg: any): boolean; prototype: Array; -} \ No newline at end of file +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/ES5For-of20.json b/crates/swc_ecma_parser/tests/tsc/ES5For-of20.json deleted file mode 100644 index 156cc092b3b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/ES5For-of20.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 81, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 1, - "end": 81, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 11, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "ArrayExpression", - "span": { - "start": 15, - "end": 17, - "ctxt": 0 - }, - "elements": [] - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 19, - "end": 81, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ForOfStatement", - "span": { - "start": 36, - "end": 79, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 41, - "end": 46, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "ArrayExpression", - "span": { - "start": 50, - "end": 53, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - } - ] - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 55, - "end": 79, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 65, - "end": 73, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 71, - "end": 72, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 72, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - ] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/ES5For-of20.ts b/crates/swc_ecma_parser/tests/tsc/ES5For-of20.ts deleted file mode 100644 index 64e65e1f851..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/ES5For-of20.ts +++ /dev/null @@ -1,6 +0,0 @@ -for (let v of []) { - let v; - for (let v of [v]) { - const v; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.json b/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.json deleted file mode 100644 index dce07afcf26..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 35, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 35, - "ctxt": 0 - }, - "value": "yield", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 17, - "end": 40, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.ts b/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.ts deleted file mode 100644 index b899129bddb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/FunctionDeclaration5_es6.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @target: es6 -function*foo(yield) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.json b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.json deleted file mode 100644 index 6b4ecf4911d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 33, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 16, - "end": 29, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 16, - "end": 28, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "value": "let", - "optional": false - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.ts b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.ts deleted file mode 100644 index 99ab01d2448..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration11_es6.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @target:es6 -"use strict"; -let \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.json b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.json deleted file mode 100644 index 649b7b9f9ff..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 21, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 21, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.ts b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.ts deleted file mode 100644 index 07c928137ae..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration1_es6.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target:es6 -const \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.json b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.json deleted file mode 100644 index 50d887484e5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 23, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 23, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.ts b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.ts deleted file mode 100644 index 7d02924e394..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration2_es6.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target:es6 -const a \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.json b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.json deleted file mode 100644 index 2f423b0a3b0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 31, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 31, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 23, - "end": 31, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.ts b/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.ts deleted file mode 100644 index 07766cb8237..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/VariableDeclaration4_es6.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target:es6 -const a: number \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.json b/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.json deleted file mode 100644 index 4ff191c14bf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 40, - "end": 82, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 40, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 63, - "end": 80, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 72, - "end": 76, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.ts b/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.ts deleted file mode 100644 index 42a0999748a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/abstractPropertyInitializer.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @strict: true -// @declaration: true -abstract class C { - abstract prop = 1 -} diff --git a/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.json b/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.json deleted file mode 100644 index 79411248906..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 51, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 67, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 51, - "end": 94, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 74, - "end": 92, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 83, - "end": 84, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 87, - "end": 92, - "ctxt": 0 - }, - "value": "yep", - "raw": "'yep'" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 95, - "end": 156, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 119, - "end": 145, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 119, - "end": 145, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 127, - "end": 145, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 129, - "end": 143, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 136, - "end": 143, - "ctxt": 0 - }, - "value": "oh no", - "raw": "'oh no'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.ts b/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.ts deleted file mode 100644 index 9be3dad44f8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty7.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: es5 -// @useDefineForClassFields: true -abstract class A { - abstract p = 'yep' -} -class B extends A { - get p() { return 'oh no' } // error -} diff --git a/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.json b/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.json new file mode 100644 index 00000000000..ae25b197c6d --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.json @@ -0,0 +1,299 @@ +{ + "type": "Module", + "span": { + "start": 184, + "end": 670, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 184, + "end": 194, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 219, + "end": 229, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 255, + "end": 265, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 287, + "end": 312, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 302, + "end": 311, + "ctxt": 0 + }, + "value": "./ts.js", + "raw": "\"./ts.js\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 313, + "end": 338, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 328, + "end": 337, + "ctxt": 0 + }, + "value": "./ts.ts", + "raw": "\"./ts.ts\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 339, + "end": 371, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 359, + "end": 370, + "ctxt": 0 + }, + "value": "./ts.d.ts", + "raw": "\"./ts.d.ts\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 373, + "end": 399, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 388, + "end": 398, + "ctxt": 0 + }, + "value": "./tsx.js", + "raw": "\"./tsx.js\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 400, + "end": 427, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 415, + "end": 426, + "ctxt": 0 + }, + "value": "./tsx.jsx", + "raw": "\"./tsx.jsx\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 428, + "end": 454, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 443, + "end": 453, + "ctxt": 0 + }, + "value": "./tsx.ts", + "raw": "\"./tsx.ts\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 455, + "end": 482, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 470, + "end": 481, + "ctxt": 0 + }, + "value": "./tsx.tsx", + "raw": "\"./tsx.tsx\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 483, + "end": 516, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 503, + "end": 515, + "ctxt": 0 + }, + "value": "./tsx.d.ts", + "raw": "\"./tsx.d.ts\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 518, + "end": 544, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 533, + "end": 543, + "ctxt": 0 + }, + "value": "./dts.js", + "raw": "\"./dts.js\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 545, + "end": 571, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 560, + "end": 570, + "ctxt": 0 + }, + "value": "./dts.ts", + "raw": "\"./dts.ts\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 572, + "end": 605, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 592, + "end": 604, + "ctxt": 0 + }, + "value": "./dts.d.ts", + "raw": "\"./dts.d.ts\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 627, + "end": 670, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 642, + "end": 669, + "ctxt": 0 + }, + "value": "./thisfiledoesnotexist.ts", + "raw": "\"./thisfiledoesnotexist.ts\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.ts b/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.ts new file mode 100644 index 00000000000..96d0786d034 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/allowImportingTsExtensions.ts @@ -0,0 +1,32 @@ +// @allowImportingTsExtensions: true +// @noEmit: true +// @moduleResolution: classic,node10,node16,nodenext,bundler +// @jsx: preserve +// @noTypesAndSymbols: true + +// @Filename: /ts.ts +export {}; + +// @Filename: /tsx.tsx +export {}; + +// @Filename: /dts.d.ts +export {}; + +// @Filename: /b.ts +import {} from "./ts.js"; +import {} from "./ts.ts"; +import type {} from "./ts.d.ts"; + +import {} from "./tsx.js"; +import {} from "./tsx.jsx"; +import {} from "./tsx.ts"; +import {} from "./tsx.tsx"; +import type {} from "./tsx.d.ts"; + +import {} from "./dts.js"; +import {} from "./dts.ts"; +import type {} from "./dts.d.ts"; + +// @Filename: /c.ts +import {} from "./thisfiledoesnotexist.ts"; diff --git a/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration1.ts index dea82518e7e..e5c2cebf5eb 100644 --- a/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration1.ts +++ b/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration1.ts @@ -1,4 +1,4 @@ -// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. +// In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. declare enum E { a = 10, diff --git a/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration2.ts index fe9ddb8c9c6..9f873904c3c 100644 --- a/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration2.ts +++ b/crates/swc_ecma_parser/tests/tsc/ambientEnumDeclaration2.ts @@ -1,4 +1,4 @@ -// In ambient enum declarations that specify no const modifier, enum member declarations +// In ambient enum declarations that specify no const modifier, enum member declarations // that omit a value are considered computed members (as opposed to having auto- incremented values assigned). declare enum E { diff --git a/crates/swc_ecma_parser/tests/tsc/argumentExpressionContextualTyping.ts b/crates/swc_ecma_parser/tests/tsc/argumentExpressionContextualTyping.ts index cbc424c52d3..75f3e1067d5 100644 --- a/crates/swc_ecma_parser/tests/tsc/argumentExpressionContextualTyping.ts +++ b/crates/swc_ecma_parser/tests/tsc/argumentExpressionContextualTyping.ts @@ -1,4 +1,4 @@ -// In a typed function call, argument expressions are contextually typed by their corresponding parameter types. +// In a typed function call, argument expressions are contextually typed by their corresponding parameter types. function foo({x: [a, b], y: {c, d, e}}) { } function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } function baz(x: [string, number, boolean]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.json deleted file mode 100644 index ca70993409f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.json +++ /dev/null @@ -1,7208 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 110, - "end": 3019, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 110, - "end": 125, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 114, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 115, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 124, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 124, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 126, - "end": 140, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 130, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 131, - "end": 139, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 141, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 145, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 145, - "end": 146, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 171, - "end": 191, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 175, - "end": 190, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 179, - "ctxt": 0 - }, - "value": "r1a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 182, - "end": 190, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 182, - "end": 186, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 189, - "end": 190, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 212, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 196, - "end": 211, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 196, - "end": 200, - "ctxt": 0 - }, - "value": "r1a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 203, - "end": 211, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 203, - "end": 207, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 213, - "end": 233, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 217, - "end": 232, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "value": "r1a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 224, - "end": 232, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 224, - "end": 228, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 235, - "end": 255, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 239, - "end": 254, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 239, - "end": 243, - "ctxt": 0 - }, - "value": "r1b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 246, - "end": 254, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 250, - "end": 254, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 256, - "end": 276, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 260, - "end": 275, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "r1b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 267, - "end": 275, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 271, - "end": 275, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 277, - "end": 297, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 281, - "end": 296, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 281, - "end": 285, - "ctxt": 0 - }, - "value": "r1b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 288, - "end": 296, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 292, - "end": 296, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 299, - "end": 322, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 303, - "end": 321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 303, - "end": 307, - "ctxt": 0 - }, - "value": "r1c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 310, - "end": 321, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 310, - "end": 314, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 317, - "end": 321, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 323, - "end": 344, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 327, - "end": 343, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 327, - "end": 331, - "ctxt": 0 - }, - "value": "r1c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 334, - "end": 343, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 334, - "end": 338, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 341, - "end": 343, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 345, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 349, - "end": 365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - }, - "value": "r1c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 356, - "end": 365, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 356, - "end": 360, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 363, - "end": 365, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 368, - "end": 391, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 372, - "end": 390, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 372, - "end": 376, - "ctxt": 0 - }, - "value": "r1d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 379, - "end": 390, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 386, - "end": 390, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 392, - "end": 413, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 396, - "end": 412, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 396, - "end": 400, - "ctxt": 0 - }, - "value": "r1d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 403, - "end": 412, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "StringLiteral", - "span": { - "start": 403, - "end": 405, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 408, - "end": 412, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 414, - "end": 435, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 418, - "end": 434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 418, - "end": 422, - "ctxt": 0 - }, - "value": "r1d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 425, - "end": 434, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "ObjectExpression", - "span": { - "start": 425, - "end": 427, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 430, - "end": 434, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 451, - "end": 471, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 455, - "end": 470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 455, - "end": 459, - "ctxt": 0 - }, - "value": "r2a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 462, - "end": 470, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 462, - "end": 466, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 469, - "end": 470, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 472, - "end": 492, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 476, - "end": 491, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 476, - "end": 480, - "ctxt": 0 - }, - "value": "r2a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 483, - "end": 491, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 483, - "end": 487, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 490, - "end": 491, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 513, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 501, - "ctxt": 0 - }, - "value": "r2a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 504, - "end": 512, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 504, - "end": 508, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 511, - "end": 512, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 515, - "end": 535, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 519, - "end": 534, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 519, - "end": 523, - "ctxt": 0 - }, - "value": "r2b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 526, - "end": 534, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 526, - "end": 527, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 536, - "end": 556, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 540, - "end": 555, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 540, - "end": 544, - "ctxt": 0 - }, - "value": "r2b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 547, - "end": 555, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 547, - "end": 548, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 551, - "end": 555, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 557, - "end": 577, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 561, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 561, - "end": 565, - "ctxt": 0 - }, - "value": "r2b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 568, - "end": 576, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 568, - "end": 569, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 572, - "end": 576, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 579, - "end": 602, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 583, - "end": 601, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 583, - "end": 587, - "ctxt": 0 - }, - "value": "r2c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 590, - "end": 601, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 590, - "end": 594, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 597, - "end": 601, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 603, - "end": 624, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 607, - "end": 623, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "value": "r2c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 614, - "end": 623, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 614, - "end": 618, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 621, - "end": 623, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 625, - "end": 646, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 629, - "end": 645, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 629, - "end": 633, - "ctxt": 0 - }, - "value": "r2c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 636, - "end": 645, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 636, - "end": 640, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 643, - "end": 645, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 648, - "end": 671, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 652, - "end": 670, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 652, - "end": 656, - "ctxt": 0 - }, - "value": "r2d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 659, - "end": 670, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 659, - "end": 663, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 666, - "end": 670, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 672, - "end": 693, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 676, - "end": 692, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 676, - "end": 680, - "ctxt": 0 - }, - "value": "r2d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 683, - "end": 692, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "StringLiteral", - "span": { - "start": 683, - "end": 685, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 688, - "end": 692, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 694, - "end": 715, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 698, - "end": 714, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 698, - "end": 702, - "ctxt": 0 - }, - "value": "r2d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 705, - "end": 714, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "ObjectExpression", - "span": { - "start": 705, - "end": 707, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 710, - "end": 714, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 731, - "end": 751, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 735, - "end": 750, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 735, - "end": 739, - "ctxt": 0 - }, - "value": "r3a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 742, - "end": 750, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 742, - "end": 746, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 749, - "end": 750, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 752, - "end": 772, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 756, - "end": 771, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 756, - "end": 760, - "ctxt": 0 - }, - "value": "r3a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 763, - "end": 771, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 763, - "end": 767, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 770, - "end": 771, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 773, - "end": 793, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 777, - "end": 792, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 777, - "end": 781, - "ctxt": 0 - }, - "value": "r3a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 784, - "end": 792, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 784, - "end": 788, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 791, - "end": 792, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 795, - "end": 815, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 799, - "end": 814, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 799, - "end": 803, - "ctxt": 0 - }, - "value": "r3b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 806, - "end": 814, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 806, - "end": 807, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 810, - "end": 814, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 816, - "end": 836, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 820, - "end": 835, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 820, - "end": 824, - "ctxt": 0 - }, - "value": "r3b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 827, - "end": 835, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 827, - "end": 828, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 831, - "end": 835, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 837, - "end": 857, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 841, - "end": 856, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 841, - "end": 845, - "ctxt": 0 - }, - "value": "r3b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 848, - "end": 856, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 848, - "end": 849, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 852, - "end": 856, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 859, - "end": 882, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 863, - "end": 881, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 863, - "end": 867, - "ctxt": 0 - }, - "value": "r3c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 870, - "end": 881, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 870, - "end": 874, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 877, - "end": 881, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 883, - "end": 904, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 887, - "end": 903, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 887, - "end": 891, - "ctxt": 0 - }, - "value": "r3c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 894, - "end": 903, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 894, - "end": 898, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 901, - "end": 903, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 905, - "end": 926, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 909, - "end": 925, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 909, - "end": 913, - "ctxt": 0 - }, - "value": "r3c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 916, - "end": 925, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 916, - "end": 920, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 923, - "end": 925, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 928, - "end": 951, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 932, - "end": 950, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 932, - "end": 936, - "ctxt": 0 - }, - "value": "r3d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 939, - "end": 950, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 939, - "end": 943, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 946, - "end": 950, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 952, - "end": 973, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 956, - "end": 972, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 956, - "end": 960, - "ctxt": 0 - }, - "value": "r3d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 963, - "end": 972, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "StringLiteral", - "span": { - "start": 963, - "end": 965, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 968, - "end": 972, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 974, - "end": 995, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 978, - "end": 994, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 978, - "end": 982, - "ctxt": 0 - }, - "value": "r3d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 985, - "end": 994, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "ObjectExpression", - "span": { - "start": 985, - "end": 987, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 990, - "end": 994, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1011, - "end": 1031, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1015, - "end": 1030, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1015, - "end": 1019, - "ctxt": 0 - }, - "value": "r4a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1022, - "end": 1030, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1022, - "end": 1026, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1029, - "end": 1030, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1032, - "end": 1052, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1036, - "end": 1051, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1036, - "end": 1040, - "ctxt": 0 - }, - "value": "r4a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1043, - "end": 1051, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1043, - "end": 1047, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1050, - "end": 1051, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1053, - "end": 1073, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1057, - "end": 1072, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1057, - "end": 1061, - "ctxt": 0 - }, - "value": "r4a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1064, - "end": 1072, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1064, - "end": 1068, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1072, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1075, - "end": 1095, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1079, - "end": 1094, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1079, - "end": 1083, - "ctxt": 0 - }, - "value": "r4b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1086, - "end": 1094, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1086, - "end": 1087, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1090, - "end": 1094, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1096, - "end": 1116, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1100, - "end": 1115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1104, - "ctxt": 0 - }, - "value": "r4b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1107, - "end": 1115, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1107, - "end": 1108, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1111, - "end": 1115, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1117, - "end": 1137, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1121, - "end": 1136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1121, - "end": 1125, - "ctxt": 0 - }, - "value": "r4b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1128, - "end": 1136, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1128, - "end": 1129, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1132, - "end": 1136, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1139, - "end": 1162, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1143, - "end": 1161, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1147, - "ctxt": 0 - }, - "value": "r4c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1150, - "end": 1161, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1150, - "end": 1154, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1157, - "end": 1161, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1163, - "end": 1184, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1167, - "end": 1183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1167, - "end": 1171, - "ctxt": 0 - }, - "value": "r4c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1174, - "end": 1183, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1174, - "end": 1178, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1181, - "end": 1183, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1185, - "end": 1206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1189, - "end": 1205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1189, - "end": 1193, - "ctxt": 0 - }, - "value": "r4c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1196, - "end": 1205, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 1196, - "end": 1200, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1203, - "end": 1205, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1208, - "end": 1231, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1212, - "end": 1230, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1212, - "end": 1216, - "ctxt": 0 - }, - "value": "r4d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1219, - "end": 1230, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1219, - "end": 1223, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1226, - "end": 1230, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1232, - "end": 1253, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1236, - "end": 1252, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1236, - "end": 1240, - "ctxt": 0 - }, - "value": "r4d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1243, - "end": 1252, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "StringLiteral", - "span": { - "start": 1243, - "end": 1245, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1248, - "end": 1252, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1254, - "end": 1275, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1258, - "end": 1274, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1258, - "end": 1262, - "ctxt": 0 - }, - "value": "r4d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1265, - "end": 1274, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1265, - "end": 1267, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1270, - "end": 1274, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1292, - "end": 1313, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1296, - "end": 1312, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1296, - "end": 1300, - "ctxt": 0 - }, - "value": "r5a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1303, - "end": 1312, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1303, - "end": 1307, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1311, - "end": 1312, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1314, - "end": 1335, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1318, - "end": 1334, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1318, - "end": 1322, - "ctxt": 0 - }, - "value": "r5a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1325, - "end": 1334, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1325, - "end": 1329, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1333, - "end": 1334, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1336, - "end": 1357, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1340, - "end": 1356, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1340, - "end": 1344, - "ctxt": 0 - }, - "value": "r5a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1347, - "end": 1356, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1347, - "end": 1351, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1355, - "end": 1356, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1359, - "end": 1380, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1363, - "end": 1379, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1363, - "end": 1367, - "ctxt": 0 - }, - "value": "r5b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1370, - "end": 1379, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1370, - "end": 1371, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1375, - "end": 1379, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1381, - "end": 1402, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1385, - "end": 1401, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1385, - "end": 1389, - "ctxt": 0 - }, - "value": "r5b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1392, - "end": 1401, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1392, - "end": 1393, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1397, - "end": 1401, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1403, - "end": 1424, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1407, - "end": 1423, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1407, - "end": 1411, - "ctxt": 0 - }, - "value": "r5b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1414, - "end": 1423, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1414, - "end": 1415, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1419, - "end": 1423, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1426, - "end": 1450, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1430, - "end": 1449, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1430, - "end": 1434, - "ctxt": 0 - }, - "value": "r5c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1437, - "end": 1449, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1437, - "end": 1441, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1445, - "end": 1449, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1451, - "end": 1473, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1455, - "end": 1472, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1455, - "end": 1459, - "ctxt": 0 - }, - "value": "r5c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1462, - "end": 1472, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1462, - "end": 1466, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1470, - "end": 1472, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1474, - "end": 1496, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1478, - "end": 1495, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1478, - "end": 1482, - "ctxt": 0 - }, - "value": "r5c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1485, - "end": 1495, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 1485, - "end": 1489, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1493, - "end": 1495, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1498, - "end": 1522, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1502, - "end": 1521, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1502, - "end": 1506, - "ctxt": 0 - }, - "value": "r5d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1509, - "end": 1521, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1509, - "end": 1513, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1517, - "end": 1521, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1523, - "end": 1545, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1527, - "end": 1544, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1527, - "end": 1531, - "ctxt": 0 - }, - "value": "r5d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1534, - "end": 1544, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "StringLiteral", - "span": { - "start": 1534, - "end": 1536, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1540, - "end": 1544, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1546, - "end": 1568, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1550, - "end": 1567, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1550, - "end": 1554, - "ctxt": 0 - }, - "value": "r5d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1557, - "end": 1567, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1557, - "end": 1559, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1563, - "end": 1567, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1585, - "end": 1606, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1589, - "end": 1605, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1589, - "end": 1593, - "ctxt": 0 - }, - "value": "r6a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1596, - "end": 1605, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1596, - "end": 1600, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1604, - "end": 1605, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1607, - "end": 1628, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1611, - "end": 1627, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1611, - "end": 1615, - "ctxt": 0 - }, - "value": "r6a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1618, - "end": 1627, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1618, - "end": 1622, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1626, - "end": 1627, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1629, - "end": 1650, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1633, - "end": 1649, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1633, - "end": 1637, - "ctxt": 0 - }, - "value": "r6a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1640, - "end": 1649, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1640, - "end": 1644, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1648, - "end": 1649, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1652, - "end": 1673, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1656, - "end": 1672, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1656, - "end": 1660, - "ctxt": 0 - }, - "value": "r6b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1663, - "end": 1672, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1663, - "end": 1664, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1668, - "end": 1672, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1674, - "end": 1695, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1678, - "end": 1694, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1678, - "end": 1682, - "ctxt": 0 - }, - "value": "r6b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1685, - "end": 1694, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1685, - "end": 1686, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1690, - "end": 1694, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1696, - "end": 1717, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1700, - "end": 1716, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1700, - "end": 1704, - "ctxt": 0 - }, - "value": "r6b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1707, - "end": 1716, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1707, - "end": 1708, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1712, - "end": 1716, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1719, - "end": 1743, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1723, - "end": 1742, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1723, - "end": 1727, - "ctxt": 0 - }, - "value": "r6c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1730, - "end": 1742, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1730, - "end": 1734, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1738, - "end": 1742, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1744, - "end": 1766, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1748, - "end": 1765, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1748, - "end": 1752, - "ctxt": 0 - }, - "value": "r6c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1755, - "end": 1765, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1755, - "end": 1759, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1763, - "end": 1765, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1767, - "end": 1789, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1771, - "end": 1788, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1775, - "ctxt": 0 - }, - "value": "r6c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1778, - "end": 1788, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1778, - "end": 1782, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1786, - "end": 1788, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1791, - "end": 1815, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1795, - "end": 1814, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1795, - "end": 1799, - "ctxt": 0 - }, - "value": "r6d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1802, - "end": 1814, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1802, - "end": 1806, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1810, - "end": 1814, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1816, - "end": 1838, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1820, - "end": 1837, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1820, - "end": 1824, - "ctxt": 0 - }, - "value": "r6d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1827, - "end": 1837, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "StringLiteral", - "span": { - "start": 1827, - "end": 1829, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1833, - "end": 1837, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1839, - "end": 1861, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1843, - "end": 1860, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1843, - "end": 1847, - "ctxt": 0 - }, - "value": "r6d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1850, - "end": 1860, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1850, - "end": 1852, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1856, - "end": 1860, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1879, - "end": 1901, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1883, - "end": 1900, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1883, - "end": 1887, - "ctxt": 0 - }, - "value": "r7a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1890, - "end": 1900, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1890, - "end": 1894, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1899, - "end": 1900, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1902, - "end": 1924, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1906, - "end": 1923, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1906, - "end": 1910, - "ctxt": 0 - }, - "value": "r7a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1913, - "end": 1923, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1913, - "end": 1917, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1922, - "end": 1923, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1925, - "end": 1947, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1929, - "end": 1946, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1929, - "end": 1933, - "ctxt": 0 - }, - "value": "r7a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1936, - "end": 1946, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1936, - "end": 1940, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1945, - "end": 1946, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1949, - "end": 1971, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1953, - "end": 1970, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1953, - "end": 1957, - "ctxt": 0 - }, - "value": "r7b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1960, - "end": 1970, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1960, - "end": 1961, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1966, - "end": 1970, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1972, - "end": 1994, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1976, - "end": 1993, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1980, - "ctxt": 0 - }, - "value": "r7b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1983, - "end": 1993, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1983, - "end": 1984, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1989, - "end": 1993, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1995, - "end": 2017, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1999, - "end": 2016, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1999, - "end": 2003, - "ctxt": 0 - }, - "value": "r7b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2006, - "end": 2016, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2006, - "end": 2007, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2012, - "end": 2016, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2019, - "end": 2044, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2023, - "end": 2043, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2023, - "end": 2027, - "ctxt": 0 - }, - "value": "r7c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2030, - "end": 2043, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 2030, - "end": 2034, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2039, - "end": 2043, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2045, - "end": 2068, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2049, - "end": 2067, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2049, - "end": 2053, - "ctxt": 0 - }, - "value": "r7c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2056, - "end": 2067, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 2056, - "end": 2060, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2065, - "end": 2067, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2069, - "end": 2092, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2073, - "end": 2091, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2073, - "end": 2077, - "ctxt": 0 - }, - "value": "r7c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2080, - "end": 2091, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 2080, - "end": 2084, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2089, - "end": 2091, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2094, - "end": 2119, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2098, - "end": 2118, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2098, - "end": 2102, - "ctxt": 0 - }, - "value": "r7d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2105, - "end": 2118, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2105, - "end": 2109, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2114, - "end": 2118, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2120, - "end": 2143, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2124, - "end": 2142, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2124, - "end": 2128, - "ctxt": 0 - }, - "value": "r7d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2131, - "end": 2142, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "StringLiteral", - "span": { - "start": 2131, - "end": 2133, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2138, - "end": 2142, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2144, - "end": 2167, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2148, - "end": 2166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2148, - "end": 2152, - "ctxt": 0 - }, - "value": "r7d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2155, - "end": 2166, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2155, - "end": 2157, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2162, - "end": 2166, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2183, - "end": 2203, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2187, - "end": 2202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2187, - "end": 2191, - "ctxt": 0 - }, - "value": "r8a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2194, - "end": 2202, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2194, - "end": 2198, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2201, - "end": 2202, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2204, - "end": 2224, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2208, - "end": 2223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2208, - "end": 2212, - "ctxt": 0 - }, - "value": "r8a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2215, - "end": 2223, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2215, - "end": 2219, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2222, - "end": 2223, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2225, - "end": 2245, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2229, - "end": 2244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2229, - "end": 2233, - "ctxt": 0 - }, - "value": "r8a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2236, - "end": 2244, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2236, - "end": 2240, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2243, - "end": 2244, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2247, - "end": 2267, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2251, - "end": 2266, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2251, - "end": 2255, - "ctxt": 0 - }, - "value": "r8b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2258, - "end": 2266, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2258, - "end": 2259, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2262, - "end": 2266, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2268, - "end": 2288, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2272, - "end": 2287, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2272, - "end": 2276, - "ctxt": 0 - }, - "value": "r8b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2279, - "end": 2287, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2279, - "end": 2280, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2283, - "end": 2287, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2289, - "end": 2309, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2293, - "end": 2308, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2293, - "end": 2297, - "ctxt": 0 - }, - "value": "r8b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2300, - "end": 2308, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2300, - "end": 2301, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2304, - "end": 2308, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2311, - "end": 2334, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2315, - "end": 2333, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2315, - "end": 2319, - "ctxt": 0 - }, - "value": "r8c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2322, - "end": 2333, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2322, - "end": 2326, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2329, - "end": 2333, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2335, - "end": 2356, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2339, - "end": 2355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2339, - "end": 2343, - "ctxt": 0 - }, - "value": "r8c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2346, - "end": 2355, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2346, - "end": 2350, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2353, - "end": 2355, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2357, - "end": 2378, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2361, - "end": 2377, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2361, - "end": 2365, - "ctxt": 0 - }, - "value": "r8c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2368, - "end": 2377, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2368, - "end": 2372, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2375, - "end": 2377, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2380, - "end": 2403, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2384, - "end": 2402, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2384, - "end": 2388, - "ctxt": 0 - }, - "value": "r8d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2391, - "end": 2402, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2391, - "end": 2395, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2398, - "end": 2402, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2404, - "end": 2425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2408, - "end": 2424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2408, - "end": 2412, - "ctxt": 0 - }, - "value": "r8d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2415, - "end": 2424, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "StringLiteral", - "span": { - "start": 2415, - "end": 2417, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2420, - "end": 2424, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2426, - "end": 2447, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2430, - "end": 2446, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2430, - "end": 2434, - "ctxt": 0 - }, - "value": "r8d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2437, - "end": 2446, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2437, - "end": 2439, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2442, - "end": 2446, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2463, - "end": 2483, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2467, - "end": 2482, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2467, - "end": 2471, - "ctxt": 0 - }, - "value": "r9a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2474, - "end": 2482, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2474, - "end": 2478, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2481, - "end": 2482, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2484, - "end": 2504, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2488, - "end": 2503, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2488, - "end": 2492, - "ctxt": 0 - }, - "value": "r9a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2495, - "end": 2503, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2495, - "end": 2499, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2502, - "end": 2503, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2505, - "end": 2525, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2509, - "end": 2524, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2509, - "end": 2513, - "ctxt": 0 - }, - "value": "r9a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2516, - "end": 2524, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2516, - "end": 2520, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2523, - "end": 2524, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2527, - "end": 2547, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2531, - "end": 2546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2531, - "end": 2535, - "ctxt": 0 - }, - "value": "r9b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2538, - "end": 2546, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2538, - "end": 2539, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2542, - "end": 2546, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2548, - "end": 2568, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2552, - "end": 2567, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2552, - "end": 2556, - "ctxt": 0 - }, - "value": "r9b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2559, - "end": 2567, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2559, - "end": 2560, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2563, - "end": 2567, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2569, - "end": 2589, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2573, - "end": 2588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2573, - "end": 2577, - "ctxt": 0 - }, - "value": "r9b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2580, - "end": 2588, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2580, - "end": 2581, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2584, - "end": 2588, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2591, - "end": 2614, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2595, - "end": 2613, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2595, - "end": 2599, - "ctxt": 0 - }, - "value": "r9c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2602, - "end": 2613, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2602, - "end": 2606, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2609, - "end": 2613, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2615, - "end": 2636, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2619, - "end": 2635, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2619, - "end": 2623, - "ctxt": 0 - }, - "value": "r9c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2626, - "end": 2635, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2626, - "end": 2630, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2633, - "end": 2635, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2637, - "end": 2658, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2641, - "end": 2657, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2641, - "end": 2645, - "ctxt": 0 - }, - "value": "r9c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2648, - "end": 2657, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 2648, - "end": 2652, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2655, - "end": 2657, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2660, - "end": 2683, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2664, - "end": 2682, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2664, - "end": 2668, - "ctxt": 0 - }, - "value": "r9d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2671, - "end": 2682, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2671, - "end": 2675, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2678, - "end": 2682, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2684, - "end": 2705, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2688, - "end": 2704, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2688, - "end": 2692, - "ctxt": 0 - }, - "value": "r9d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2695, - "end": 2704, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "StringLiteral", - "span": { - "start": 2695, - "end": 2697, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2700, - "end": 2704, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2706, - "end": 2727, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2710, - "end": 2726, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2710, - "end": 2714, - "ctxt": 0 - }, - "value": "r9d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2717, - "end": 2726, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2717, - "end": 2719, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2722, - "end": 2726, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2743, - "end": 2764, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2747, - "end": 2763, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2747, - "end": 2752, - "ctxt": 0 - }, - "value": "r10a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2755, - "end": 2763, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2755, - "end": 2759, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2762, - "end": 2763, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2765, - "end": 2786, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2769, - "end": 2785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2769, - "end": 2774, - "ctxt": 0 - }, - "value": "r10a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2777, - "end": 2785, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2777, - "end": 2781, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2784, - "end": 2785, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2787, - "end": 2808, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2791, - "end": 2807, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2791, - "end": 2796, - "ctxt": 0 - }, - "value": "r10a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2799, - "end": 2807, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2799, - "end": 2803, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2806, - "end": 2807, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2810, - "end": 2831, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2814, - "end": 2830, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2814, - "end": 2819, - "ctxt": 0 - }, - "value": "r10b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2822, - "end": 2830, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2822, - "end": 2823, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2826, - "end": 2830, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2832, - "end": 2853, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2836, - "end": 2852, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2836, - "end": 2841, - "ctxt": 0 - }, - "value": "r10b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2844, - "end": 2852, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2844, - "end": 2845, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2848, - "end": 2852, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2854, - "end": 2875, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2858, - "end": 2874, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2858, - "end": 2863, - "ctxt": 0 - }, - "value": "r10b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2866, - "end": 2874, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2866, - "end": 2867, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2870, - "end": 2874, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2877, - "end": 2901, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2881, - "end": 2900, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2881, - "end": 2886, - "ctxt": 0 - }, - "value": "r10c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2889, - "end": 2900, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2889, - "end": 2893, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2896, - "end": 2900, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2902, - "end": 2924, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2906, - "end": 2923, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2906, - "end": 2911, - "ctxt": 0 - }, - "value": "r10c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2914, - "end": 2923, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2914, - "end": 2918, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2921, - "end": 2923, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2925, - "end": 2947, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2929, - "end": 2946, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2929, - "end": 2934, - "ctxt": 0 - }, - "value": "r10c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2937, - "end": 2946, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 2937, - "end": 2941, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2944, - "end": 2946, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2949, - "end": 2973, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2953, - "end": 2972, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2953, - "end": 2958, - "ctxt": 0 - }, - "value": "r10d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2961, - "end": 2972, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2961, - "end": 2965, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2968, - "end": 2972, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2974, - "end": 2996, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2978, - "end": 2995, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2978, - "end": 2983, - "ctxt": 0 - }, - "value": "r10d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2986, - "end": 2995, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "StringLiteral", - "span": { - "start": 2986, - "end": 2988, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2991, - "end": 2995, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2997, - "end": 3019, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3001, - "end": 3018, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3001, - "end": 3006, - "ctxt": 0 - }, - "value": "r10d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3009, - "end": 3018, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "ObjectExpression", - "span": { - "start": 3009, - "end": 3011, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3014, - "end": 3018, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.ts deleted file mode 100644 index 2d2a7a86046..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndInvalidOperands.ts +++ /dev/null @@ -1,176 +0,0 @@ -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. - -var a: boolean; -var b: string; -var c: Object; - -// operator * -var r1a1 = null * a; -var r1a2 = null * b; -var r1a3 = null * c; - -var r1b1 = a * null; -var r1b2 = b * null; -var r1b3 = c * null; - -var r1c1 = null * true; -var r1c2 = null * ''; -var r1c3 = null * {}; - -var r1d1 = true * null; -var r1d2 = '' * null; -var r1d3 = {} * null; - -// operator / -var r2a1 = null / a; -var r2a2 = null / b; -var r2a3 = null / c; - -var r2b1 = a / null; -var r2b2 = b / null; -var r2b3 = c / null; - -var r2c1 = null / true; -var r2c2 = null / ''; -var r2c3 = null / {}; - -var r2d1 = true / null; -var r2d2 = '' / null; -var r2d3 = {} / null; - -// operator % -var r3a1 = null % a; -var r3a2 = null % b; -var r3a3 = null % c; - -var r3b1 = a % null; -var r3b2 = b % null; -var r3b3 = c % null; - -var r3c1 = null % true; -var r3c2 = null % ''; -var r3c3 = null % {}; - -var r3d1 = true % null; -var r3d2 = '' % null; -var r3d3 = {} % null; - -// operator - -var r4a1 = null - a; -var r4a2 = null - b; -var r4a3 = null - c; - -var r4b1 = a - null; -var r4b2 = b - null; -var r4b3 = c - null; - -var r4c1 = null - true; -var r4c2 = null - ''; -var r4c3 = null - {}; - -var r4d1 = true - null; -var r4d2 = '' - null; -var r4d3 = {} - null; - -// operator << -var r5a1 = null << a; -var r5a2 = null << b; -var r5a3 = null << c; - -var r5b1 = a << null; -var r5b2 = b << null; -var r5b3 = c << null; - -var r5c1 = null << true; -var r5c2 = null << ''; -var r5c3 = null << {}; - -var r5d1 = true << null; -var r5d2 = '' << null; -var r5d3 = {} << null; - -// operator >> -var r6a1 = null >> a; -var r6a2 = null >> b; -var r6a3 = null >> c; - -var r6b1 = a >> null; -var r6b2 = b >> null; -var r6b3 = c >> null; - -var r6c1 = null >> true; -var r6c2 = null >> ''; -var r6c3 = null >> {}; - -var r6d1 = true >> null; -var r6d2 = '' >> null; -var r6d3 = {} >> null; - -// operator >>> -var r7a1 = null >>> a; -var r7a2 = null >>> b; -var r7a3 = null >>> c; - -var r7b1 = a >>> null; -var r7b2 = b >>> null; -var r7b3 = c >>> null; - -var r7c1 = null >>> true; -var r7c2 = null >>> ''; -var r7c3 = null >>> {}; - -var r7d1 = true >>> null; -var r7d2 = '' >>> null; -var r7d3 = {} >>> null; - -// operator & -var r8a1 = null & a; -var r8a2 = null & b; -var r8a3 = null & c; - -var r8b1 = a & null; -var r8b2 = b & null; -var r8b3 = c & null; - -var r8c1 = null & true; -var r8c2 = null & ''; -var r8c3 = null & {}; - -var r8d1 = true & null; -var r8d2 = '' & null; -var r8d3 = {} & null; - -// operator ^ -var r9a1 = null ^ a; -var r9a2 = null ^ b; -var r9a3 = null ^ c; - -var r9b1 = a ^ null; -var r9b2 = b ^ null; -var r9b3 = c ^ null; - -var r9c1 = null ^ true; -var r9c2 = null ^ ''; -var r9c3 = null ^ {}; - -var r9d1 = true ^ null; -var r9d2 = '' ^ null; -var r9d3 = {} ^ null; - -// operator | -var r10a1 = null | a; -var r10a2 = null | b; -var r10a3 = null | c; - -var r10b1 = a | null; -var r10b2 = b | null; -var r10b3 = c | null; - -var r10c1 = null | true; -var r10c2 = null | ''; -var r10c3 = null | {}; - -var r10d1 = true | null; -var r10d2 = '' | null; -var r10d3 = {} | null; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.json b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.json deleted file mode 100644 index a5352132f13..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.json +++ /dev/null @@ -1,5249 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 110, - "end": 1987, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 110, - "end": 133, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 135, - "end": 146, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 139, - "end": 145, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 139, - "end": 140, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 147, - "end": 161, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 151, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 151, - "end": 152, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 160, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 154, - "end": 160, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 177, - "end": 196, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 181, - "end": 195, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 197, - "end": 216, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 201, - "end": 215, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 201, - "end": 204, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 207, - "end": 215, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 214, - "end": 215, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 217, - "end": 236, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 221, - "end": 235, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 221, - "end": 224, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 227, - "end": 235, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 237, - "end": 258, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 241, - "end": 257, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 241, - "end": 244, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 247, - "end": 257, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 247, - "end": 251, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 254, - "end": 257, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 254, - "end": 255, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 256, - "end": 257, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 259, - "end": 278, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 263, - "end": 277, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 269, - "end": 277, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 273, - "end": 277, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 279, - "end": 298, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 283, - "end": 297, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 289, - "end": 297, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 293, - "end": 297, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 299, - "end": 318, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 303, - "end": 317, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 309, - "end": 317, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NumericLiteral", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 313, - "end": 317, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 319, - "end": 340, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 323, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "ra8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 329, - "end": 339, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "MemberExpression", - "span": { - "start": 329, - "end": 332, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 335, - "end": 339, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 375, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 374, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 363, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 366, - "end": 374, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 373, - "end": 374, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 376, - "end": 395, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 380, - "end": 394, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 380, - "end": 383, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 386, - "end": 394, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 386, - "end": 390, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 393, - "end": 394, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 396, - "end": 415, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 400, - "end": 414, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 406, - "end": 414, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 406, - "end": 410, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 413, - "end": 414, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 416, - "end": 437, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 420, - "end": 436, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 420, - "end": 423, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 426, - "end": 436, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 426, - "end": 430, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 433, - "end": 436, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 433, - "end": 434, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 438, - "end": 457, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 442, - "end": 456, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 442, - "end": 445, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 448, - "end": 456, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 452, - "end": 456, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 458, - "end": 477, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 462, - "end": 476, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 462, - "end": 465, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 468, - "end": 476, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 468, - "end": 469, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 472, - "end": 476, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 478, - "end": 497, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 482, - "end": 496, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 488, - "end": 496, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NumericLiteral", - "span": { - "start": 488, - "end": 489, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 492, - "end": 496, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 498, - "end": 519, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 502, - "end": 518, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 502, - "end": 505, - "ctxt": 0 - }, - "value": "rb8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 508, - "end": 518, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "MemberExpression", - "span": { - "start": 508, - "end": 511, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 508, - "end": 509, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 510, - "end": 511, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 514, - "end": 518, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 535, - "end": 554, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 539, - "end": 553, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 539, - "end": 542, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 545, - "end": 553, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 545, - "end": 549, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 552, - "end": 553, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 555, - "end": 574, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 559, - "end": 573, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 559, - "end": 562, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 565, - "end": 573, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 565, - "end": 569, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 572, - "end": 573, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 575, - "end": 594, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 579, - "end": 593, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 579, - "end": 582, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 585, - "end": 593, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 585, - "end": 589, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 592, - "end": 593, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 595, - "end": 616, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 599, - "end": 615, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 599, - "end": 602, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 605, - "end": 615, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 605, - "end": 609, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 612, - "end": 615, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 612, - "end": 613, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 614, - "end": 615, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 617, - "end": 636, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 621, - "end": 635, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 621, - "end": 624, - "ctxt": 0 - }, - "value": "rc5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 627, - "end": 635, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 627, - "end": 628, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 631, - "end": 635, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 637, - "end": 656, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 641, - "end": 655, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 641, - "end": 644, - "ctxt": 0 - }, - "value": "rc6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 647, - "end": 655, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 647, - "end": 648, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 651, - "end": 655, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 657, - "end": 676, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 661, - "end": 675, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 661, - "end": 664, - "ctxt": 0 - }, - "value": "rc7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 667, - "end": 675, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NumericLiteral", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 671, - "end": 675, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 677, - "end": 698, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 681, - "end": 697, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 681, - "end": 684, - "ctxt": 0 - }, - "value": "rc8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 687, - "end": 697, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "MemberExpression", - "span": { - "start": 687, - "end": 690, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 687, - "end": 688, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 689, - "end": 690, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 693, - "end": 697, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 714, - "end": 733, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 718, - "end": 732, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 718, - "end": 721, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 724, - "end": 732, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 724, - "end": 728, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 731, - "end": 732, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 734, - "end": 753, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 738, - "end": 752, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 738, - "end": 741, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 744, - "end": 752, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 744, - "end": 748, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 751, - "end": 752, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 754, - "end": 773, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 758, - "end": 772, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 758, - "end": 761, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 764, - "end": 772, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 764, - "end": 768, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 771, - "end": 772, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 774, - "end": 795, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 778, - "end": 794, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 778, - "end": 781, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 784, - "end": 794, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 784, - "end": 788, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 791, - "end": 794, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 791, - "end": 792, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 793, - "end": 794, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 796, - "end": 815, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 800, - "end": 814, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 800, - "end": 803, - "ctxt": 0 - }, - "value": "rd5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 806, - "end": 814, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 806, - "end": 807, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 810, - "end": 814, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 816, - "end": 835, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 820, - "end": 834, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 820, - "end": 823, - "ctxt": 0 - }, - "value": "rd6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 826, - "end": 834, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 826, - "end": 827, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 830, - "end": 834, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 836, - "end": 855, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 840, - "end": 854, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 840, - "end": 843, - "ctxt": 0 - }, - "value": "rd7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 846, - "end": 854, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NumericLiteral", - "span": { - "start": 846, - "end": 847, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 850, - "end": 854, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 856, - "end": 877, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 860, - "end": 876, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 860, - "end": 863, - "ctxt": 0 - }, - "value": "rd8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 866, - "end": 876, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "MemberExpression", - "span": { - "start": 866, - "end": 869, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 866, - "end": 867, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 868, - "end": 869, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 872, - "end": 876, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 894, - "end": 914, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 898, - "end": 913, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 898, - "end": 901, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 904, - "end": 913, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 904, - "end": 908, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 912, - "end": 913, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 915, - "end": 935, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 919, - "end": 934, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 919, - "end": 922, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 925, - "end": 934, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 925, - "end": 929, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 933, - "end": 934, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 936, - "end": 956, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 940, - "end": 955, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 940, - "end": 943, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 946, - "end": 955, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 946, - "end": 950, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 954, - "end": 955, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 957, - "end": 979, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 961, - "end": 978, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 961, - "end": 964, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 967, - "end": 978, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 967, - "end": 971, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 975, - "end": 978, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 975, - "end": 976, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 977, - "end": 978, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 980, - "end": 1000, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 984, - "end": 999, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "value": "re5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 990, - "end": 999, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 990, - "end": 991, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 995, - "end": 999, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1001, - "end": 1021, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1005, - "end": 1020, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1008, - "ctxt": 0 - }, - "value": "re6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1011, - "end": 1020, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1011, - "end": 1012, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1016, - "end": 1020, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1022, - "end": 1042, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1026, - "end": 1041, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1026, - "end": 1029, - "ctxt": 0 - }, - "value": "re7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1032, - "end": 1041, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1032, - "end": 1033, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1037, - "end": 1041, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1043, - "end": 1065, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1047, - "end": 1064, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1050, - "ctxt": 0 - }, - "value": "re8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1053, - "end": 1064, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "MemberExpression", - "span": { - "start": 1053, - "end": 1056, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1053, - "end": 1054, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1056, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1060, - "end": 1064, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1082, - "end": 1102, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1086, - "end": 1101, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1086, - "end": 1089, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1092, - "end": 1101, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1092, - "end": 1096, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1101, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1103, - "end": 1123, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1107, - "end": 1122, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1107, - "end": 1110, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1113, - "end": 1122, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1113, - "end": 1117, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1121, - "end": 1122, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1124, - "end": 1144, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1128, - "end": 1143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1128, - "end": 1131, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1134, - "end": 1143, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1134, - "end": 1138, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1142, - "end": 1143, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1145, - "end": 1167, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1149, - "end": 1166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1149, - "end": 1152, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1155, - "end": 1166, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1155, - "end": 1159, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1163, - "end": 1166, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1163, - "end": 1164, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1165, - "end": 1166, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1168, - "end": 1188, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1172, - "end": 1187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1172, - "end": 1175, - "ctxt": 0 - }, - "value": "rf5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1178, - "end": 1187, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1178, - "end": 1179, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1183, - "end": 1187, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1189, - "end": 1209, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1193, - "end": 1208, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1193, - "end": 1196, - "ctxt": 0 - }, - "value": "rf6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1199, - "end": 1208, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1199, - "end": 1200, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1204, - "end": 1208, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1210, - "end": 1230, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1214, - "end": 1229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1214, - "end": 1217, - "ctxt": 0 - }, - "value": "rf7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1220, - "end": 1229, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1220, - "end": 1221, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1225, - "end": 1229, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1231, - "end": 1253, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1235, - "end": 1252, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1235, - "end": 1238, - "ctxt": 0 - }, - "value": "rf8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1241, - "end": 1252, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "MemberExpression", - "span": { - "start": 1241, - "end": 1244, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1241, - "end": 1242, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1243, - "end": 1244, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1248, - "end": 1252, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1271, - "end": 1292, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1275, - "end": 1291, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1275, - "end": 1278, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1281, - "end": 1291, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1281, - "end": 1285, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1290, - "end": 1291, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1293, - "end": 1314, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1297, - "end": 1313, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1297, - "end": 1300, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1303, - "end": 1313, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1303, - "end": 1307, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1312, - "end": 1313, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1315, - "end": 1336, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1319, - "end": 1335, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1319, - "end": 1322, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1325, - "end": 1335, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1325, - "end": 1329, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1334, - "end": 1335, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1337, - "end": 1360, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1341, - "end": 1359, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1341, - "end": 1344, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1347, - "end": 1359, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 1347, - "end": 1351, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1356, - "end": 1359, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1356, - "end": 1357, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1358, - "end": 1359, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1361, - "end": 1382, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1365, - "end": 1381, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1365, - "end": 1368, - "ctxt": 0 - }, - "value": "rg5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1371, - "end": 1381, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1371, - "end": 1372, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1377, - "end": 1381, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1383, - "end": 1404, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1387, - "end": 1403, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1387, - "end": 1390, - "ctxt": 0 - }, - "value": "rg6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1393, - "end": 1403, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1393, - "end": 1394, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1399, - "end": 1403, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1405, - "end": 1426, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1409, - "end": 1425, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1409, - "end": 1412, - "ctxt": 0 - }, - "value": "rg7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1415, - "end": 1425, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1415, - "end": 1416, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1421, - "end": 1425, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1427, - "end": 1450, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1431, - "end": 1449, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1431, - "end": 1434, - "ctxt": 0 - }, - "value": "rg8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1437, - "end": 1449, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "MemberExpression", - "span": { - "start": 1437, - "end": 1440, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1437, - "end": 1438, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1439, - "end": 1440, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1445, - "end": 1449, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1466, - "end": 1485, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1470, - "end": 1484, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1470, - "end": 1473, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1476, - "end": 1484, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1476, - "end": 1480, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1483, - "end": 1484, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1486, - "end": 1505, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1490, - "end": 1504, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1490, - "end": 1493, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1496, - "end": 1504, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1496, - "end": 1500, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1503, - "end": 1504, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1506, - "end": 1525, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1510, - "end": 1524, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1513, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1516, - "end": 1524, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1516, - "end": 1520, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1523, - "end": 1524, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1526, - "end": 1547, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1530, - "end": 1546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1530, - "end": 1533, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1536, - "end": 1546, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1536, - "end": 1540, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1543, - "end": 1546, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1543, - "end": 1544, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1545, - "end": 1546, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1548, - "end": 1567, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1552, - "end": 1566, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1552, - "end": 1555, - "ctxt": 0 - }, - "value": "rh5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1558, - "end": 1566, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1558, - "end": 1559, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1562, - "end": 1566, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1568, - "end": 1587, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1572, - "end": 1586, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1572, - "end": 1575, - "ctxt": 0 - }, - "value": "rh6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1578, - "end": 1586, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1578, - "end": 1579, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1582, - "end": 1586, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1588, - "end": 1607, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1592, - "end": 1606, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1592, - "end": 1595, - "ctxt": 0 - }, - "value": "rh7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1598, - "end": 1606, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1598, - "end": 1599, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1602, - "end": 1606, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1608, - "end": 1629, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1612, - "end": 1628, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1612, - "end": 1615, - "ctxt": 0 - }, - "value": "rh8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1618, - "end": 1628, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "MemberExpression", - "span": { - "start": 1618, - "end": 1621, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1618, - "end": 1619, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1620, - "end": 1621, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1624, - "end": 1628, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1645, - "end": 1664, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1649, - "end": 1663, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1649, - "end": 1652, - "ctxt": 0 - }, - "value": "ri1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1655, - "end": 1663, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1655, - "end": 1659, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1662, - "end": 1663, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1665, - "end": 1684, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1669, - "end": 1683, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1669, - "end": 1672, - "ctxt": 0 - }, - "value": "ri2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1675, - "end": 1683, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1675, - "end": 1679, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1682, - "end": 1683, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1685, - "end": 1704, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1689, - "end": 1703, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1689, - "end": 1692, - "ctxt": 0 - }, - "value": "ri3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1695, - "end": 1703, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1695, - "end": 1699, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1702, - "end": 1703, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1705, - "end": 1726, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1709, - "end": 1725, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1709, - "end": 1712, - "ctxt": 0 - }, - "value": "ri4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1715, - "end": 1725, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1715, - "end": 1719, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1722, - "end": 1725, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1722, - "end": 1723, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1724, - "end": 1725, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1727, - "end": 1746, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1731, - "end": 1745, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1731, - "end": 1734, - "ctxt": 0 - }, - "value": "ri5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1737, - "end": 1745, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 1737, - "end": 1738, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1741, - "end": 1745, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1747, - "end": 1766, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1751, - "end": 1765, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1751, - "end": 1754, - "ctxt": 0 - }, - "value": "ri6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1757, - "end": 1765, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 1757, - "end": 1758, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1761, - "end": 1765, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1767, - "end": 1786, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1771, - "end": 1785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1774, - "ctxt": 0 - }, - "value": "ri7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1777, - "end": 1785, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1777, - "end": 1778, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1781, - "end": 1785, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1787, - "end": 1808, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1791, - "end": 1807, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1791, - "end": 1794, - "ctxt": 0 - }, - "value": "ri8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1797, - "end": 1807, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "MemberExpression", - "span": { - "start": 1797, - "end": 1800, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1797, - "end": 1798, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1799, - "end": 1800, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1803, - "end": 1807, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1824, - "end": 1843, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1828, - "end": 1842, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1828, - "end": 1831, - "ctxt": 0 - }, - "value": "rj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1834, - "end": 1842, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1834, - "end": 1838, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1841, - "end": 1842, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1844, - "end": 1863, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1848, - "end": 1862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1848, - "end": 1851, - "ctxt": 0 - }, - "value": "rj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1854, - "end": 1862, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1854, - "end": 1858, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1861, - "end": 1862, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1864, - "end": 1883, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1868, - "end": 1882, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1868, - "end": 1871, - "ctxt": 0 - }, - "value": "rj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1874, - "end": 1882, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1874, - "end": 1878, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1881, - "end": 1882, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1884, - "end": 1905, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1888, - "end": 1904, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1888, - "end": 1891, - "ctxt": 0 - }, - "value": "rj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1894, - "end": 1904, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1894, - "end": 1898, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1901, - "end": 1904, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1901, - "end": 1902, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1903, - "end": 1904, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1906, - "end": 1925, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1910, - "end": 1924, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1910, - "end": 1913, - "ctxt": 0 - }, - "value": "rj5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1916, - "end": 1924, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 1916, - "end": 1917, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1920, - "end": 1924, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1926, - "end": 1945, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1930, - "end": 1944, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1930, - "end": 1933, - "ctxt": 0 - }, - "value": "rj6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1936, - "end": 1944, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 1936, - "end": 1937, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1940, - "end": 1944, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1946, - "end": 1965, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1950, - "end": 1964, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1950, - "end": 1953, - "ctxt": 0 - }, - "value": "rj7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1956, - "end": 1964, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1956, - "end": 1957, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1960, - "end": 1964, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1966, - "end": 1987, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1970, - "end": 1986, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1970, - "end": 1973, - "ctxt": 0 - }, - "value": "rj8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1976, - "end": 1986, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "MemberExpression", - "span": { - "start": 1976, - "end": 1979, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1977, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1978, - "end": 1979, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1982, - "end": 1986, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.ts b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.ts deleted file mode 100644 index d173692f4f7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithNullValueAndValidOperands.ts +++ /dev/null @@ -1,110 +0,0 @@ -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. - -enum E { - a, - b -} - -var a: any; -var b: number; - -// operator * -var ra1 = null * a; -var ra2 = null * b; -var ra3 = null * 1; -var ra4 = null * E.a; -var ra5 = a * null; -var ra6 = b * null; -var ra7 = 0 * null; -var ra8 = E.b * null; - -// operator / -var rb1 = null / a; -var rb2 = null / b; -var rb3 = null / 1; -var rb4 = null / E.a; -var rb5 = a / null; -var rb6 = b / null; -var rb7 = 0 / null; -var rb8 = E.b / null; - -// operator % -var rc1 = null % a; -var rc2 = null % b; -var rc3 = null % 1; -var rc4 = null % E.a; -var rc5 = a % null; -var rc6 = b % null; -var rc7 = 0 % null; -var rc8 = E.b % null; - -// operator - -var rd1 = null - a; -var rd2 = null - b; -var rd3 = null - 1; -var rd4 = null - E.a; -var rd5 = a - null; -var rd6 = b - null; -var rd7 = 0 - null; -var rd8 = E.b - null; - -// operator << -var re1 = null << a; -var re2 = null << b; -var re3 = null << 1; -var re4 = null << E.a; -var re5 = a << null; -var re6 = b << null; -var re7 = 0 << null; -var re8 = E.b << null; - -// operator >> -var rf1 = null >> a; -var rf2 = null >> b; -var rf3 = null >> 1; -var rf4 = null >> E.a; -var rf5 = a >> null; -var rf6 = b >> null; -var rf7 = 0 >> null; -var rf8 = E.b >> null; - -// operator >>> -var rg1 = null >>> a; -var rg2 = null >>> b; -var rg3 = null >>> 1; -var rg4 = null >>> E.a; -var rg5 = a >>> null; -var rg6 = b >>> null; -var rg7 = 0 >>> null; -var rg8 = E.b >>> null; - -// operator & -var rh1 = null & a; -var rh2 = null & b; -var rh3 = null & 1; -var rh4 = null & E.a; -var rh5 = a & null; -var rh6 = b & null; -var rh7 = 0 & null; -var rh8 = E.b & null; - -// operator ^ -var ri1 = null ^ a; -var ri2 = null ^ b; -var ri3 = null ^ 1; -var ri4 = null ^ E.a; -var ri5 = a ^ null; -var ri6 = b ^ null; -var ri7 = 0 ^ null; -var ri8 = E.b ^ null; - -// operator | -var rj1 = null | a; -var rj2 = null | b; -var rj3 = null | 1; -var rj4 = null | E.a; -var rj5 = a | null; -var rj6 = b | null; -var rj7 = 0 | null; -var rj8 = E.b | null; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.json b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.json deleted file mode 100644 index 208337a96a1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.json +++ /dev/null @@ -1,2371 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 15, - "end": 1289, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 15, - "end": 37, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 19, - "end": 36, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 25, - "end": 36, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 25, - "end": 29, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 32, - "end": 36, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 38, - "end": 65, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 42, - "end": 64, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 42, - "end": 45, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 48, - "end": 64, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NullLiteral", - "span": { - "start": 48, - "end": 52, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 55, - "end": 64, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 66, - "end": 93, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 70, - "end": 92, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 70, - "end": 73, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 76, - "end": 92, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 76, - "end": 85, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 88, - "end": 92, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 94, - "end": 126, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 98, - "end": 125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 98, - "end": 101, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 104, - "end": 125, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 104, - "end": 113, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 116, - "end": 125, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 142, - "end": 164, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 146, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 149, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 152, - "end": 163, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 152, - "end": 156, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 192, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 169, - "end": 191, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 175, - "end": 191, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NullLiteral", - "span": { - "start": 175, - "end": 179, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 182, - "end": 191, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 193, - "end": 220, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 197, - "end": 219, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 203, - "end": 219, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 221, - "end": 253, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 225, - "end": 252, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 225, - "end": 228, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 231, - "end": 252, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 231, - "end": 240, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 269, - "end": 291, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 273, - "end": 290, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 273, - "end": 276, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 279, - "end": 290, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 279, - "end": 283, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 286, - "end": 290, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 292, - "end": 319, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 296, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 296, - "end": 299, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 302, - "end": 318, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NullLiteral", - "span": { - "start": 302, - "end": 306, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 309, - "end": 318, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 347, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 324, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 330, - "end": 346, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 330, - "end": 339, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 342, - "end": 346, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 348, - "end": 380, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 352, - "end": 379, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 352, - "end": 355, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 358, - "end": 379, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 358, - "end": 367, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 370, - "end": 379, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 396, - "end": 418, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 400, - "end": 417, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 406, - "end": 417, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 406, - "end": 410, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 413, - "end": 417, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 419, - "end": 446, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 423, - "end": 445, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 429, - "end": 445, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NullLiteral", - "span": { - "start": 429, - "end": 433, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 436, - "end": 445, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 447, - "end": 474, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 451, - "end": 473, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 457, - "end": 473, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 457, - "end": 466, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 469, - "end": 473, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 475, - "end": 507, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 479, - "end": 506, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 479, - "end": 482, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 485, - "end": 506, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 485, - "end": 494, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 497, - "end": 506, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 524, - "end": 547, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 528, - "end": 546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 528, - "end": 531, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 534, - "end": 546, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 534, - "end": 538, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 542, - "end": 546, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 548, - "end": 576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 552, - "end": 575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 552, - "end": 555, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 558, - "end": 575, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NullLiteral", - "span": { - "start": 558, - "end": 562, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 566, - "end": 575, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 577, - "end": 605, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 581, - "end": 604, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 581, - "end": 584, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 587, - "end": 604, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 587, - "end": 596, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 600, - "end": 604, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 606, - "end": 639, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 610, - "end": 638, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 610, - "end": 613, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 616, - "end": 638, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 616, - "end": 625, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 629, - "end": 638, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 656, - "end": 679, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 660, - "end": 678, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 660, - "end": 663, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 666, - "end": 678, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 666, - "end": 670, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 674, - "end": 678, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 680, - "end": 708, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 684, - "end": 707, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 684, - "end": 687, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 690, - "end": 707, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NullLiteral", - "span": { - "start": 690, - "end": 694, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 698, - "end": 707, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 709, - "end": 737, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 713, - "end": 736, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 713, - "end": 716, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 719, - "end": 736, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 719, - "end": 728, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 732, - "end": 736, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 738, - "end": 771, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 742, - "end": 770, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 742, - "end": 745, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 748, - "end": 770, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 748, - "end": 757, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 761, - "end": 770, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 789, - "end": 813, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 793, - "end": 812, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 793, - "end": 796, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 799, - "end": 812, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 799, - "end": 803, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 808, - "end": 812, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 814, - "end": 843, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 818, - "end": 842, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 818, - "end": 821, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 824, - "end": 842, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NullLiteral", - "span": { - "start": 824, - "end": 828, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 833, - "end": 842, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 844, - "end": 873, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 848, - "end": 872, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 848, - "end": 851, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 854, - "end": 872, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 854, - "end": 863, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 868, - "end": 872, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 874, - "end": 908, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 878, - "end": 907, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 878, - "end": 881, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 884, - "end": 907, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 884, - "end": 893, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 898, - "end": 907, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 924, - "end": 946, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 928, - "end": 945, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 928, - "end": 931, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 934, - "end": 945, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 934, - "end": 938, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 941, - "end": 945, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 947, - "end": 974, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 951, - "end": 973, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 951, - "end": 954, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 957, - "end": 973, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NullLiteral", - "span": { - "start": 957, - "end": 961, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 964, - "end": 973, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 975, - "end": 1002, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 979, - "end": 1001, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 979, - "end": 982, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 985, - "end": 1001, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 985, - "end": 994, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 997, - "end": 1001, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1003, - "end": 1035, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1007, - "end": 1034, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1007, - "end": 1010, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1013, - "end": 1034, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1013, - "end": 1022, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1025, - "end": 1034, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1051, - "end": 1073, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1055, - "end": 1072, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1058, - "ctxt": 0 - }, - "value": "ri1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1061, - "end": 1072, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1061, - "end": 1065, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1068, - "end": 1072, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1074, - "end": 1101, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1078, - "end": 1100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1078, - "end": 1081, - "ctxt": 0 - }, - "value": "ri2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1084, - "end": 1100, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NullLiteral", - "span": { - "start": 1084, - "end": 1088, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1100, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1102, - "end": 1129, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1106, - "end": 1128, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1106, - "end": 1109, - "ctxt": 0 - }, - "value": "ri3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1112, - "end": 1128, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 1112, - "end": 1121, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1124, - "end": 1128, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1130, - "end": 1162, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1134, - "end": 1161, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1134, - "end": 1137, - "ctxt": 0 - }, - "value": "ri4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1140, - "end": 1161, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 1140, - "end": 1149, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1152, - "end": 1161, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1178, - "end": 1200, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1182, - "end": 1199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1182, - "end": 1185, - "ctxt": 0 - }, - "value": "rj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1188, - "end": 1199, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1188, - "end": 1192, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1195, - "end": 1199, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1201, - "end": 1228, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1205, - "end": 1227, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1205, - "end": 1208, - "ctxt": 0 - }, - "value": "rj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1211, - "end": 1227, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NullLiteral", - "span": { - "start": 1211, - "end": 1215, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1218, - "end": 1227, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1229, - "end": 1256, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1233, - "end": 1255, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1233, - "end": 1236, - "ctxt": 0 - }, - "value": "rj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1239, - "end": 1255, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 1239, - "end": 1248, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1251, - "end": 1255, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1257, - "end": 1289, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1261, - "end": 1288, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1261, - "end": 1264, - "ctxt": 0 - }, - "value": "rj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1267, - "end": 1288, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 1267, - "end": 1276, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1279, - "end": 1288, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts deleted file mode 100644 index 03b8c0b8ade..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.ts +++ /dev/null @@ -1,59 +0,0 @@ -// operator * -var ra1 = null * null; -var ra2 = null * undefined; -var ra3 = undefined * null; -var ra4 = undefined * undefined; - -// operator / -var rb1 = null / null; -var rb2 = null / undefined; -var rb3 = undefined / null; -var rb4 = undefined / undefined; - -// operator % -var rc1 = null % null; -var rc2 = null % undefined; -var rc3 = undefined % null; -var rc4 = undefined % undefined; - -// operator - -var rd1 = null - null; -var rd2 = null - undefined; -var rd3 = undefined - null; -var rd4 = undefined - undefined; - -// operator << -var re1 = null << null; -var re2 = null << undefined; -var re3 = undefined << null; -var re4 = undefined << undefined; - -// operator >> -var rf1 = null >> null; -var rf2 = null >> undefined; -var rf3 = undefined >> null; -var rf4 = undefined >> undefined; - -// operator >>> -var rg1 = null >>> null; -var rg2 = null >>> undefined; -var rg3 = undefined >>> null; -var rg4 = undefined >>> undefined; - -// operator & -var rh1 = null & null; -var rh2 = null & undefined; -var rh3 = undefined & null; -var rh4 = undefined & undefined; - -// operator ^ -var ri1 = null ^ null; -var ri2 = null ^ undefined; -var ri3 = undefined ^ null; -var ri4 = undefined ^ undefined; - -// operator | -var rj1 = null | null; -var rj2 = null | undefined; -var rj3 = undefined | null; -var rj4 = undefined | undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.json deleted file mode 100644 index 586066c14ec..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.json +++ /dev/null @@ -1,7448 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 115, - "end": 3624, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 115, - "end": 130, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 120, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 131, - "end": 145, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 135, - "end": 144, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 146, - "end": 160, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 150, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 151, - "end": 159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 153, - "end": 159, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 153, - "end": 159, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 176, - "end": 201, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 180, - "end": 200, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - }, - "value": "r1a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 187, - "end": 200, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 187, - "end": 196, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 202, - "end": 227, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 206, - "end": 226, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 206, - "end": 210, - "ctxt": 0 - }, - "value": "r1a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 213, - "end": 226, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 228, - "end": 253, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 232, - "end": 252, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 232, - "end": 236, - "ctxt": 0 - }, - "value": "r1a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 239, - "end": 252, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 239, - "end": 248, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 251, - "end": 252, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 255, - "end": 280, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 259, - "end": 279, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 259, - "end": 263, - "ctxt": 0 - }, - "value": "r1b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 266, - "end": 279, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 270, - "end": 279, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 281, - "end": 306, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 285, - "end": 305, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 285, - "end": 289, - "ctxt": 0 - }, - "value": "r1b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 292, - "end": 305, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 296, - "end": 305, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 307, - "end": 332, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 311, - "end": 331, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 311, - "end": 315, - "ctxt": 0 - }, - "value": "r1b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 318, - "end": 331, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 318, - "end": 319, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 322, - "end": 331, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 334, - "end": 362, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 338, - "end": 361, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 338, - "end": 342, - "ctxt": 0 - }, - "value": "r1c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 345, - "end": 361, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 345, - "end": 354, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 363, - "end": 389, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 367, - "end": 388, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 367, - "end": 371, - "ctxt": 0 - }, - "value": "r1c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 374, - "end": 388, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 374, - "end": 383, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 386, - "end": 388, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 390, - "end": 416, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 394, - "end": 415, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 394, - "end": 398, - "ctxt": 0 - }, - "value": "r1c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 401, - "end": 415, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 401, - "end": 410, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 413, - "end": 415, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 418, - "end": 446, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 422, - "end": 445, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 422, - "end": 426, - "ctxt": 0 - }, - "value": "r1d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 429, - "end": 445, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 429, - "end": 433, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 436, - "end": 445, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 447, - "end": 473, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 451, - "end": 472, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 451, - "end": 455, - "ctxt": 0 - }, - "value": "r1d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 458, - "end": 472, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "StringLiteral", - "span": { - "start": 458, - "end": 460, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 463, - "end": 472, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 474, - "end": 500, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 478, - "end": 499, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 478, - "end": 482, - "ctxt": 0 - }, - "value": "r1d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 485, - "end": 499, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "ObjectExpression", - "span": { - "start": 485, - "end": 487, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 490, - "end": 499, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 516, - "end": 541, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 520, - "end": 540, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 520, - "end": 524, - "ctxt": 0 - }, - "value": "r2a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 527, - "end": 540, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 527, - "end": 536, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 542, - "end": 567, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 546, - "end": 566, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 546, - "end": 550, - "ctxt": 0 - }, - "value": "r2a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 553, - "end": 566, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 553, - "end": 562, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 565, - "end": 566, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 568, - "end": 593, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 572, - "end": 592, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 572, - "end": 576, - "ctxt": 0 - }, - "value": "r2a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 579, - "end": 592, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 579, - "end": 588, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 591, - "end": 592, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 595, - "end": 620, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 599, - "end": 619, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 599, - "end": 603, - "ctxt": 0 - }, - "value": "r2b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 606, - "end": 619, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 610, - "end": 619, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 621, - "end": 646, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 625, - "end": 645, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 625, - "end": 629, - "ctxt": 0 - }, - "value": "r2b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 632, - "end": 645, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 632, - "end": 633, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 636, - "end": 645, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 647, - "end": 672, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 651, - "end": 671, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 651, - "end": 655, - "ctxt": 0 - }, - "value": "r2b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 658, - "end": 671, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 658, - "end": 659, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 662, - "end": 671, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 674, - "end": 702, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 678, - "end": 701, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 678, - "end": 682, - "ctxt": 0 - }, - "value": "r2c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 685, - "end": 701, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 685, - "end": 694, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 697, - "end": 701, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 703, - "end": 729, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 707, - "end": 728, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 707, - "end": 711, - "ctxt": 0 - }, - "value": "r2c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 714, - "end": 728, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 714, - "end": 723, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 726, - "end": 728, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 730, - "end": 756, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 734, - "end": 755, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 734, - "end": 738, - "ctxt": 0 - }, - "value": "r2c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 741, - "end": 755, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 741, - "end": 750, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 753, - "end": 755, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 758, - "end": 786, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 762, - "end": 785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 762, - "end": 766, - "ctxt": 0 - }, - "value": "r2d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 769, - "end": 785, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 769, - "end": 773, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 776, - "end": 785, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 787, - "end": 813, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 791, - "end": 812, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 791, - "end": 795, - "ctxt": 0 - }, - "value": "r2d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 798, - "end": 812, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "StringLiteral", - "span": { - "start": 798, - "end": 800, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 803, - "end": 812, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 814, - "end": 840, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 818, - "end": 839, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 818, - "end": 822, - "ctxt": 0 - }, - "value": "r2d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 825, - "end": 839, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "ObjectExpression", - "span": { - "start": 825, - "end": 827, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 830, - "end": 839, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 856, - "end": 881, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 860, - "end": 880, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 860, - "end": 864, - "ctxt": 0 - }, - "value": "r3a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 867, - "end": 880, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 867, - "end": 876, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 879, - "end": 880, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 882, - "end": 907, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 886, - "end": 906, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 886, - "end": 890, - "ctxt": 0 - }, - "value": "r3a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 893, - "end": 906, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 893, - "end": 902, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 905, - "end": 906, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 908, - "end": 933, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 912, - "end": 932, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 912, - "end": 916, - "ctxt": 0 - }, - "value": "r3a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 919, - "end": 932, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 919, - "end": 928, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 931, - "end": 932, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 935, - "end": 960, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 939, - "end": 959, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 939, - "end": 943, - "ctxt": 0 - }, - "value": "r3b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 946, - "end": 959, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 946, - "end": 947, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 950, - "end": 959, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 961, - "end": 986, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 965, - "end": 985, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 965, - "end": 969, - "ctxt": 0 - }, - "value": "r3b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 972, - "end": 985, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 972, - "end": 973, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 976, - "end": 985, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 987, - "end": 1012, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 991, - "end": 1011, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 991, - "end": 995, - "ctxt": 0 - }, - "value": "r3b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 998, - "end": 1011, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 998, - "end": 999, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1002, - "end": 1011, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1014, - "end": 1042, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1018, - "end": 1041, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1018, - "end": 1022, - "ctxt": 0 - }, - "value": "r3c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1025, - "end": 1041, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 1025, - "end": 1034, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1037, - "end": 1041, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1043, - "end": 1069, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1047, - "end": 1068, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1051, - "ctxt": 0 - }, - "value": "r3c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1054, - "end": 1068, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 1054, - "end": 1063, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1066, - "end": 1068, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1070, - "end": 1096, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1074, - "end": 1095, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1074, - "end": 1078, - "ctxt": 0 - }, - "value": "r3c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1081, - "end": 1095, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 1081, - "end": 1090, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1093, - "end": 1095, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1098, - "end": 1126, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1102, - "end": 1125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1102, - "end": 1106, - "ctxt": 0 - }, - "value": "r3d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1109, - "end": 1125, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1109, - "end": 1113, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1125, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1127, - "end": 1153, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1131, - "end": 1152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1131, - "end": 1135, - "ctxt": 0 - }, - "value": "r3d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1138, - "end": 1152, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "StringLiteral", - "span": { - "start": 1138, - "end": 1140, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1152, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1154, - "end": 1180, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1158, - "end": 1179, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1158, - "end": 1162, - "ctxt": 0 - }, - "value": "r3d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1165, - "end": 1179, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1165, - "end": 1167, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 1170, - "end": 1179, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1196, - "end": 1221, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1200, - "end": 1220, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1200, - "end": 1204, - "ctxt": 0 - }, - "value": "r4a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1207, - "end": 1220, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1207, - "end": 1216, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1219, - "end": 1220, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1222, - "end": 1247, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1226, - "end": 1246, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1230, - "ctxt": 0 - }, - "value": "r4a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1233, - "end": 1246, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1233, - "end": 1242, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1245, - "end": 1246, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1248, - "end": 1273, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1252, - "end": 1272, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1252, - "end": 1256, - "ctxt": 0 - }, - "value": "r4a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1259, - "end": 1272, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1259, - "end": 1268, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1271, - "end": 1272, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1275, - "end": 1300, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1279, - "end": 1299, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1279, - "end": 1283, - "ctxt": 0 - }, - "value": "r4b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1286, - "end": 1299, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1286, - "end": 1287, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1290, - "end": 1299, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1301, - "end": 1326, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1305, - "end": 1325, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1305, - "end": 1309, - "ctxt": 0 - }, - "value": "r4b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1312, - "end": 1325, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1312, - "end": 1313, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1316, - "end": 1325, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1327, - "end": 1352, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1331, - "end": 1351, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1331, - "end": 1335, - "ctxt": 0 - }, - "value": "r4b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1338, - "end": 1351, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1338, - "end": 1339, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1342, - "end": 1351, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1354, - "end": 1382, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1358, - "end": 1381, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1358, - "end": 1362, - "ctxt": 0 - }, - "value": "r4c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1365, - "end": 1381, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1365, - "end": 1374, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1377, - "end": 1381, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1383, - "end": 1409, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1387, - "end": 1408, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1387, - "end": 1391, - "ctxt": 0 - }, - "value": "r4c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1394, - "end": 1408, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1394, - "end": 1403, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1406, - "end": 1408, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1410, - "end": 1436, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1414, - "end": 1435, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1414, - "end": 1418, - "ctxt": 0 - }, - "value": "r4c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1421, - "end": 1435, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 1421, - "end": 1430, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1433, - "end": 1435, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1438, - "end": 1466, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1442, - "end": 1465, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1442, - "end": 1446, - "ctxt": 0 - }, - "value": "r4d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1449, - "end": 1465, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1449, - "end": 1453, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 1456, - "end": 1465, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1467, - "end": 1493, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1471, - "end": 1492, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1471, - "end": 1475, - "ctxt": 0 - }, - "value": "r4d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1478, - "end": 1492, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "StringLiteral", - "span": { - "start": 1478, - "end": 1480, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1483, - "end": 1492, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1494, - "end": 1520, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1498, - "end": 1519, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1498, - "end": 1502, - "ctxt": 0 - }, - "value": "r4d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1505, - "end": 1519, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1505, - "end": 1507, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1519, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1537, - "end": 1563, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1541, - "end": 1562, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1541, - "end": 1545, - "ctxt": 0 - }, - "value": "r5a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1548, - "end": 1562, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1548, - "end": 1557, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1561, - "end": 1562, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1564, - "end": 1590, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1568, - "end": 1589, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1568, - "end": 1572, - "ctxt": 0 - }, - "value": "r5a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1575, - "end": 1589, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1575, - "end": 1584, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1588, - "end": 1589, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1591, - "end": 1617, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1595, - "end": 1616, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1595, - "end": 1599, - "ctxt": 0 - }, - "value": "r5a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1602, - "end": 1616, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1602, - "end": 1611, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1615, - "end": 1616, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1619, - "end": 1645, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1623, - "end": 1644, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1627, - "ctxt": 0 - }, - "value": "r5b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1630, - "end": 1644, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1630, - "end": 1631, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1635, - "end": 1644, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1646, - "end": 1672, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1650, - "end": 1671, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1650, - "end": 1654, - "ctxt": 0 - }, - "value": "r5b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1657, - "end": 1671, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1657, - "end": 1658, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1662, - "end": 1671, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1673, - "end": 1699, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1677, - "end": 1698, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1677, - "end": 1681, - "ctxt": 0 - }, - "value": "r5b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1684, - "end": 1698, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1684, - "end": 1685, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1689, - "end": 1698, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1701, - "end": 1730, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1705, - "end": 1729, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1705, - "end": 1709, - "ctxt": 0 - }, - "value": "r5c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1712, - "end": 1729, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1712, - "end": 1721, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 1725, - "end": 1729, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1731, - "end": 1758, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1735, - "end": 1757, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1735, - "end": 1739, - "ctxt": 0 - }, - "value": "r5c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1742, - "end": 1757, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1742, - "end": 1751, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1755, - "end": 1757, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1759, - "end": 1786, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1763, - "end": 1785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1763, - "end": 1767, - "ctxt": 0 - }, - "value": "r5c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1770, - "end": 1785, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1770, - "end": 1779, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1783, - "end": 1785, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1788, - "end": 1817, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1792, - "end": 1816, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1792, - "end": 1796, - "ctxt": 0 - }, - "value": "r5d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1799, - "end": 1816, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 1799, - "end": 1803, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 1807, - "end": 1816, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1818, - "end": 1845, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1822, - "end": 1844, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1822, - "end": 1826, - "ctxt": 0 - }, - "value": "r5d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1829, - "end": 1844, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "StringLiteral", - "span": { - "start": 1829, - "end": 1831, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1835, - "end": 1844, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1846, - "end": 1873, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1850, - "end": 1872, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1850, - "end": 1854, - "ctxt": 0 - }, - "value": "r5d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1857, - "end": 1872, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "ObjectExpression", - "span": { - "start": 1857, - "end": 1859, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 1863, - "end": 1872, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1890, - "end": 1916, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1894, - "end": 1915, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1894, - "end": 1898, - "ctxt": 0 - }, - "value": "r6a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1901, - "end": 1915, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1901, - "end": 1910, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1914, - "end": 1915, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1917, - "end": 1943, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1921, - "end": 1942, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1921, - "end": 1925, - "ctxt": 0 - }, - "value": "r6a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1928, - "end": 1942, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1928, - "end": 1937, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1941, - "end": 1942, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1944, - "end": 1970, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1948, - "end": 1969, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1948, - "end": 1952, - "ctxt": 0 - }, - "value": "r6a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1955, - "end": 1969, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1955, - "end": 1964, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1968, - "end": 1969, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1972, - "end": 1998, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1976, - "end": 1997, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1980, - "ctxt": 0 - }, - "value": "r6b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1983, - "end": 1997, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1983, - "end": 1984, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1988, - "end": 1997, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1999, - "end": 2025, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2003, - "end": 2024, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2003, - "end": 2007, - "ctxt": 0 - }, - "value": "r6b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2010, - "end": 2024, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 2010, - "end": 2011, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2015, - "end": 2024, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2026, - "end": 2052, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2030, - "end": 2051, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2030, - "end": 2034, - "ctxt": 0 - }, - "value": "r6b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2037, - "end": 2051, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 2037, - "end": 2038, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2042, - "end": 2051, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2054, - "end": 2083, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2058, - "end": 2082, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2058, - "end": 2062, - "ctxt": 0 - }, - "value": "r6c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2065, - "end": 2082, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 2065, - "end": 2074, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2078, - "end": 2082, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2084, - "end": 2111, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2088, - "end": 2110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2088, - "end": 2092, - "ctxt": 0 - }, - "value": "r6c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2095, - "end": 2110, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 2095, - "end": 2104, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2108, - "end": 2110, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2112, - "end": 2139, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2116, - "end": 2138, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2116, - "end": 2120, - "ctxt": 0 - }, - "value": "r6c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2123, - "end": 2138, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 2123, - "end": 2132, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2136, - "end": 2138, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2141, - "end": 2170, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2145, - "end": 2169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2145, - "end": 2149, - "ctxt": 0 - }, - "value": "r6d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2152, - "end": 2169, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2152, - "end": 2156, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 2160, - "end": 2169, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2171, - "end": 2198, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2175, - "end": 2197, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2175, - "end": 2179, - "ctxt": 0 - }, - "value": "r6d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2182, - "end": 2197, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "StringLiteral", - "span": { - "start": 2182, - "end": 2184, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 2188, - "end": 2197, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2199, - "end": 2226, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2203, - "end": 2225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2203, - "end": 2207, - "ctxt": 0 - }, - "value": "r6d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2210, - "end": 2225, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2210, - "end": 2212, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 2216, - "end": 2225, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2244, - "end": 2271, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2248, - "end": 2270, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2248, - "end": 2252, - "ctxt": 0 - }, - "value": "r7a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2255, - "end": 2270, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2255, - "end": 2264, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2269, - "end": 2270, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2272, - "end": 2299, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2276, - "end": 2298, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2276, - "end": 2280, - "ctxt": 0 - }, - "value": "r7a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2283, - "end": 2298, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2283, - "end": 2292, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2297, - "end": 2298, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2300, - "end": 2327, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2304, - "end": 2326, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2304, - "end": 2308, - "ctxt": 0 - }, - "value": "r7a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2311, - "end": 2326, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2311, - "end": 2320, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2325, - "end": 2326, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2329, - "end": 2356, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2333, - "end": 2355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2333, - "end": 2337, - "ctxt": 0 - }, - "value": "r7b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2340, - "end": 2355, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2340, - "end": 2341, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2346, - "end": 2355, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2357, - "end": 2384, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2361, - "end": 2383, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2361, - "end": 2365, - "ctxt": 0 - }, - "value": "r7b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2368, - "end": 2383, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2368, - "end": 2369, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2374, - "end": 2383, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2385, - "end": 2412, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2389, - "end": 2411, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2389, - "end": 2393, - "ctxt": 0 - }, - "value": "r7b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2396, - "end": 2411, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2396, - "end": 2397, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2402, - "end": 2411, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2414, - "end": 2444, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2418, - "end": 2443, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2418, - "end": 2422, - "ctxt": 0 - }, - "value": "r7c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2425, - "end": 2443, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2425, - "end": 2434, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2439, - "end": 2443, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2445, - "end": 2473, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2449, - "end": 2472, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2449, - "end": 2453, - "ctxt": 0 - }, - "value": "r7c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2456, - "end": 2472, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2456, - "end": 2465, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2470, - "end": 2472, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2474, - "end": 2502, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2478, - "end": 2501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2478, - "end": 2482, - "ctxt": 0 - }, - "value": "r7c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2485, - "end": 2501, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 2485, - "end": 2494, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2499, - "end": 2501, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2504, - "end": 2534, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2508, - "end": 2533, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2508, - "end": 2512, - "ctxt": 0 - }, - "value": "r7d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2515, - "end": 2533, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2515, - "end": 2519, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 2524, - "end": 2533, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2535, - "end": 2563, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2539, - "end": 2562, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2539, - "end": 2543, - "ctxt": 0 - }, - "value": "r7d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2546, - "end": 2562, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "StringLiteral", - "span": { - "start": 2546, - "end": 2548, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 2553, - "end": 2562, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2564, - "end": 2592, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2568, - "end": 2591, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2568, - "end": 2572, - "ctxt": 0 - }, - "value": "r7d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2575, - "end": 2591, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2575, - "end": 2577, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 2582, - "end": 2591, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2608, - "end": 2633, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2612, - "end": 2632, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2612, - "end": 2616, - "ctxt": 0 - }, - "value": "r8a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2619, - "end": 2632, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2619, - "end": 2628, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2631, - "end": 2632, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2634, - "end": 2659, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2638, - "end": 2658, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2638, - "end": 2642, - "ctxt": 0 - }, - "value": "r8a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2645, - "end": 2658, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2645, - "end": 2654, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2657, - "end": 2658, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2660, - "end": 2685, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2664, - "end": 2684, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2664, - "end": 2668, - "ctxt": 0 - }, - "value": "r8a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2671, - "end": 2684, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2671, - "end": 2680, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2683, - "end": 2684, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2687, - "end": 2712, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2691, - "end": 2711, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2691, - "end": 2695, - "ctxt": 0 - }, - "value": "r8b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2698, - "end": 2711, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2698, - "end": 2699, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2702, - "end": 2711, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2713, - "end": 2738, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2717, - "end": 2737, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2717, - "end": 2721, - "ctxt": 0 - }, - "value": "r8b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2724, - "end": 2737, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2724, - "end": 2725, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2728, - "end": 2737, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2739, - "end": 2764, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2743, - "end": 2763, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2743, - "end": 2747, - "ctxt": 0 - }, - "value": "r8b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2750, - "end": 2763, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2750, - "end": 2751, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2754, - "end": 2763, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2766, - "end": 2794, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2770, - "end": 2793, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2770, - "end": 2774, - "ctxt": 0 - }, - "value": "r8c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2777, - "end": 2793, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2777, - "end": 2786, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 2789, - "end": 2793, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2795, - "end": 2821, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2799, - "end": 2820, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2799, - "end": 2803, - "ctxt": 0 - }, - "value": "r8c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2806, - "end": 2820, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2806, - "end": 2815, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2818, - "end": 2820, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2822, - "end": 2848, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2826, - "end": 2847, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2826, - "end": 2830, - "ctxt": 0 - }, - "value": "r8c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2833, - "end": 2847, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 2833, - "end": 2842, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 2845, - "end": 2847, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2850, - "end": 2878, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2854, - "end": 2877, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2854, - "end": 2858, - "ctxt": 0 - }, - "value": "r8d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2861, - "end": 2877, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 2861, - "end": 2865, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 2868, - "end": 2877, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2879, - "end": 2905, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2883, - "end": 2904, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2883, - "end": 2887, - "ctxt": 0 - }, - "value": "r8d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2890, - "end": 2904, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "StringLiteral", - "span": { - "start": 2890, - "end": 2892, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 2895, - "end": 2904, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2906, - "end": 2932, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2910, - "end": 2931, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2910, - "end": 2914, - "ctxt": 0 - }, - "value": "r8d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2917, - "end": 2931, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "ObjectExpression", - "span": { - "start": 2917, - "end": 2919, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 2922, - "end": 2931, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2948, - "end": 2973, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2952, - "end": 2972, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2952, - "end": 2956, - "ctxt": 0 - }, - "value": "r9a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2959, - "end": 2972, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2959, - "end": 2968, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2971, - "end": 2972, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2974, - "end": 2999, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2978, - "end": 2998, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2978, - "end": 2982, - "ctxt": 0 - }, - "value": "r9a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2985, - "end": 2998, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2985, - "end": 2994, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2997, - "end": 2998, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3000, - "end": 3025, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3004, - "end": 3024, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3004, - "end": 3008, - "ctxt": 0 - }, - "value": "r9a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3011, - "end": 3024, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3011, - "end": 3020, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3023, - "end": 3024, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3027, - "end": 3052, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3031, - "end": 3051, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3031, - "end": 3035, - "ctxt": 0 - }, - "value": "r9b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3038, - "end": 3051, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3038, - "end": 3039, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3042, - "end": 3051, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3053, - "end": 3078, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3057, - "end": 3077, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3057, - "end": 3061, - "ctxt": 0 - }, - "value": "r9b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3064, - "end": 3077, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3064, - "end": 3065, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3068, - "end": 3077, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3079, - "end": 3104, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3083, - "end": 3103, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3083, - "end": 3087, - "ctxt": 0 - }, - "value": "r9b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3090, - "end": 3103, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3090, - "end": 3091, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3094, - "end": 3103, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3106, - "end": 3134, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3110, - "end": 3133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3110, - "end": 3114, - "ctxt": 0 - }, - "value": "r9c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3117, - "end": 3133, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3117, - "end": 3126, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 3129, - "end": 3133, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3135, - "end": 3161, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3139, - "end": 3160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3139, - "end": 3143, - "ctxt": 0 - }, - "value": "r9c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3146, - "end": 3160, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3146, - "end": 3155, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 3158, - "end": 3160, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3162, - "end": 3188, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3166, - "end": 3187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3166, - "end": 3170, - "ctxt": 0 - }, - "value": "r9c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3173, - "end": 3187, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 3173, - "end": 3182, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 3185, - "end": 3187, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3190, - "end": 3218, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3194, - "end": 3217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3194, - "end": 3198, - "ctxt": 0 - }, - "value": "r9d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3201, - "end": 3217, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 3201, - "end": 3205, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 3208, - "end": 3217, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3219, - "end": 3245, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3223, - "end": 3244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3223, - "end": 3227, - "ctxt": 0 - }, - "value": "r9d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3230, - "end": 3244, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "StringLiteral", - "span": { - "start": 3230, - "end": 3232, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 3235, - "end": 3244, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3246, - "end": 3272, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3250, - "end": 3271, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3250, - "end": 3254, - "ctxt": 0 - }, - "value": "r9d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3257, - "end": 3271, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "ObjectExpression", - "span": { - "start": 3257, - "end": 3259, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 3262, - "end": 3271, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3288, - "end": 3314, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3292, - "end": 3313, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3292, - "end": 3297, - "ctxt": 0 - }, - "value": "r10a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3300, - "end": 3313, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3300, - "end": 3309, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3312, - "end": 3313, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3315, - "end": 3341, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3319, - "end": 3340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3319, - "end": 3324, - "ctxt": 0 - }, - "value": "r10a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3327, - "end": 3340, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3327, - "end": 3336, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3339, - "end": 3340, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3342, - "end": 3368, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3346, - "end": 3367, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3346, - "end": 3351, - "ctxt": 0 - }, - "value": "r10a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3354, - "end": 3367, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3354, - "end": 3363, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3366, - "end": 3367, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3370, - "end": 3396, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3374, - "end": 3395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3374, - "end": 3379, - "ctxt": 0 - }, - "value": "r10b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3382, - "end": 3395, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3382, - "end": 3383, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3386, - "end": 3395, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3397, - "end": 3423, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3401, - "end": 3422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3401, - "end": 3406, - "ctxt": 0 - }, - "value": "r10b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3409, - "end": 3422, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3409, - "end": 3410, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3413, - "end": 3422, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3424, - "end": 3450, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3428, - "end": 3449, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3428, - "end": 3433, - "ctxt": 0 - }, - "value": "r10b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3436, - "end": 3449, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3436, - "end": 3437, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3440, - "end": 3449, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3452, - "end": 3481, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3456, - "end": 3480, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3456, - "end": 3461, - "ctxt": 0 - }, - "value": "r10c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3464, - "end": 3480, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3464, - "end": 3473, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 3476, - "end": 3480, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3482, - "end": 3509, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3486, - "end": 3508, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3486, - "end": 3491, - "ctxt": 0 - }, - "value": "r10c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3494, - "end": 3508, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3494, - "end": 3503, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 3506, - "end": 3508, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3510, - "end": 3537, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3514, - "end": 3536, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3514, - "end": 3519, - "ctxt": 0 - }, - "value": "r10c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3522, - "end": 3536, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 3522, - "end": 3531, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 3534, - "end": 3536, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3539, - "end": 3568, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3543, - "end": 3567, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3543, - "end": 3548, - "ctxt": 0 - }, - "value": "r10d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3551, - "end": 3567, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 3551, - "end": 3555, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 3558, - "end": 3567, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3569, - "end": 3596, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3573, - "end": 3595, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3573, - "end": 3578, - "ctxt": 0 - }, - "value": "r10d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3581, - "end": 3595, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "StringLiteral", - "span": { - "start": 3581, - "end": 3583, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 3586, - "end": 3595, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3597, - "end": 3624, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3601, - "end": 3623, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3601, - "end": 3606, - "ctxt": 0 - }, - "value": "r10d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3609, - "end": 3623, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "ObjectExpression", - "span": { - "start": 3609, - "end": 3611, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 3614, - "end": 3623, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts deleted file mode 100644 index eeca5985f46..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts +++ /dev/null @@ -1,176 +0,0 @@ -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. - -var a: boolean; -var b: string; -var c: Object; - -// operator * -var r1a1 = undefined * a; -var r1a2 = undefined * b; -var r1a3 = undefined * c; - -var r1b1 = a * undefined; -var r1b2 = b * undefined; -var r1b3 = c * undefined; - -var r1c1 = undefined * true; -var r1c2 = undefined * ''; -var r1c3 = undefined * {}; - -var r1d1 = true * undefined; -var r1d2 = '' * undefined; -var r1d3 = {} * undefined; - -// operator / -var r2a1 = undefined / a; -var r2a2 = undefined / b; -var r2a3 = undefined / c; - -var r2b1 = a / undefined; -var r2b2 = b / undefined; -var r2b3 = c / undefined; - -var r2c1 = undefined / true; -var r2c2 = undefined / ''; -var r2c3 = undefined / {}; - -var r2d1 = true / undefined; -var r2d2 = '' / undefined; -var r2d3 = {} / undefined; - -// operator % -var r3a1 = undefined % a; -var r3a2 = undefined % b; -var r3a3 = undefined % c; - -var r3b1 = a % undefined; -var r3b2 = b % undefined; -var r3b3 = c % undefined; - -var r3c1 = undefined % true; -var r3c2 = undefined % ''; -var r3c3 = undefined % {}; - -var r3d1 = true % undefined; -var r3d2 = '' % undefined; -var r3d3 = {} % undefined; - -// operator - -var r4a1 = undefined - a; -var r4a2 = undefined - b; -var r4a3 = undefined - c; - -var r4b1 = a - undefined; -var r4b2 = b - undefined; -var r4b3 = c - undefined; - -var r4c1 = undefined - true; -var r4c2 = undefined - ''; -var r4c3 = undefined - {}; - -var r4d1 = true - undefined; -var r4d2 = '' - undefined; -var r4d3 = {} - undefined; - -// operator << -var r5a1 = undefined << a; -var r5a2 = undefined << b; -var r5a3 = undefined << c; - -var r5b1 = a << undefined; -var r5b2 = b << undefined; -var r5b3 = c << undefined; - -var r5c1 = undefined << true; -var r5c2 = undefined << ''; -var r5c3 = undefined << {}; - -var r5d1 = true << undefined; -var r5d2 = '' << undefined; -var r5d3 = {} << undefined; - -// operator >> -var r6a1 = undefined >> a; -var r6a2 = undefined >> b; -var r6a3 = undefined >> c; - -var r6b1 = a >> undefined; -var r6b2 = b >> undefined; -var r6b3 = c >> undefined; - -var r6c1 = undefined >> true; -var r6c2 = undefined >> ''; -var r6c3 = undefined >> {}; - -var r6d1 = true >> undefined; -var r6d2 = '' >> undefined; -var r6d3 = {} >> undefined; - -// operator >>> -var r7a1 = undefined >>> a; -var r7a2 = undefined >>> b; -var r7a3 = undefined >>> c; - -var r7b1 = a >>> undefined; -var r7b2 = b >>> undefined; -var r7b3 = c >>> undefined; - -var r7c1 = undefined >>> true; -var r7c2 = undefined >>> ''; -var r7c3 = undefined >>> {}; - -var r7d1 = true >>> undefined; -var r7d2 = '' >>> undefined; -var r7d3 = {} >>> undefined; - -// operator & -var r8a1 = undefined & a; -var r8a2 = undefined & b; -var r8a3 = undefined & c; - -var r8b1 = a & undefined; -var r8b2 = b & undefined; -var r8b3 = c & undefined; - -var r8c1 = undefined & true; -var r8c2 = undefined & ''; -var r8c3 = undefined & {}; - -var r8d1 = true & undefined; -var r8d2 = '' & undefined; -var r8d3 = {} & undefined; - -// operator ^ -var r9a1 = undefined ^ a; -var r9a2 = undefined ^ b; -var r9a3 = undefined ^ c; - -var r9b1 = a ^ undefined; -var r9b2 = b ^ undefined; -var r9b3 = c ^ undefined; - -var r9c1 = undefined ^ true; -var r9c2 = undefined ^ ''; -var r9c3 = undefined ^ {}; - -var r9d1 = true ^ undefined; -var r9d2 = '' ^ undefined; -var r9d3 = {} ^ undefined; - -// operator | -var r10a1 = undefined | a; -var r10a2 = undefined | b; -var r10a3 = undefined | c; - -var r10b1 = a | undefined; -var r10b2 = b | undefined; -var r10b3 = c | undefined; - -var r10c1 = undefined | true; -var r10c2 = undefined | ''; -var r10c3 = undefined | {}; - -var r10d1 = true | undefined; -var r10d2 = '' | undefined; -var r10d3 = {} | undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.json b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.json deleted file mode 100644 index 5b6862e57d1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.json +++ /dev/null @@ -1,5409 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 115, - "end": 2392, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 115, - "end": 138, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 140, - "end": 151, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 144, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 152, - "end": 166, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 156, - "end": 165, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 159, - "end": 165, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 182, - "end": 206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 186, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 192, - "end": 205, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 201, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 204, - "end": 205, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 207, - "end": 231, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 211, - "end": 230, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 217, - "end": 230, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 217, - "end": 226, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 229, - "end": 230, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 232, - "end": 256, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 236, - "end": 255, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 242, - "end": 255, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 242, - "end": 251, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 254, - "end": 255, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 257, - "end": 283, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 261, - "end": 282, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 267, - "end": 282, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 267, - "end": 276, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 279, - "end": 280, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 284, - "end": 308, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 288, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 288, - "end": 291, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 294, - "end": 307, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 298, - "end": 307, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 333, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 313, - "end": 332, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 313, - "end": 316, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 319, - "end": 332, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "Identifier", - "span": { - "start": 319, - "end": 320, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 323, - "end": 332, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 334, - "end": 358, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 338, - "end": 357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 338, - "end": 341, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 344, - "end": 357, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "NumericLiteral", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 348, - "end": 357, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 359, - "end": 385, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 363, - "end": 384, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "value": "ra8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 369, - "end": 384, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "MemberExpression", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 369, - "end": 370, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 371, - "end": 372, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 375, - "end": 384, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 401, - "end": 425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 405, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 405, - "end": 408, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 411, - "end": 424, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 411, - "end": 420, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 423, - "end": 424, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 426, - "end": 450, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 449, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 433, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 436, - "end": 449, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 436, - "end": 445, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 451, - "end": 475, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 455, - "end": 474, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 455, - "end": 458, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 461, - "end": 474, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 461, - "end": 470, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 473, - "end": 474, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 476, - "end": 502, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 480, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 480, - "end": 483, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 486, - "end": 501, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 486, - "end": 495, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 498, - "end": 499, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 503, - "end": 527, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 507, - "end": 526, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 507, - "end": 510, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 513, - "end": 526, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 513, - "end": 514, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 517, - "end": 526, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 528, - "end": 552, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 532, - "end": 551, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 532, - "end": 535, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 538, - "end": 551, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "Identifier", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 542, - "end": 551, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 553, - "end": 577, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 557, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 557, - "end": 560, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 563, - "end": 576, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NumericLiteral", - "span": { - "start": 563, - "end": 564, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 567, - "end": 576, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 578, - "end": 604, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 582, - "end": 603, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 582, - "end": 585, - "ctxt": 0 - }, - "value": "rb8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 588, - "end": 603, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "MemberExpression", - "span": { - "start": 588, - "end": 591, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 588, - "end": 589, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 590, - "end": 591, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 594, - "end": 603, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 620, - "end": 644, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 624, - "end": 643, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 624, - "end": 627, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 630, - "end": 643, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 645, - "end": 669, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 649, - "end": 668, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 649, - "end": 652, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 655, - "end": 668, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 655, - "end": 664, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 670, - "end": 694, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 674, - "end": 693, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 674, - "end": 677, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 680, - "end": 693, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 680, - "end": 689, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 692, - "end": 693, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 695, - "end": 721, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 699, - "end": 720, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 699, - "end": 702, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 705, - "end": 720, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 705, - "end": 714, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 717, - "end": 720, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 717, - "end": 718, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 719, - "end": 720, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 722, - "end": 746, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 726, - "end": 745, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 726, - "end": 729, - "ctxt": 0 - }, - "value": "rc5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 732, - "end": 745, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 732, - "end": 733, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 736, - "end": 745, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 747, - "end": 771, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 751, - "end": 770, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 751, - "end": 754, - "ctxt": 0 - }, - "value": "rc6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 757, - "end": 770, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "Identifier", - "span": { - "start": 757, - "end": 758, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 761, - "end": 770, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 772, - "end": 796, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 776, - "end": 795, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 776, - "end": 779, - "ctxt": 0 - }, - "value": "rc7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 782, - "end": 795, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "NumericLiteral", - "span": { - "start": 782, - "end": 783, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 786, - "end": 795, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 797, - "end": 823, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 801, - "end": 822, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 801, - "end": 804, - "ctxt": 0 - }, - "value": "rc8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 807, - "end": 822, - "ctxt": 0 - }, - "operator": "%", - "left": { - "type": "MemberExpression", - "span": { - "start": 807, - "end": 810, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 807, - "end": 808, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 809, - "end": 810, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 813, - "end": 822, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 839, - "end": 863, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 843, - "end": 862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 843, - "end": 846, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 849, - "end": 862, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 849, - "end": 858, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 861, - "end": 862, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 864, - "end": 888, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 868, - "end": 887, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 868, - "end": 871, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 874, - "end": 887, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 874, - "end": 883, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 886, - "end": 887, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 889, - "end": 913, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 893, - "end": 912, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 893, - "end": 896, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 899, - "end": 912, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 899, - "end": 908, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 911, - "end": 912, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 914, - "end": 940, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 918, - "end": 939, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 918, - "end": 921, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 924, - "end": 939, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 924, - "end": 933, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 936, - "end": 939, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 936, - "end": 937, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 938, - "end": 939, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 941, - "end": 965, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 945, - "end": 964, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 945, - "end": 948, - "ctxt": 0 - }, - "value": "rd5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 951, - "end": 964, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 951, - "end": 952, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 955, - "end": 964, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 966, - "end": 990, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 970, - "end": 989, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 970, - "end": 973, - "ctxt": 0 - }, - "value": "rd6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 976, - "end": 989, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 976, - "end": 977, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 980, - "end": 989, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 991, - "end": 1015, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 995, - "end": 1014, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 995, - "end": 998, - "ctxt": 0 - }, - "value": "rd7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1001, - "end": 1014, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1001, - "end": 1002, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1014, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1016, - "end": 1042, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1020, - "end": 1041, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1020, - "end": 1023, - "ctxt": 0 - }, - "value": "rd8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1026, - "end": 1041, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "MemberExpression", - "span": { - "start": 1026, - "end": 1029, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1026, - "end": 1027, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1028, - "end": 1029, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1032, - "end": 1041, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1059, - "end": 1084, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1063, - "end": 1083, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1063, - "end": 1066, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1069, - "end": 1083, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1069, - "end": 1078, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1082, - "end": 1083, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1085, - "end": 1110, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1089, - "end": 1109, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1089, - "end": 1092, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1095, - "end": 1109, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1095, - "end": 1104, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1108, - "end": 1109, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1111, - "end": 1136, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1115, - "end": 1135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1115, - "end": 1118, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1121, - "end": 1135, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1121, - "end": 1130, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1134, - "end": 1135, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1137, - "end": 1164, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1141, - "end": 1163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1141, - "end": 1144, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1147, - "end": 1163, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1147, - "end": 1156, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1160, - "end": 1163, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1160, - "end": 1161, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1162, - "end": 1163, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1165, - "end": 1190, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1169, - "end": 1189, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1169, - "end": 1172, - "ctxt": 0 - }, - "value": "re5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1175, - "end": 1189, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1175, - "end": 1176, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1180, - "end": 1189, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1191, - "end": 1216, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1195, - "end": 1215, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1195, - "end": 1198, - "ctxt": 0 - }, - "value": "re6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1201, - "end": 1215, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "Identifier", - "span": { - "start": 1201, - "end": 1202, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1206, - "end": 1215, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1217, - "end": 1242, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1221, - "end": 1241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1221, - "end": 1224, - "ctxt": 0 - }, - "value": "re7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1227, - "end": 1241, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1227, - "end": 1228, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1232, - "end": 1241, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1243, - "end": 1270, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1247, - "end": 1269, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1247, - "end": 1250, - "ctxt": 0 - }, - "value": "re8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1253, - "end": 1269, - "ctxt": 0 - }, - "operator": "<<", - "left": { - "type": "MemberExpression", - "span": { - "start": 1253, - "end": 1256, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1253, - "end": 1254, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1255, - "end": 1256, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1260, - "end": 1269, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1287, - "end": 1312, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1291, - "end": 1311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1291, - "end": 1294, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1297, - "end": 1311, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1297, - "end": 1306, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1310, - "end": 1311, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1313, - "end": 1338, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1317, - "end": 1337, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1317, - "end": 1320, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1323, - "end": 1337, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1323, - "end": 1332, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1336, - "end": 1337, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1339, - "end": 1364, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1343, - "end": 1363, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1343, - "end": 1346, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1349, - "end": 1363, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1349, - "end": 1358, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1362, - "end": 1363, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1365, - "end": 1392, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1369, - "end": 1391, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1369, - "end": 1372, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1375, - "end": 1391, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1375, - "end": 1384, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1388, - "end": 1391, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1388, - "end": 1389, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1390, - "end": 1391, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1393, - "end": 1418, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1397, - "end": 1417, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1397, - "end": 1400, - "ctxt": 0 - }, - "value": "rf5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1403, - "end": 1417, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1403, - "end": 1404, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1408, - "end": 1417, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1419, - "end": 1444, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1423, - "end": 1443, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1423, - "end": 1426, - "ctxt": 0 - }, - "value": "rf6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1429, - "end": 1443, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "Identifier", - "span": { - "start": 1429, - "end": 1430, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1443, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1445, - "end": 1470, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1449, - "end": 1469, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1449, - "end": 1452, - "ctxt": 0 - }, - "value": "rf7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1455, - "end": 1469, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1455, - "end": 1456, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1460, - "end": 1469, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1471, - "end": 1498, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1475, - "end": 1497, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1475, - "end": 1478, - "ctxt": 0 - }, - "value": "rf8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1481, - "end": 1497, - "ctxt": 0 - }, - "operator": ">>", - "left": { - "type": "MemberExpression", - "span": { - "start": 1481, - "end": 1484, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1481, - "end": 1482, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1483, - "end": 1484, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1488, - "end": 1497, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1516, - "end": 1542, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1520, - "end": 1541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1520, - "end": 1523, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1526, - "end": 1541, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1526, - "end": 1535, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1540, - "end": 1541, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1543, - "end": 1569, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1547, - "end": 1568, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1547, - "end": 1550, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1553, - "end": 1568, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1553, - "end": 1562, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1567, - "end": 1568, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1570, - "end": 1596, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1574, - "end": 1595, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1574, - "end": 1577, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1580, - "end": 1595, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1580, - "end": 1589, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1594, - "end": 1595, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1597, - "end": 1625, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1601, - "end": 1624, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1601, - "end": 1604, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1607, - "end": 1624, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1607, - "end": 1616, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1621, - "end": 1624, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1621, - "end": 1622, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1624, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1626, - "end": 1652, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1630, - "end": 1651, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1630, - "end": 1633, - "ctxt": 0 - }, - "value": "rg5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1636, - "end": 1651, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1636, - "end": 1637, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1642, - "end": 1651, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1653, - "end": 1679, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1657, - "end": 1678, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1657, - "end": 1660, - "ctxt": 0 - }, - "value": "rg6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1663, - "end": 1678, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "Identifier", - "span": { - "start": 1663, - "end": 1664, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1669, - "end": 1678, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1680, - "end": 1706, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1684, - "end": 1705, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1684, - "end": 1687, - "ctxt": 0 - }, - "value": "rg7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1690, - "end": 1705, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1690, - "end": 1691, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1696, - "end": 1705, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1707, - "end": 1735, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1711, - "end": 1734, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1711, - "end": 1714, - "ctxt": 0 - }, - "value": "rg8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1717, - "end": 1734, - "ctxt": 0 - }, - "operator": ">>>", - "left": { - "type": "MemberExpression", - "span": { - "start": 1717, - "end": 1720, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1717, - "end": 1718, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1719, - "end": 1720, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1725, - "end": 1734, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1751, - "end": 1775, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1755, - "end": 1774, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1755, - "end": 1758, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1761, - "end": 1774, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1761, - "end": 1770, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1773, - "end": 1774, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1776, - "end": 1800, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1780, - "end": 1799, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1780, - "end": 1783, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1786, - "end": 1799, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1786, - "end": 1795, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1798, - "end": 1799, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1801, - "end": 1825, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1805, - "end": 1824, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1805, - "end": 1808, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1811, - "end": 1824, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1811, - "end": 1820, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1823, - "end": 1824, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1826, - "end": 1852, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1830, - "end": 1851, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1830, - "end": 1833, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1836, - "end": 1851, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1836, - "end": 1845, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1848, - "end": 1851, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1848, - "end": 1849, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1850, - "end": 1851, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1853, - "end": 1877, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1857, - "end": 1876, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1857, - "end": 1860, - "ctxt": 0 - }, - "value": "rh5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1863, - "end": 1876, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1863, - "end": 1864, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1867, - "end": 1876, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1878, - "end": 1902, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1882, - "end": 1901, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1882, - "end": 1885, - "ctxt": 0 - }, - "value": "rh6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1888, - "end": 1901, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "Identifier", - "span": { - "start": 1888, - "end": 1889, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1892, - "end": 1901, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1903, - "end": 1927, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1907, - "end": 1926, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1907, - "end": 1910, - "ctxt": 0 - }, - "value": "rh7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1913, - "end": 1926, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1913, - "end": 1914, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 1917, - "end": 1926, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1928, - "end": 1954, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1932, - "end": 1953, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1932, - "end": 1935, - "ctxt": 0 - }, - "value": "rh8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1938, - "end": 1953, - "ctxt": 0 - }, - "operator": "&", - "left": { - "type": "MemberExpression", - "span": { - "start": 1938, - "end": 1941, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1938, - "end": 1939, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1940, - "end": 1941, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1944, - "end": 1953, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1970, - "end": 1994, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1974, - "end": 1993, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1974, - "end": 1977, - "ctxt": 0 - }, - "value": "ri1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1980, - "end": 1993, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 1980, - "end": 1989, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1992, - "end": 1993, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1995, - "end": 2019, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1999, - "end": 2018, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1999, - "end": 2002, - "ctxt": 0 - }, - "value": "ri2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2005, - "end": 2018, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2005, - "end": 2014, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2017, - "end": 2018, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2020, - "end": 2044, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2024, - "end": 2043, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2024, - "end": 2027, - "ctxt": 0 - }, - "value": "ri3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2030, - "end": 2043, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2030, - "end": 2039, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 2042, - "end": 2043, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2045, - "end": 2071, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2049, - "end": 2070, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2049, - "end": 2052, - "ctxt": 0 - }, - "value": "ri4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2055, - "end": 2070, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2055, - "end": 2064, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 2067, - "end": 2070, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2067, - "end": 2068, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2069, - "end": 2070, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2072, - "end": 2096, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2076, - "end": 2095, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2076, - "end": 2079, - "ctxt": 0 - }, - "value": "ri5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2082, - "end": 2095, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2082, - "end": 2083, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2086, - "end": 2095, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2097, - "end": 2121, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2101, - "end": 2120, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2101, - "end": 2104, - "ctxt": 0 - }, - "value": "ri6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2107, - "end": 2120, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "Identifier", - "span": { - "start": 2107, - "end": 2108, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2111, - "end": 2120, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2122, - "end": 2146, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2126, - "end": 2145, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2126, - "end": 2129, - "ctxt": 0 - }, - "value": "ri7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2132, - "end": 2145, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "NumericLiteral", - "span": { - "start": 2132, - "end": 2133, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 2136, - "end": 2145, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2147, - "end": 2173, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2151, - "end": 2172, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2151, - "end": 2154, - "ctxt": 0 - }, - "value": "ri8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2157, - "end": 2172, - "ctxt": 0 - }, - "operator": "^", - "left": { - "type": "MemberExpression", - "span": { - "start": 2157, - "end": 2160, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2157, - "end": 2158, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2159, - "end": 2160, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2163, - "end": 2172, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2189, - "end": 2213, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2193, - "end": 2212, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2193, - "end": 2196, - "ctxt": 0 - }, - "value": "rj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2199, - "end": 2212, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2199, - "end": 2208, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2211, - "end": 2212, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2214, - "end": 2238, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2218, - "end": 2237, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2218, - "end": 2221, - "ctxt": 0 - }, - "value": "rj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2224, - "end": 2237, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2224, - "end": 2233, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2236, - "end": 2237, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2239, - "end": 2263, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2243, - "end": 2262, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2243, - "end": 2246, - "ctxt": 0 - }, - "value": "rj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2249, - "end": 2262, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2249, - "end": 2258, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 2261, - "end": 2262, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2264, - "end": 2290, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2268, - "end": 2289, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2268, - "end": 2271, - "ctxt": 0 - }, - "value": "rj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2274, - "end": 2289, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2274, - "end": 2283, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 2286, - "end": 2289, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2286, - "end": 2287, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2288, - "end": 2289, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2291, - "end": 2315, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2295, - "end": 2314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2295, - "end": 2298, - "ctxt": 0 - }, - "value": "rj5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2301, - "end": 2314, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2301, - "end": 2302, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2305, - "end": 2314, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2316, - "end": 2340, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2320, - "end": 2339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2320, - "end": 2323, - "ctxt": 0 - }, - "value": "rj6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2326, - "end": 2339, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "Identifier", - "span": { - "start": 2326, - "end": 2327, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2330, - "end": 2339, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2341, - "end": 2365, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2345, - "end": 2364, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2345, - "end": 2348, - "ctxt": 0 - }, - "value": "rj7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2351, - "end": 2364, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "NumericLiteral", - "span": { - "start": 2351, - "end": 2352, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 2355, - "end": 2364, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2366, - "end": 2392, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2370, - "end": 2391, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2370, - "end": 2373, - "ctxt": 0 - }, - "value": "rj8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2376, - "end": 2391, - "ctxt": 0 - }, - "operator": "|", - "left": { - "type": "MemberExpression", - "span": { - "start": 2376, - "end": 2379, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2376, - "end": 2377, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2378, - "end": 2379, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2382, - "end": 2391, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.ts b/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.ts deleted file mode 100644 index 69180798aee..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/arithmeticOperatorWithUndefinedValueAndValidOperands.ts +++ /dev/null @@ -1,110 +0,0 @@ -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. - -enum E { - a, - b -} - -var a: any; -var b: number; - -// operator * -var ra1 = undefined * a; -var ra2 = undefined * b; -var ra3 = undefined * 1; -var ra4 = undefined * E.a; -var ra5 = a * undefined; -var ra6 = b * undefined; -var ra7 = 0 * undefined; -var ra8 = E.b * undefined; - -// operator / -var rb1 = undefined / a; -var rb2 = undefined / b; -var rb3 = undefined / 1; -var rb4 = undefined / E.a; -var rb5 = a / undefined; -var rb6 = b / undefined; -var rb7 = 0 / undefined; -var rb8 = E.b / undefined; - -// operator % -var rc1 = undefined % a; -var rc2 = undefined % b; -var rc3 = undefined % 1; -var rc4 = undefined % E.a; -var rc5 = a % undefined; -var rc6 = b % undefined; -var rc7 = 0 % undefined; -var rc8 = E.b % undefined; - -// operator - -var rd1 = undefined - a; -var rd2 = undefined - b; -var rd3 = undefined - 1; -var rd4 = undefined - E.a; -var rd5 = a - undefined; -var rd6 = b - undefined; -var rd7 = 0 - undefined; -var rd8 = E.b - undefined; - -// operator << -var re1 = undefined << a; -var re2 = undefined << b; -var re3 = undefined << 1; -var re4 = undefined << E.a; -var re5 = a << undefined; -var re6 = b << undefined; -var re7 = 0 << undefined; -var re8 = E.b << undefined; - -// operator >> -var rf1 = undefined >> a; -var rf2 = undefined >> b; -var rf3 = undefined >> 1; -var rf4 = undefined >> E.a; -var rf5 = a >> undefined; -var rf6 = b >> undefined; -var rf7 = 0 >> undefined; -var rf8 = E.b >> undefined; - -// operator >>> -var rg1 = undefined >>> a; -var rg2 = undefined >>> b; -var rg3 = undefined >>> 1; -var rg4 = undefined >>> E.a; -var rg5 = a >>> undefined; -var rg6 = b >>> undefined; -var rg7 = 0 >>> undefined; -var rg8 = E.b >>> undefined; - -// operator & -var rh1 = undefined & a; -var rh2 = undefined & b; -var rh3 = undefined & 1; -var rh4 = undefined & E.a; -var rh5 = a & undefined; -var rh6 = b & undefined; -var rh7 = 0 & undefined; -var rh8 = E.b & undefined; - -// operator ^ -var ri1 = undefined ^ a; -var ri2 = undefined ^ b; -var ri3 = undefined ^ 1; -var ri4 = undefined ^ E.a; -var ri5 = a ^ undefined; -var ri6 = b ^ undefined; -var ri7 = 0 ^ undefined; -var ri8 = E.b ^ undefined; - -// operator | -var rj1 = undefined | a; -var rj2 = undefined | b; -var rj3 = undefined | 1; -var rj4 = undefined | E.a; -var rj5 = a | undefined; -var rj6 = b | undefined; -var rj7 = 0 | undefined; -var rj8 = E.b | undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/arrayLiteralExpressionContextualTyping.ts b/crates/swc_ecma_parser/tests/tsc/arrayLiteralExpressionContextualTyping.ts index c2f1576e5b5..eaf39ca1254 100644 --- a/crates/swc_ecma_parser/tests/tsc/arrayLiteralExpressionContextualTyping.ts +++ b/crates/swc_ecma_parser/tests/tsc/arrayLiteralExpressionContextualTyping.ts @@ -1,4 +1,4 @@ -// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by +// In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by // the type of the property with the numeric name N in the contextual type, if any, or otherwise // the numeric index type of the contextual type, if any. var array = [1, 2, 3]; diff --git a/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES5.ts b/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES5.ts index 38fd2189787..65f131a5a9e 100644 --- a/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES5.ts @@ -1,4 +1,4 @@ -// ElementList: ( Modified ) +// ElementList: ( Modified ) // Elisionopt AssignmentExpression // Elisionopt SpreadElement // ElementList, Elisionopt AssignmentExpression diff --git a/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES6.ts b/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES6.ts index cfe05ad32f9..bbb5e18e286 100644 --- a/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/arrayLiterals2ES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 // ElementList: ( Modified ) // Elisionopt AssignmentExpression // Elisionopt SpreadElement diff --git a/crates/swc_ecma_parser/tests/tsc/arrayLiterals3.ts b/crates/swc_ecma_parser/tests/tsc/arrayLiterals3.ts index 77ab39431c2..04f29c39503 100644 --- a/crates/swc_ecma_parser/tests/tsc/arrayLiterals3.ts +++ b/crates/swc_ecma_parser/tests/tsc/arrayLiterals3.ts @@ -1,4 +1,4 @@ -// Each element expression in a non-empty array literal is processed as follows: +// Each element expression in a non-empty array literal is processed as follows: // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) // by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, // the element expression is contextually typed by the type of that property. diff --git a/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.json b/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.json new file mode 100644 index 00000000000..b33e2717a66 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.json @@ -0,0 +1,343 @@ +{ + "type": "Script", + "span": { + "start": 35, + "end": 209, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 35, + "end": 45, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 39, + "end": 44, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 39, + "end": 40, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 43, + "end": 44, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 46, + "end": 65, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 50, + "end": 64, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 50, + "end": 52, + "ctxt": 0 + }, + "value": "xs", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 52, + "end": 64, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 54, + "end": 64, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeQuery", + "span": { + "start": 54, + "end": 62, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 61, + "end": 62, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "typeArguments": null + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 123, + "end": 145, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 127, + "end": 144, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 127, + "end": 130, + "ctxt": 0 + }, + "value": "xs2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 130, + "end": 144, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 132, + "end": 144, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 139, + "end": 144, + "ctxt": 0 + }, + "value": "Array", + "optional": false + }, + "typeArguments": null + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 146, + "end": 176, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 150, + "end": 175, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 150, + "end": 153, + "ctxt": 0 + }, + "value": "xs3", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 153, + "end": 175, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 155, + "end": 175, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 162, + "end": 167, + "ctxt": 0 + }, + "value": "Array", + "optional": false + }, + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 167, + "end": 175, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 168, + "end": 174, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 177, + "end": 209, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 181, + "end": 208, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 181, + "end": 184, + "ctxt": 0 + }, + "value": "xs4", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 184, + "end": 208, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 186, + "end": 208, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 193, + "end": 198, + "ctxt": 0 + }, + "value": "Array", + "optional": false + }, + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 198, + "end": 208, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeQuery", + "span": { + "start": 199, + "end": 207, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 206, + "end": 207, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "typeArguments": null + } + ] + } + } + } + }, + "init": null, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.ts b/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.ts new file mode 100644 index 00000000000..bfef2891cda --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/arrayTypeOfTypeOf.ts @@ -0,0 +1,7 @@ +// array type cannot use typeof. + +var x = 1; +var xs: typeof x[]; // Not an error. This is equivalent to Array +var xs2: typeof Array; +var xs3: typeof Array; +var xs4: typeof Array; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/assignmentCompatBetweenTupleAndArray.ts b/crates/swc_ecma_parser/tests/tsc/assignmentCompatBetweenTupleAndArray.ts index 31140d12c4f..3811809742c 100644 --- a/crates/swc_ecma_parser/tests/tsc/assignmentCompatBetweenTupleAndArray.ts +++ b/crates/swc_ecma_parser/tests/tsc/assignmentCompatBetweenTupleAndArray.ts @@ -1,4 +1,4 @@ -var numStrTuple: [number, string]; +var numStrTuple: [number, string]; var numNumTuple: [number, number]; var numEmptyObjTuple: [number, {}]; var emptyObjTuple: [{}]; diff --git a/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.json b/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.json new file mode 100644 index 00000000000..a691477bc72 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.json @@ -0,0 +1,156 @@ +{ + "type": "Script", + "span": { + "start": 1, + "end": 47, + "ctxt": 0 + }, + "body": [ + { + "type": "TsEnumDeclaration", + "span": { + "start": 1, + "end": 17, + "ctxt": 0 + }, + "declare": false, + "isConst": false, + "id": { + "type": "Identifier", + "span": { + "start": 6, + "end": 7, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 14, + "end": 15, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 14, + "end": 15, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "init": null + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 19, + "end": 47, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 23, + "end": 47, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 23, + "end": 26, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 26, + "end": 42, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 28, + "end": 42, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 28, + "end": 34, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 34, + "end": 42, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 35, + "end": 36, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 35, + "end": 36, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 38, + "end": 41, + "ctxt": 0 + }, + "kind": "any" + } + ] + } + } + } + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 45, + "end": 47, + "ctxt": 0 + }, + "properties": [] + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.ts b/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.ts new file mode 100644 index 00000000000..373cf7e6cd4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/assignmentCompatWithEnumIndexer.ts @@ -0,0 +1,5 @@ +enum E { + A +} + +let foo: Record = {} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.json deleted file mode 100644 index 536d820c78a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 45, - "end": 90, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 45, - "end": 90, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 49, - "end": 90, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 55, - "end": 90, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 62, - "end": 67, - "ctxt": 0 - }, - "value": "await", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 87, - "end": 90, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 68, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 70, - "end": 83, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 70, - "end": 77, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 77, - "end": 83, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 78, - "end": 82, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.ts deleted file mode 100644 index aabe5a99372..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es2017.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es2017 -// @noEmitHelpers: true - -var foo = async (await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.json deleted file mode 100644 index 5064978193a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 70, - "end": 115, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 115, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 80, - "end": 115, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 87, - "end": 92, - "ctxt": 0 - }, - "value": "await", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 93, - "end": 108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 95, - "end": 108, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 95, - "end": 102, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 102, - "end": 108, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 103, - "end": 107, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.ts deleted file mode 100644 index 728e2e8ee72..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es5.ts +++ /dev/null @@ -1,6 +0,0 @@ -// @target: ES5 -// @lib: es5,es2015.promise -// @noEmitHelpers: true - -var foo = async (await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.json deleted file mode 100644 index ff2d6786411..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 42, - "end": 87, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 42, - "end": 87, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 46, - "end": 87, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 52, - "end": 87, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 59, - "end": 64, - "ctxt": 0 - }, - "value": "await", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 84, - "end": 87, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 65, - "end": 80, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 67, - "end": 80, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 67, - "end": 74, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 74, - "end": 80, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 75, - "end": 79, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.ts deleted file mode 100644 index 174a619bdf9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction5_es6.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: ES6 -// @noEmitHelpers: true - -var foo = async (await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.json deleted file mode 100644 index f2151b15e97..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 45, - "end": 94, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 45, - "end": 94, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 49, - "end": 94, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 55, - "end": 94, - "ctxt": 0 - }, - "params": [ - { - "type": "AssignmentPattern", - "span": { - "start": 62, - "end": 71, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 66, - "end": 71, - "ctxt": 0 - }, - "value": "await", - "optional": false - }, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 91, - "end": 94, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 72, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 74, - "end": 87, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 74, - "end": 81, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 81, - "end": 87, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 82, - "end": 86, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.ts deleted file mode 100644 index d82ce864421..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es2017.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es2017 -// @noEmitHelpers: true - -var foo = async (a = await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.json deleted file mode 100644 index 38e1cd1ab83..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 70, - "end": 119, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 119, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 119, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 80, - "end": 119, - "ctxt": 0 - }, - "params": [ - { - "type": "AssignmentPattern", - "span": { - "start": 87, - "end": 96, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 91, - "end": 96, - "ctxt": 0 - }, - "value": "await", - "optional": false - }, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 116, - "end": 119, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 97, - "end": 112, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 99, - "end": 112, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 99, - "end": 106, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 106, - "end": 112, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 107, - "end": 111, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.ts deleted file mode 100644 index 41e26b2e695..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es5.ts +++ /dev/null @@ -1,6 +0,0 @@ -// @target: ES5 -// @lib: es5,es2015.promise -// @noEmitHelpers: true - -var foo = async (a = await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.json b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.json deleted file mode 100644 index a9cd94b121f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 42, - "end": 91, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 42, - "end": 91, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 46, - "end": 91, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 52, - "end": 91, - "ctxt": 0 - }, - "params": [ - { - "type": "AssignmentPattern", - "span": { - "start": 59, - "end": 68, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 63, - "end": 68, - "ctxt": 0 - }, - "value": "await", - "optional": false - }, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 88, - "end": 91, - "ctxt": 0 - }, - "stmts": [] - }, - "async": true, - "generator": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 69, - "end": 84, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 71, - "end": 84, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 78, - "end": 84, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 79, - "end": 83, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.ts b/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.ts deleted file mode 100644 index dace96c4933..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction6_es6.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: ES6 -// @noEmitHelpers: true - -var foo = async (a = await): Promise => { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.json b/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.json deleted file mode 100644 index ec0e19a87a8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.json +++ /dev/null @@ -1,1337 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 69, - "end": 1245, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 83, - "end": 91, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "declare": true, - "span": { - "start": 69, - "end": 109, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 94, - "end": 107, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 94, - "end": 98, - "ctxt": 0 - }, - "value": "then", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 94, - "end": 107, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 100, - "end": 106, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 102, - "end": 106, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 110, - "end": 129, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 123, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 123, - "end": 128, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 125, - "end": 128, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 130, - "end": 165, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 142, - "end": 164, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 164, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 147, - "end": 164, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 149, - "end": 162, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - }, - "value": "then", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 166, - "end": 197, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 178, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 178, - "end": 186, - "ctxt": 0 - }, - "value": "thenable", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 196, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 188, - "end": 196, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 188, - "end": 196, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "fn1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 198, - "end": 222, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 219, - "end": 222, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "value": "fn2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 247, - "end": 276, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 273, - "end": 276, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 267, - "end": 272, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 269, - "end": 272, - "ctxt": 0 - }, - "members": [] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 301, - "end": 304, - "ctxt": 0 - }, - "value": "fn3", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 286, - "end": 315, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 306, - "end": 311, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "value": "fn4", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 325, - "end": 357, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 354, - "end": 357, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 345, - "end": 353, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 347, - "end": 353, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 382, - "end": 385, - "ctxt": 0 - }, - "value": "fn5", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 367, - "end": 410, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 407, - "end": 410, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 387, - "end": 406, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 389, - "end": 406, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 389, - "end": 400, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 400, - "end": 406, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 401, - "end": 405, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 435, - "end": 438, - "ctxt": 0 - }, - "value": "fn6", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 420, - "end": 454, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 440, - "end": 450, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 442, - "end": 450, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 442, - "end": 450, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 479, - "end": 482, - "ctxt": 0 - }, - "value": "fn7", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 464, - "end": 496, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 485, - "end": 496, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 487, - "end": 494, - "ctxt": 0 - }, - "argument": null - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 536, - "end": 539, - "ctxt": 0 - }, - "value": "fn8", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 521, - "end": 555, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 542, - "end": 555, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 544, - "end": 553, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 551, - "end": 552, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 597, - "end": 600, - "ctxt": 0 - }, - "value": "fn9", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 582, - "end": 619, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 603, - "end": 619, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 605, - "end": 617, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 612, - "end": 616, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 658, - "end": 662, - "ctxt": 0 - }, - "value": "fn10", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 643, - "end": 686, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 665, - "end": 686, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 667, - "end": 684, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 674, - "end": 683, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 725, - "end": 729, - "ctxt": 0 - }, - "value": "fn11", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 710, - "end": 745, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 732, - "end": 745, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 734, - "end": 743, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 741, - "end": 742, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 784, - "end": 788, - "ctxt": 0 - }, - "value": "fn12", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 769, - "end": 806, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 791, - "end": 806, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 793, - "end": 804, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 800, - "end": 803, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 859, - "end": 863, - "ctxt": 0 - }, - "value": "fn13", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 844, - "end": 886, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 866, - "end": 886, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 868, - "end": 884, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 875, - "end": 883, - "ctxt": 0 - }, - "value": "thenable", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 911, - "end": 915, - "ctxt": 0 - }, - "value": "fn14", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 896, - "end": 930, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 918, - "end": 930, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 920, - "end": 928, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 920, - "end": 927, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 926, - "end": 927, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 970, - "end": 974, - "ctxt": 0 - }, - "value": "fn15", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 955, - "end": 992, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 977, - "end": 992, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 979, - "end": 990, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 979, - "end": 989, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 985, - "end": 989, - "ctxt": 0 - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1032, - "end": 1036, - "ctxt": 0 - }, - "value": "fn16", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1017, - "end": 1059, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1039, - "end": 1059, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1041, - "end": 1057, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1041, - "end": 1056, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1056, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1099, - "end": 1103, - "ctxt": 0 - }, - "value": "fn17", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1084, - "end": 1118, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1106, - "end": 1118, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1108, - "end": 1116, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1108, - "end": 1115, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1114, - "end": 1115, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1158, - "end": 1162, - "ctxt": 0 - }, - "value": "fn18", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1143, - "end": 1179, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1165, - "end": 1179, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1167, - "end": 1177, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1167, - "end": 1176, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1173, - "end": 1176, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1219, - "end": 1223, - "ctxt": 0 - }, - "value": "fn19", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1204, - "end": 1245, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1226, - "end": 1245, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1228, - "end": 1243, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1228, - "end": 1242, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1234, - "end": 1242, - "ctxt": 0 - }, - "value": "thenable", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.ts b/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.ts deleted file mode 100644 index 27960dfcfaf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es5.ts +++ /dev/null @@ -1,26 +0,0 @@ -// @target: ES5 -// @lib: es5,es2015.promise -// @noEmitHelpers: true -declare class Thenable { then(): void; } -declare let a: any; -declare let obj: { then: string; }; -declare let thenable: Thenable; -async function fn1() { } // valid: Promise -async function fn2(): { } { } // error -async function fn3(): any { } // error -async function fn4(): number { } // error -async function fn5(): PromiseLike { } // error -async function fn6(): Thenable { } // error -async function fn7() { return; } // valid: Promise -async function fn8() { return 1; } // valid: Promise -async function fn9() { return null; } // valid: Promise -async function fn10() { return undefined; } // valid: Promise -async function fn11() { return a; } // valid: Promise -async function fn12() { return obj; } // valid: Promise<{ then: string; }> -async function fn13() { return thenable; } // error -async function fn14() { await 1; } // valid: Promise -async function fn15() { await null; } // valid: Promise -async function fn16() { await undefined; } // valid: Promise -async function fn17() { await a; } // valid: Promise -async function fn18() { await obj; } // valid: Promise -async function fn19() { await thenable; } // error diff --git a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.json b/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.json deleted file mode 100644 index 3aeee91d7be..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.json +++ /dev/null @@ -1,1337 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 41, - "end": 1217, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 55, - "end": 63, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "declare": true, - "span": { - "start": 41, - "end": 81, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 66, - "end": 79, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 66, - "end": 70, - "ctxt": 0 - }, - "value": "then", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 66, - "end": 79, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 72, - "end": 78, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 74, - "end": 78, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 82, - "end": 101, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 94, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 100, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 102, - "end": 137, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 114, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 136, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 119, - "end": 136, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 121, - "end": 134, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 121, - "end": 125, - "ctxt": 0 - }, - "value": "then", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 125, - "end": 133, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 127, - "end": 133, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 138, - "end": 169, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 150, - "end": 168, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 150, - "end": 158, - "ctxt": 0 - }, - "value": "thenable", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 158, - "end": 168, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 160, - "end": 168, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 160, - "end": 168, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 185, - "end": 188, - "ctxt": 0 - }, - "value": "fn1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 170, - "end": 194, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 191, - "end": 194, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 234, - "end": 237, - "ctxt": 0 - }, - "value": "fn2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 219, - "end": 248, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 244, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 241, - "end": 244, - "ctxt": 0 - }, - "members": [] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 273, - "end": 276, - "ctxt": 0 - }, - "value": "fn3", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 258, - "end": 287, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 278, - "end": 283, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "value": "fn4", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 297, - "end": 329, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 326, - "end": 329, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 317, - "end": 325, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 319, - "end": 325, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 354, - "end": 357, - "ctxt": 0 - }, - "value": "fn5", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 339, - "end": 382, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 359, - "end": 378, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 361, - "end": 378, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 361, - "end": 372, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 372, - "end": 378, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 373, - "end": 377, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 407, - "end": 410, - "ctxt": 0 - }, - "value": "fn6", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 392, - "end": 426, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 412, - "end": 422, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "value": "Thenable", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "value": "fn7", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 436, - "end": 468, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 457, - "end": 468, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 459, - "end": 466, - "ctxt": 0 - }, - "argument": null - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 508, - "end": 511, - "ctxt": 0 - }, - "value": "fn8", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 493, - "end": 527, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 514, - "end": 527, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 516, - "end": 525, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 523, - "end": 524, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 569, - "end": 572, - "ctxt": 0 - }, - "value": "fn9", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 554, - "end": 591, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 575, - "end": 591, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 577, - "end": 589, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 584, - "end": 588, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 630, - "end": 634, - "ctxt": 0 - }, - "value": "fn10", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 615, - "end": 658, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 637, - "end": 658, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 639, - "end": 656, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 646, - "end": 655, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 697, - "end": 701, - "ctxt": 0 - }, - "value": "fn11", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 682, - "end": 717, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 704, - "end": 717, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 706, - "end": 715, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 713, - "end": 714, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 756, - "end": 760, - "ctxt": 0 - }, - "value": "fn12", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 741, - "end": 778, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 763, - "end": 778, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 765, - "end": 776, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 772, - "end": 775, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 831, - "end": 835, - "ctxt": 0 - }, - "value": "fn13", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 816, - "end": 858, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 838, - "end": 858, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 840, - "end": 856, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 847, - "end": 855, - "ctxt": 0 - }, - "value": "thenable", - "optional": false - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 883, - "end": 887, - "ctxt": 0 - }, - "value": "fn14", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 868, - "end": 902, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 890, - "end": 902, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 892, - "end": 900, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 892, - "end": 899, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 898, - "end": 899, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 942, - "end": 946, - "ctxt": 0 - }, - "value": "fn15", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 927, - "end": 964, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 949, - "end": 964, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 951, - "end": 962, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 951, - "end": 961, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 957, - "end": 961, - "ctxt": 0 - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1004, - "end": 1008, - "ctxt": 0 - }, - "value": "fn16", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 989, - "end": 1031, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1011, - "end": 1031, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1013, - "end": 1029, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1013, - "end": 1028, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1019, - "end": 1028, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1075, - "ctxt": 0 - }, - "value": "fn17", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1056, - "end": 1090, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1078, - "end": 1090, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1080, - "end": 1088, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1080, - "end": 1087, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1086, - "end": 1087, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1130, - "end": 1134, - "ctxt": 0 - }, - "value": "fn18", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1115, - "end": 1151, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1137, - "end": 1151, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1139, - "end": 1149, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1139, - "end": 1148, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1145, - "end": 1148, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1191, - "end": 1195, - "ctxt": 0 - }, - "value": "fn19", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1176, - "end": 1217, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1198, - "end": 1217, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1200, - "end": 1215, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1200, - "end": 1214, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1206, - "end": 1214, - "ctxt": 0 - }, - "value": "thenable", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.ts b/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.ts deleted file mode 100644 index 31d3bc7b9bc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration15_es6.ts +++ /dev/null @@ -1,25 +0,0 @@ -// @target: ES6 -// @noEmitHelpers: true -declare class Thenable { then(): void; } -declare let a: any; -declare let obj: { then: string; }; -declare let thenable: Thenable; -async function fn1() { } // valid: Promise -async function fn2(): { } { } // error -async function fn3(): any { } // error -async function fn4(): number { } // error -async function fn5(): PromiseLike { } // error -async function fn6(): Thenable { } // error -async function fn7() { return; } // valid: Promise -async function fn8() { return 1; } // valid: Promise -async function fn9() { return null; } // valid: Promise -async function fn10() { return undefined; } // valid: Promise -async function fn11() { return a; } // valid: Promise -async function fn12() { return obj; } // valid: Promise<{ then: string; }> -async function fn13() { return thenable; } // error -async function fn14() { await 1; } // valid: Promise -async function fn15() { await null; } // valid: Promise -async function fn16() { await undefined; } // valid: Promise -async function fn17() { await a; } // valid: Promise -async function fn18() { await obj; } // valid: Promise -async function fn19() { await thenable; } // error diff --git a/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.json b/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.json index 022d721f98b..aa19bdf31f5 100644 --- a/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.json +++ b/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 57, - "end": 4368, + "end": 5298, "ctxt": 0 }, "body": [ @@ -4218,6 +4218,1925 @@ "typeParams": null, "superTypeParams": null, "implements": [] + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 4432, + "end": 4436, + "ctxt": 0 + }, + "value": "Base", + "optional": false + }, + "declare": false, + "span": { + "start": 4426, + "end": 4642, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassMethod", + "span": { + "start": 4443, + "end": 4464, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4447, + "end": 4453, + "ctxt": 0 + }, + "value": "setter", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 4454, + "end": 4460, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4454, + "end": 4460, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4455, + "end": 4460, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4457, + "end": 4460, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4443, + "end": 4464, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4462, + "end": 4464, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "setter", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4469, + "end": 4498, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4473, + "end": 4479, + "ctxt": 0 + }, + "value": "getter", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4469, + "end": 4498, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4487, + "end": 4498, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4489, + "end": 4496, + "ctxt": 0 + }, + "argument": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 4481, + "end": 4486, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4483, + "end": 4486, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "kind": "getter", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4503, + "end": 4528, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4503, + "end": 4509, + "ctxt": 0 + }, + "value": "method", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 4510, + "end": 4519, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4510, + "end": 4519, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4511, + "end": 4519, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4513, + "end": 4519, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4503, + "end": 4528, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4526, + "end": 4528, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 4520, + "end": 4525, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4522, + "end": 4525, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4534, + "end": 4562, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4545, + "end": 4551, + "ctxt": 0 + }, + "value": "setter", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 4552, + "end": 4558, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4552, + "end": 4558, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4553, + "end": 4558, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4555, + "end": 4558, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4534, + "end": 4562, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4560, + "end": 4562, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "setter", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4567, + "end": 4603, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4578, + "end": 4584, + "ctxt": 0 + }, + "value": "getter", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4567, + "end": 4603, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4592, + "end": 4603, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4594, + "end": 4601, + "ctxt": 0 + }, + "argument": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 4586, + "end": 4591, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4588, + "end": 4591, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "kind": "getter", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4608, + "end": 4640, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4615, + "end": 4621, + "ctxt": 0 + }, + "value": "method", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 4622, + "end": 4631, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4622, + "end": 4631, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4623, + "end": 4631, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4625, + "end": 4631, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4608, + "end": 4640, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4638, + "end": 4640, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 4632, + "end": 4637, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4634, + "end": 4637, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 4650, + "end": 4657, + "ctxt": 0 + }, + "value": "Derived", + "optional": false + }, + "declare": false, + "span": { + "start": 4644, + "end": 5298, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassMethod", + "span": { + "start": 4677, + "end": 4720, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4677, + "end": 4678, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4677, + "end": 4720, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4681, + "end": 4720, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4683, + "end": 4718, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4690, + "end": 4718, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "CallExpression", + "span": { + "start": 4702, + "end": 4718, + "ctxt": 0 + }, + "callee": { + "type": "SuperPropExpression", + "span": { + "start": 4702, + "end": 4714, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4702, + "end": 4707, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 4708, + "end": 4714, + "ctxt": 0 + }, + "value": "method", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 4715, + "end": 4717, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + } + ], + "typeArguments": null + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4725, + "end": 4764, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4725, + "end": 4726, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4725, + "end": 4764, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4729, + "end": 4764, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4731, + "end": 4762, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4738, + "end": 4762, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "SuperPropExpression", + "span": { + "start": 4750, + "end": 4762, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4750, + "end": 4755, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 4756, + "end": 4762, + "ctxt": 0 + }, + "value": "getter", + "optional": false + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4769, + "end": 4813, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4769, + "end": 4770, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4769, + "end": 4813, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4773, + "end": 4813, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4775, + "end": 4811, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4782, + "end": 4811, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "AssignmentExpression", + "span": { + "start": 4794, + "end": 4811, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "SuperPropExpression", + "span": { + "start": 4794, + "end": 4806, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4794, + "end": 4799, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 4800, + "end": 4806, + "ctxt": 0 + }, + "value": "setter", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 4809, + "end": 4811, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4818, + "end": 4864, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4818, + "end": 4819, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4818, + "end": 4864, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4822, + "end": 4864, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4824, + "end": 4862, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4831, + "end": 4862, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "CallExpression", + "span": { + "start": 4843, + "end": 4862, + "ctxt": 0 + }, + "callee": { + "type": "SuperPropExpression", + "span": { + "start": 4843, + "end": 4858, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4843, + "end": 4848, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 4848, + "end": 4858, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 4849, + "end": 4857, + "ctxt": 0 + }, + "value": "method", + "raw": "\"method\"" + } + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 4859, + "end": 4861, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + } + ], + "typeArguments": null + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4869, + "end": 4911, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4869, + "end": 4870, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4869, + "end": 4911, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4873, + "end": 4911, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4875, + "end": 4909, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4882, + "end": 4909, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "SuperPropExpression", + "span": { + "start": 4894, + "end": 4909, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4894, + "end": 4899, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 4899, + "end": 4909, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 4900, + "end": 4908, + "ctxt": 0 + }, + "value": "getter", + "raw": "\"getter\"" + } + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4916, + "end": 4963, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4916, + "end": 4917, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4916, + "end": 4963, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4920, + "end": 4963, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4922, + "end": 4961, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4929, + "end": 4961, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "AssignmentExpression", + "span": { + "start": 4941, + "end": 4961, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "SuperPropExpression", + "span": { + "start": 4941, + "end": 4956, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 4941, + "end": 4946, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 4946, + "end": 4956, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 4947, + "end": 4955, + "ctxt": 0 + }, + "value": "setter", + "raw": "\"setter\"" + } + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 4959, + "end": 4961, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 4968, + "end": 5018, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 4975, + "end": 4976, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 4968, + "end": 5018, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4979, + "end": 5018, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4981, + "end": 5016, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4988, + "end": 5016, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "CallExpression", + "span": { + "start": 5000, + "end": 5016, + "ctxt": 0 + }, + "callee": { + "type": "SuperPropExpression", + "span": { + "start": 5000, + "end": 5012, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5000, + "end": 5005, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 5006, + "end": 5012, + "ctxt": 0 + }, + "value": "method", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5013, + "end": 5015, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + } + ], + "typeArguments": null + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 5023, + "end": 5069, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 5030, + "end": 5031, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 5023, + "end": 5069, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5034, + "end": 5069, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5036, + "end": 5067, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 5043, + "end": 5067, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "SuperPropExpression", + "span": { + "start": 5055, + "end": 5067, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5055, + "end": 5060, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 5061, + "end": 5067, + "ctxt": 0 + }, + "value": "getter", + "optional": false + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 5074, + "end": 5125, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 5081, + "end": 5082, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 5074, + "end": 5125, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5085, + "end": 5125, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5087, + "end": 5123, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 5094, + "end": 5123, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "AssignmentExpression", + "span": { + "start": 5106, + "end": 5123, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "SuperPropExpression", + "span": { + "start": 5106, + "end": 5118, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5106, + "end": 5111, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 5112, + "end": 5118, + "ctxt": 0 + }, + "value": "setter", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 5121, + "end": 5123, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 5130, + "end": 5183, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 5137, + "end": 5138, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 5130, + "end": 5183, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5141, + "end": 5183, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5143, + "end": 5181, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 5150, + "end": 5181, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "CallExpression", + "span": { + "start": 5162, + "end": 5181, + "ctxt": 0 + }, + "callee": { + "type": "SuperPropExpression", + "span": { + "start": 5162, + "end": 5177, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5162, + "end": 5167, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 5167, + "end": 5177, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5168, + "end": 5176, + "ctxt": 0 + }, + "value": "method", + "raw": "\"method\"" + } + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5178, + "end": 5180, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + } + ], + "typeArguments": null + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 5188, + "end": 5237, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 5195, + "end": 5196, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 5188, + "end": 5237, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5199, + "end": 5237, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5201, + "end": 5235, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 5208, + "end": 5235, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "SuperPropExpression", + "span": { + "start": 5220, + "end": 5235, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5220, + "end": 5225, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 5225, + "end": 5235, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5226, + "end": 5234, + "ctxt": 0 + }, + "value": "getter", + "raw": "\"getter\"" + } + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 5242, + "end": 5296, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 5249, + "end": 5250, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 5242, + "end": 5296, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5253, + "end": 5296, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5255, + "end": 5294, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 5262, + "end": 5294, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "AssignmentExpression", + "span": { + "start": 5274, + "end": 5294, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "SuperPropExpression", + "span": { + "start": 5274, + "end": 5289, + "ctxt": 0 + }, + "obj": { + "type": "Super", + "span": { + "start": 5274, + "end": 5279, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 5279, + "end": 5289, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5280, + "end": 5288, + "ctxt": 0 + }, + "value": "setter", + "raw": "\"setter\"" + } + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 5292, + "end": 5294, + "ctxt": 0 + }, + "value": "", + "raw": "''" + } + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + } + ], + "superClass": { + "type": "Identifier", + "span": { + "start": 4666, + "end": 4670, + "ctxt": 0 + }, + "value": "Base", + "optional": false + }, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.ts b/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.ts index 351fe4bf556..ded97df7510 100644 --- a/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.ts +++ b/crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.ts @@ -187,3 +187,29 @@ class B extends A { (async () => super["x"] = f); } } + +// https://github.com/microsoft/TypeScript/issues/46828 +class Base { + set setter(x: any) {} + get getter(): any { return; } + method(x: string): any {} + + static set setter(x: any) {} + static get getter(): any { return; } + static method(x: string): any {} +} + +class Derived extends Base { + a() { return async () => super.method('') } + b() { return async () => super.getter } + c() { return async () => super.setter = '' } + d() { return async () => super["method"]('') } + e() { return async () => super["getter"] } + f() { return async () => super["setter"] = '' } + static a() { return async () => super.method('') } + static b() { return async () => super.getter } + static c() { return async () => super.setter = '' } + static d() { return async () => super["method"]('') } + static e() { return async () => super["getter"] } + static f() { return async () => super["setter"] = '' } +} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.json b/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.json deleted file mode 100644 index 1a54699476b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 69, - "end": 184, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 69, - "end": 141, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 81, - "end": 141, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 87, - "end": 139, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 100, - "end": 109, - "ctxt": 0 - }, - "value": "MyPromise", - "optional": false - }, - "declare": false, - "span": { - "start": 94, - "end": 139, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 121, - "end": 128, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 109, - "end": 112, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - } - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 143, - "end": 184, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 161, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 163, - "end": 180, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 163, - "end": 164, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "value": "MyPromise", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 175, - "end": 179, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.ts b/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.ts deleted file mode 100644 index bbaec20c39b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es5.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: ES5 -// @lib: es5,es2015.promise -// @noEmitHelpers: true -namespace X { - export class MyPromise extends Promise { - } -} - -async function f(): X.MyPromise { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.json b/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.json deleted file mode 100644 index 55c06374b9f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 41, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 41, - "end": 113, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 53, - "end": 113, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 59, - "end": 111, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 72, - "end": 81, - "ctxt": 0 - }, - "value": "MyPromise", - "optional": false - }, - "declare": false, - "span": { - "start": 66, - "end": 111, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 93, - "end": 100, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 81, - "end": 84, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 100, - "end": 103, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - } - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 115, - "end": 156, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 153, - "end": 156, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 133, - "end": 152, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 135, - "end": 152, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 137, - "end": 146, - "ctxt": 0 - }, - "value": "MyPromise", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 146, - "end": 152, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 151, - "ctxt": 0 - }, - "kind": "void" - } - ] - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.ts b/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.ts deleted file mode 100644 index d5a55f8b3d2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/asyncQualifiedReturnType_es6.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target: ES6 -// @noEmitHelpers: true -namespace X { - export class MyPromise extends Promise { - } -} - -async function f(): X.MyPromise { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor1.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor1.ts new file mode 100644 index 00000000000..aab966c7f87 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor1.ts @@ -0,0 +1,9 @@ +// @target: esnext, es2022, es2015, es5 +// @noEmitOnError: true + +class C1 { + accessor a: any; + accessor b = 1; + static accessor c: any; + static accessor d = 2; +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor10.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor10.ts new file mode 100644 index 00000000000..012d9f0767d --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor10.ts @@ -0,0 +1,30 @@ +// @target: es2022 + +class C1 { + accessor a0 = 1; +} + +class C2 { + #a1_accessor_storage = 1; + accessor a1 = 2; +} + +class C3 { + static #a2_accessor_storage = 1; + static { + class C3_Inner { + accessor a2 = 2; + static { + #a2_accessor_storage in C3; + } + } + } +} + +class C4_1 { + static accessor a3 = 1; +} + +class C4_2 { + static accessor a3 = 1; +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor2.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor2.ts new file mode 100644 index 00000000000..78e80d088de --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor2.ts @@ -0,0 +1,18 @@ +// @target: esnext, es2022, es2015 + +class C1 { + accessor #a: any; + accessor #b = 1; + static accessor #c: any; + static accessor #d = 2; + + constructor() { + this.#a = 3; + this.#b = 4; + } + + static { + this.#c = 5; + this.#d = 6; + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor3.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor3.ts new file mode 100644 index 00000000000..8c9e40e56a6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor3.ts @@ -0,0 +1,9 @@ +// @target: esnext, es2022, es2015, es5 +// @noEmitOnError: true + +class C1 { + accessor "w": any; + accessor "x" = 1; + static accessor "y": any; + static accessor "z" = 2; +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor4.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor4.ts new file mode 100644 index 00000000000..7746ff3f1b4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor4.ts @@ -0,0 +1,9 @@ +// @target: esnext, es2022, es2015, es5 +// @noEmitOnError: true + +class C1 { + accessor 0: any; + accessor 1 = 1; + static accessor 2: any; + static accessor 3 = 2; +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor6.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor6.ts new file mode 100644 index 00000000000..f485541dd99 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor6.ts @@ -0,0 +1,14 @@ +// @target: esnext, es2022, es2015 +// @useDefineForClassFields: * + +class C1 { + accessor a: any; +} + +class C2 extends C1 { + a = 1; +} + +class C3 extends C1 { + get a() { return super.a; } +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor7.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor7.ts new file mode 100644 index 00000000000..724cd7afedd --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor7.ts @@ -0,0 +1,14 @@ +// @target: esnext, es2022, es2015 +// @useDefineForClassFields: * + +abstract class C1 { + abstract accessor a: any; +} + +class C2 extends C1 { + accessor a = 1; +} + +class C3 extends C1 { + get a() { return 1; } +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor8.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor8.ts new file mode 100644 index 00000000000..d2f904c98fe --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor8.ts @@ -0,0 +1,20 @@ +// @target: esnext +// @declaration: true + +class C1 { + accessor a: any; + static accessor b: any; +} + +declare class C2 { + accessor a: any; + static accessor b: any; +} + +function f() { + class C3 { + accessor a: any; + static accessor b: any; + } + return C3; +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessor9.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessor9.ts new file mode 100644 index 00000000000..b9b98c18841 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessor9.ts @@ -0,0 +1,48 @@ +// @target: esnext +// @useDefineForClassFields: false + +// Auto-accessors do not use Set semantics themselves, so do not need to be transformed if there are no other +// initializers that need to be transformed: +class C1 { + accessor x = 1; +} + +// If there are other field initializers to transform, we must transform auto-accessors so that we can preserve +// initialization order: +class C2 { + x = 1; + accessor y = 2; + z = 3; +} + +// Private field initializers also do not use Set semantics, so they do not force an auto-accessor transformation: +class C3 { + #x = 1; + accessor y = 2; +} + +// However, we still need to hoist private field initializers to the constructor if we need to preserve initialization +// order: +class C4 { + x = 1; + #y = 2; + z = 3; +} + +class C5 { + #x = 1; + accessor y = 2; + z = 3; +} + +// Static accessors aren't affected: +class C6 { + static accessor x = 1; +} + +// Static accessors aren't affected: +class C7 { + static x = 1; + static accessor y = 2; + static z = 3; +} diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessorAllowedModifiers.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessorAllowedModifiers.ts new file mode 100644 index 00000000000..7414cb850c8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessorAllowedModifiers.ts @@ -0,0 +1,29 @@ +// @target: esnext +// @noTypesAndSymbols: true + +abstract class C1 { + accessor a: any; + public accessor b: any; + private accessor c: any; + protected accessor d: any; + abstract accessor e: any; + static accessor f: any; + public static accessor g: any; + private static accessor h: any; + protected static accessor i: any; + accessor #j: any; + accessor "k": any; + accessor 108: any; + accessor ["m"]: any; + accessor n!: number; +} + +class C2 extends C1 { + override accessor e: any; + static override accessor i: any; +} + +declare class C3 { + accessor a: any; +} + diff --git a/crates/swc_ecma_parser/tests/tsc/autoAccessorNoUseDefineForClassFields.ts b/crates/swc_ecma_parser/tests/tsc/autoAccessorNoUseDefineForClassFields.ts new file mode 100644 index 00000000000..2a924ae5d5c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/autoAccessorNoUseDefineForClassFields.ts @@ -0,0 +1,41 @@ +// @target: esnext +// @useDefineForClassFields: false + +// @filename: file1.ts +// https://github.com/microsoft/TypeScript/issues/51528 +class C1 { + static accessor x = 0; +} + +// @filename: file2.ts +class C2 { + static accessor #x = 0; +} + +// @filename: file3.ts +class C3 { + static accessor #x = 0; + accessor #y = 0; +} + +// @filename: file3.ts +class C3 { + accessor x = 0; +} + +// @filename: file4.ts +class C4 { + accessor #x = 0; +} + +// @filename: file5.ts +class C5 { + x = 0; + accessor #x = 1; +} + +// @filename: file6.ts +class C6 { + accessor #x = 0; + x = 1; +} diff --git a/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.json b/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.json deleted file mode 100644 index d637a42fa35..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.json +++ /dev/null @@ -1,667 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 48, - "end": 400, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 64, - "end": 68, - "ctxt": 0 - }, - "value": "test", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 69, - "end": 87, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 69, - "end": 87, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 70, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 72, - "end": 87, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 72, - "end": 79, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 79, - "end": 87, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 80, - "end": 86, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 48, - "end": 400, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 89, - "end": 400, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 95, - "end": 241, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 113, - "end": 133, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 113, - "end": 122, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 114, - "end": 121, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "value": { - "type": "AwaitExpression", - "span": { - "start": 125, - "end": 132, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 131, - "end": 132, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 142, - "end": 169, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 149, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 150, - "end": 157, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "value": { - "type": "AwaitExpression", - "span": { - "start": 161, - "end": 168, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 179, - "end": 199, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 179, - "end": 188, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 180, - "end": 187, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "delegate": false - } - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 191, - "end": 198, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 208, - "end": 235, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 215, - "end": 224, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 216, - "end": 223, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 222, - "end": 223, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - }, - "delegate": false - } - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 227, - "end": 234, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 233, - "end": 234, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ReturnStatement", - "span": { - "start": 247, - "end": 398, - "ctxt": 0 - }, - "argument": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 254, - "end": 398, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 270, - "end": 290, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 270, - "end": 279, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 271, - "end": 278, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 277, - "end": 278, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "value": { - "type": "AwaitExpression", - "span": { - "start": 282, - "end": 289, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 299, - "end": 326, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 306, - "end": 315, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 307, - "end": 314, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "value": { - "type": "AwaitExpression", - "span": { - "start": 318, - "end": 325, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 324, - "end": 325, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 336, - "end": 356, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 336, - "end": 345, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 337, - "end": 344, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "delegate": false - } - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 348, - "end": 355, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 365, - "end": 392, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 372, - "end": 381, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 373, - "end": 380, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 379, - "end": 380, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - }, - "delegate": false - } - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 384, - "end": 391, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - }, - "generator": true, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.ts b/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.ts deleted file mode 100644 index 0de782de213..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/awaitAndYieldInProperty.ts +++ /dev/null @@ -1,19 +0,0 @@ -// @target: es2019 -// @noTypesAndSymbols: true -async function* test(x: Promise) { - class C { - [await x] = await x; - static [await x] = await x; - - [yield 1] = yield 2; - static [yield 3] = yield 4; - } - - return class { - [await x] = await x; - static [await x] = await x; - - [yield 1] = yield 2; - static [yield 3] = yield 4; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.json b/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.json deleted file mode 100644 index 850e9ab337e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.json +++ /dev/null @@ -1,3275 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 122, - "end": 1659, - "ctxt": 0 - }, - "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 122, - "end": 161, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 127, - "end": 133, - "ctxt": 0 - }, - "value": "Either", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 142, - "end": 160, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 142, - "end": 146, - "ctxt": 0 - }, - "value": "Left", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 146, - "end": 149, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 147, - "end": 148, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 147, - "end": 148, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeReference", - "span": { - "start": 152, - "end": 160, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 152, - "end": 157, - "ctxt": 0 - }, - "value": "Right", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 157, - "end": 160, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 162, - "end": 199, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 167, - "end": 171, - "ctxt": 0 - }, - "value": "Left", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 171, - "end": 174, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 177, - "end": 198, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 179, - "end": 191, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 179, - "end": 182, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 182, - "end": 190, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 184, - "end": 190, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 184, - "end": 190, - "ctxt": 0 - }, - "value": "Left", - "raw": "'Left'" - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 192, - "end": 196, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 193, - "end": 196, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 200, - "end": 239, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 210, - "ctxt": 0 - }, - "value": "Right", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 216, - "end": 238, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 218, - "end": 231, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 218, - "end": 221, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 221, - "end": 230, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 223, - "end": 230, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 223, - "end": 230, - "ctxt": 0 - }, - "value": "Right", - "raw": "'Right'" - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 232, - "end": 236, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 241, - "end": 308, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 247, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 247, - "end": 253, - "ctxt": 0 - }, - "value": "mkLeft", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 256, - "end": 307, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 287, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 288, - "end": 306, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 290, - "end": 293, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "Left", - "raw": "'Left'" - } - }, - { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - ] - } - }, - "async": false, - "generator": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 256, - "end": 259, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 283, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 267, - "end": 283, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "value": "Either", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 273, - "end": 283, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 277, - "end": 282, - "ctxt": 0 - }, - "kind": "never" - } - ] - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 378, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 315, - "end": 377, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 315, - "end": 322, - "ctxt": 0 - }, - "value": "mkRight", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 325, - "end": 377, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 329, - "end": 333, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - } - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 356, - "end": 377, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 357, - "end": 376, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 359, - "end": 362, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 364, - "end": 371, - "ctxt": 0 - }, - "value": "Right", - "raw": "'Right'" - } - }, - { - "type": "Identifier", - "span": { - "start": 373, - "end": 374, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - ] - } - }, - "async": false, - "generator": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 325, - "end": 328, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 334, - "end": 352, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 336, - "end": 352, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "value": "Either", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 342, - "end": 352, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 343, - "end": 348, - "ctxt": 0 - }, - "kind": "never" - }, - { - "type": "TsTypeReference", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 386, - "end": 394, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "declare": false, - "span": { - "start": 380, - "end": 1308, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 433, - "end": 542, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 440, - "end": 447, - "ctxt": 0 - }, - "value": "succeed", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 451, - "end": 455, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 451, - "end": 455, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 452, - "end": 455, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 433, - "end": 542, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 477, - "end": 542, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 487, - "end": 536, - "ctxt": 0 - }, - "argument": { - "type": "NewExpression", - "span": { - "start": 494, - "end": 535, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 498, - "end": 506, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 507, - "end": 534, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 507, - "end": 522, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 507, - "end": 514, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 515, - "end": 522, - "ctxt": 0 - }, - "value": "resolve", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 523, - "end": 533, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 523, - "end": 530, - "ctxt": 0 - }, - "value": "mkRight", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 531, - "end": 532, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "typeArguments": null - } - } - ], - "typeArguments": null - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 447, - "end": 450, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 456, - "end": 476, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 458, - "end": 476, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 458, - "end": 466, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 466, - "end": 476, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 467, - "end": 472, - "ctxt": 0 - }, - "kind": "never" - }, - { - "type": "TsTypeReference", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 548, - "end": 653, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 555, - "end": 559, - "ctxt": 0 - }, - "value": "fail", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 563, - "end": 567, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 563, - "end": 567, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 564, - "end": 567, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 566, - "end": 567, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 566, - "end": 567, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 548, - "end": 653, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 589, - "end": 653, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 599, - "end": 647, - "ctxt": 0 - }, - "argument": { - "type": "NewExpression", - "span": { - "start": 606, - "end": 646, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 610, - "end": 618, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 619, - "end": 645, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 619, - "end": 634, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 619, - "end": 626, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 627, - "end": 634, - "ctxt": 0 - }, - "value": "resolve", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 635, - "end": 644, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 635, - "end": 641, - "ctxt": 0 - }, - "value": "mkLeft", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - } - ], - "typeArguments": null - } - } - ], - "typeArguments": null - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 559, - "end": 562, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 568, - "end": 588, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 570, - "end": 588, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 570, - "end": 578, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 578, - "end": 588, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 579, - "end": 580, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 579, - "end": 580, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 582, - "end": 587, - "ctxt": 0 - }, - "kind": "never" - } - ] - } - } - } - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "Constructor", - "span": { - "start": 659, - "end": 713, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 659, - "end": 670, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 671, - "end": 708, - "ctxt": 0 - }, - "decorators": [], - "accessibility": null, - "override": false, - "readonly": true, - "param": { - "type": "Identifier", - "span": { - "start": 680, - "end": 708, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 681, - "end": 708, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 683, - "end": 708, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 683, - "end": 694, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 694, - "end": 708, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 695, - "end": 707, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 695, - "end": 701, - "ctxt": 0 - }, - "value": "Either", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 701, - "end": 707, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 702, - "end": 703, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 702, - "end": 703, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 705, - "end": 706, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 705, - "end": 706, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - } - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 710, - "end": 713, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 719, - "end": 1306, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 719, - "end": 723, - "ctxt": 0 - }, - "value": "then", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 820, - "end": 844, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 820, - "end": 844, - "ctxt": 0 - }, - "value": "this", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 824, - "end": 844, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 826, - "end": 844, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 826, - "end": 834, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 834, - "end": 844, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 835, - "end": 840, - "ctxt": 0 - }, - "kind": "never" - }, - { - "type": "TsTypeReference", - "span": { - "start": 842, - "end": 843, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 842, - "end": 843, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 854, - "end": 921, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 854, - "end": 921, - "ctxt": 0 - }, - "value": "onfulfilled", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 866, - "end": 921, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 868, - "end": 921, - "ctxt": 0 - }, - "types": [ - { - "type": "TsParenthesizedType", - "span": { - "start": 868, - "end": 902, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 869, - "end": 901, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 870, - "end": 878, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 875, - "end": 878, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 877, - "end": 878, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 877, - "end": 878, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 880, - "end": 901, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 883, - "end": 901, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 883, - "end": 884, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 883, - "end": 884, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 887, - "end": 901, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 887, - "end": 898, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 898, - "end": 901, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 899, - "end": 900, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 899, - "end": 900, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - } - } - } - }, - { - "type": "TsKeywordType", - "span": { - "start": 905, - "end": 909, - "ctxt": 0 - }, - "kind": "null" - }, - { - "type": "TsKeywordType", - "span": { - "start": 912, - "end": 921, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 931, - "end": 1002, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 931, - "end": 1002, - "ctxt": 0 - }, - "value": "onrejected", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 942, - "end": 1002, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 944, - "end": 1002, - "ctxt": 0 - }, - "types": [ - { - "type": "TsParenthesizedType", - "span": { - "start": 944, - "end": 983, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 945, - "end": 982, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 946, - "end": 957, - "ctxt": 0 - }, - "value": "reason", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 952, - "end": 957, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 954, - "end": 957, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 959, - "end": 982, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 962, - "end": 982, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 962, - "end": 964, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 962, - "end": 964, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 967, - "end": 982, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 967, - "end": 978, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 978, - "end": 982, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 979, - "end": 981, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 979, - "end": 981, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - } - } - } - }, - { - "type": "TsKeywordType", - "span": { - "start": 986, - "end": 990, - "ctxt": 0 - }, - "kind": "null" - }, - { - "type": "TsKeywordType", - "span": { - "start": 993, - "end": 1002, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 719, - "end": 1306, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1030, - "end": 1306, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1040, - "end": 1300, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 1047, - "end": 1300, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1047, - "end": 1058, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1047, - "end": 1053, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1047, - "end": 1051, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1052, - "end": 1053, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1054, - "end": 1058, - "ctxt": 0 - }, - "value": "then", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1177, - "end": 1266, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1177, - "end": 1183, - "ctxt": 0 - }, - "value": "either", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BinaryExpression", - "span": { - "start": 1187, - "end": 1266, - "ctxt": 0 - }, - "operator": "??", - "left": { - "type": "OptionalChainingExpression", - "span": { - "start": 1187, - "end": 1224, - "ctxt": 0 - }, - "questionDotToken": { - "start": 1198, - "end": 1199, - "ctxt": 0 - }, - "base": { - "type": "CallExpression", - "span": { - "start": 1187, - "end": 1224, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1187, - "end": 1198, - "ctxt": 0 - }, - "value": "onfulfilled", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1201, - "end": 1223, - "ctxt": 0 - }, - "object": { - "type": "ParenthesisExpression", - "span": { - "start": 1201, - "end": 1221, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 1202, - "end": 1220, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1202, - "end": 1208, - "ctxt": 0 - }, - "value": "either", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1212, - "end": 1220, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1212, - "end": 1217, - "ctxt": 0 - }, - "value": "Right", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1217, - "end": 1220, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1218, - "end": 1219, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1218, - "end": 1219, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1222, - "end": 1223, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "typeArguments": null - } - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1228, - "end": 1266, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 1228, - "end": 1261, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1228, - "end": 1250, - "ctxt": 0 - }, - "object": { - "type": "ParenthesisExpression", - "span": { - "start": 1228, - "end": 1248, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 1229, - "end": 1247, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1229, - "end": 1235, - "ctxt": 0 - }, - "value": "either", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1239, - "end": 1247, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1239, - "end": 1244, - "ctxt": 0 - }, - "value": "Right", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1244, - "end": 1247, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1245, - "end": 1246, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1245, - "end": 1246, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1249, - "end": 1250, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1254, - "end": 1261, - "ctxt": 0 - }, - "kind": "unknown" - } - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1265, - "end": 1266, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1265, - "end": 1266, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1280, - "end": 1290, - "ctxt": 0 - }, - "value": "onrejected", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 723, - "end": 742, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 724, - "end": 729, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 724, - "end": 725, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": { - "type": "TsTypeReference", - "span": { - "start": 728, - "end": 729, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 728, - "end": 729, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTypeParameter", - "span": { - "start": 731, - "end": 741, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 731, - "end": 733, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": { - "type": "TsKeywordType", - "span": { - "start": 736, - "end": 741, - "ctxt": 0 - }, - "kind": "never" - } - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1008, - "end": 1029, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1010, - "end": 1029, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1010, - "end": 1021, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1021, - "end": 1029, - "ctxt": 0 - }, - "params": [ - { - "type": "TsUnionType", - "span": { - "start": 1022, - "end": 1028, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1022, - "end": 1023, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1023, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1026, - "end": 1028, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1026, - "end": 1028, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "typeParams": null - } - ] - } - ] - } - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 394, - "end": 400, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 412, - "end": 426, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 412, - "end": 423, - "ctxt": 0 - }, - "value": "PromiseLike", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 424, - "end": 425, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 424, - "end": 425, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1310, - "end": 1378, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1316, - "end": 1377, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1316, - "end": 1332, - "ctxt": 0 - }, - "value": "withTypedFailure", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1332, - "end": 1358, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1334, - "end": 1358, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1334, - "end": 1342, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1342, - "end": 1358, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 1343, - "end": 1349, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1351, - "end": 1357, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - }, - "init": { - "type": "CallExpression", - "span": { - "start": 1361, - "end": 1377, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1361, - "end": 1374, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1361, - "end": 1369, - "ctxt": 0 - }, - "value": "EPromise", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1370, - "end": 1374, - "ctxt": 0 - }, - "value": "fail", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1375, - "end": 1376, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1542, - "end": 1604, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1542, - "end": 1603, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1542, - "end": 1590, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 1542, - "end": 1585, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1542, - "end": 1563, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1542, - "end": 1558, - "ctxt": 0 - }, - "value": "withTypedFailure", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1559, - "end": 1563, - "ctxt": 0 - }, - "value": "then", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1564, - "end": 1584, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1564, - "end": 1565, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 1569, - "end": 1584, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1569, - "end": 1582, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1569, - "end": 1570, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1571, - "end": 1582, - "ctxt": 0 - }, - "value": "toUpperCase", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 1586, - "end": 1590, - "ctxt": 0 - }, - "value": "then", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1591, - "end": 1602, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1591, - "end": 1598, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1599, - "end": 1602, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1621, - "end": 1625, - "ctxt": 0 - }, - "value": "test", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1606, - "end": 1659, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1628, - "end": 1659, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1634, - "end": 1657, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 1634, - "end": 1656, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1640, - "end": 1656, - "ctxt": 0 - }, - "value": "withTypedFailure", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.ts b/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.ts deleted file mode 100644 index d55267985eb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_incorrectThisType.ts +++ /dev/null @@ -1,48 +0,0 @@ -// @target: esnext -// @noEmit: true -// @noTypesAndSymbols: true - -// https://github.com/microsoft/TypeScript/issues/47711 -type Either = Left | Right
; -type Left = { tag: 'Left', e: E }; -type Right = { tag: 'Right', a: A }; - -const mkLeft = (e: E): Either => ({ tag: 'Left', e }); -const mkRight = (a: A): Either => ({ tag: 'Right', a }); - -class EPromise implements PromiseLike { - static succeed(a: A): EPromise { - return new EPromise(Promise.resolve(mkRight(a))); - } - - static fail(e: E): EPromise { - return new EPromise(Promise.resolve(mkLeft(e))); - } - - constructor(readonly p: PromiseLike>) { } - - then( - // EPromise can act as a Thenable only when `E` is `never`. - this: EPromise, - onfulfilled?: ((value: A) => B | PromiseLike) | null | undefined, - onrejected?: ((reason: any) => B1 | PromiseLike) | null | undefined - ): PromiseLike { - return this.p.then( - // Casting to `Right` is safe here because we've eliminated the possibility of `Left`. - either => onfulfilled?.((either as Right).a) ?? (either as Right).a as unknown as B, - onrejected - ) - } -} - -const withTypedFailure: EPromise = EPromise.fail(1); - -// Errors as expected: -// -// "The 'this' context of type 'EPromise' is not assignable to method's -// 'this' of type 'EPromise" -withTypedFailure.then(s => s.toUpperCase()).then(console.log); - -async function test() { - await withTypedFailure; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017.ts index 3e7bb364ba5..0b73ba70fc5 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017.ts @@ -1,4 +1,4 @@ -// @target: es2017 +// @target: es2017 async function bar() { !await 42; // OK diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_1.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_1.ts index c3f4cf6da39..27bfa88517d 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_1.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_1.ts @@ -1,4 +1,4 @@ -// @target: es2017 +// @target: es2017 async function bar() { !await 42; // OK diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_2.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_2.ts index 65e0881f846..25b3f40a2df 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_2.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_2.ts @@ -1,4 +1,4 @@ -// @target: es2017 +// @target: es2017 async function bar1() { delete await 42; diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.json b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.json deleted file mode 100644 index 00824ed71d8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 313, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 36, - "end": 40, - "ctxt": 0 - }, - "value": "bar1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 21, - "end": 71, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 71, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 49, - "end": 60, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 49, - "end": 59, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "AwaitExpression", - "span": { - "start": 51, - "end": 59, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 57, - "end": 59, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 88, - "end": 92, - "ctxt": 0 - }, - "value": "bar2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 73, - "end": 123, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 95, - "end": 123, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 101, - "end": 112, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 101, - "end": 111, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "AwaitExpression", - "span": { - "start": 103, - "end": 111, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 109, - "end": 111, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 140, - "end": 144, - "ctxt": 0 - }, - "value": "bar3", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 125, - "end": 218, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 147, - "end": 218, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 153, - "end": 164, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 157, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 169, - "end": 179, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 169, - "end": 178, - "ctxt": 0 - }, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 239, - "ctxt": 0 - }, - "value": "bar4", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 220, - "end": 313, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 242, - "end": 313, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 248, - "end": 259, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 252, - "end": 258, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 252, - "end": 253, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 256, - "end": 258, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 264, - "end": 274, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 264, - "end": 273, - "ctxt": 0 - }, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 270, - "end": 273, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.ts deleted file mode 100644 index 158442a6863..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es2017_3.ts +++ /dev/null @@ -1,19 +0,0 @@ -// @target: es2017 - -async function bar1() { - ++await 42; // Error -} - -async function bar2() { - --await 42; // Error -} - -async function bar3() { - var x = 42; - await x++; // OK but shouldn't need parenthesis -} - -async function bar4() { - var x = 42; - await x--; // OK but shouldn't need parenthesis -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6.ts index cd7b1cee09c..31b01d45a76 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 async function bar() { !await 42; // OK diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_1.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_1.ts index b51362e2f77..c612365b1bd 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_1.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_1.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 async function bar() { !await 42; // OK diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_2.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_2.ts index 762659d60e2..6ce8baa7c2f 100644 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_2.ts +++ b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_2.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 async function bar1() { delete await 42; diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.json b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.json deleted file mode 100644 index 70b63b50eab..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 310, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 33, - "end": 37, - "ctxt": 0 - }, - "value": "bar1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 18, - "end": 68, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 40, - "end": 68, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 46, - "end": 57, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 46, - "end": 56, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "AwaitExpression", - "span": { - "start": 48, - "end": 56, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 54, - "end": 56, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 85, - "end": 89, - "ctxt": 0 - }, - "value": "bar2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 70, - "end": 120, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 92, - "end": 120, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 98, - "end": 109, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 98, - "end": 108, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "AwaitExpression", - "span": { - "start": 100, - "end": 108, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 106, - "end": 108, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 137, - "end": 141, - "ctxt": 0 - }, - "value": "bar3", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 122, - "end": 215, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 215, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 150, - "end": 161, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 154, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 154, - "end": 155, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 158, - "end": 160, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 166, - "end": 176, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 172, - "end": 175, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 232, - "end": 236, - "ctxt": 0 - }, - "value": "bar4", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 217, - "end": 310, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 239, - "end": 310, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 245, - "end": 256, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 249, - "end": 255, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 261, - "end": 271, - "ctxt": 0 - }, - "expression": { - "type": "AwaitExpression", - "span": { - "start": 261, - "end": 270, - "ctxt": 0 - }, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.ts b/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.ts deleted file mode 100644 index d791b6f1752..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/await_unaryExpression_es6_3.ts +++ /dev/null @@ -1,19 +0,0 @@ -// @target: es6 - -async function bar1() { - ++await 42; // Error -} - -async function bar2() { - --await 42; // Error -} - -async function bar3() { - var x = 42; - await x++; // OK but shouldn't need parenthesis -} - -async function bar4() { - var x = 42; - await x--; // OK but shouldn't need parenthesis -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple.ts b/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple.ts index 1f41e556dce..6d5aff974eb 100644 --- a/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple.ts +++ b/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple.ts @@ -1,4 +1,4 @@ -function f1(x: number): string { return "foo"; } +function f1(x: number): string { return "foo"; } function f2(x: number): number { return 10; } diff --git a/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple2.ts b/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple2.ts index 7e4d6338aee..e3487f6bee2 100644 --- a/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple2.ts +++ b/crates/swc_ecma_parser/tests/tsc/bestCommonTypeOfTuple2.ts @@ -1,4 +1,4 @@ -interface base { } +interface base { } interface base1 { i } class C implements base { c } class D implements base { d } diff --git a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteral.ts b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteral.ts index 7a9813e6f4b..a4ba934a82c 100644 --- a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteral.ts +++ b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteral.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; diff --git a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralES6.ts b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralES6.ts index 73b339977f2..84512fce368 100644 --- a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; diff --git a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.json b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.json deleted file mode 100644 index a28e3861bb6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 10, - "end": 126, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 10, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 14, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 14, - "end": 18, - "ctxt": 0 - }, - "value": "bin1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 21, - "end": 26, - "ctxt": 0 - }, - "value": 6.0, - "raw": "0B110" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 32, - "end": 54, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 36, - "end": 48, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 40, - "ctxt": 0 - }, - "value": "bin1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 43, - "end": 48, - "ctxt": 0 - }, - "value": 6.0, - "raw": "0b110" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 56, - "end": 126, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 60, - "end": 125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 60, - "end": 64, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 67, - "end": 125, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 73, - "end": 80, - "ctxt": 0 - }, - "value": 26.0, - "raw": "0b11010" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 82, - "end": 86, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 92, - "end": 94, - "ctxt": 0 - }, - "value": 26.0, - "raw": "26" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 96, - "end": 103, - "ctxt": 0 - }, - "value": "Hello", - "raw": "\"Hello\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 109, - "end": 113, - "ctxt": 0 - }, - "value": "26", - "raw": "\"26\"" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 115, - "end": 122, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.ts b/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.ts deleted file mode 100644 index fdc8b54bebc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/binaryIntegerLiteralError.ts +++ /dev/null @@ -1,9 +0,0 @@ -// error -var bin1 = 0B1102110; -var bin1 = 0b11023410; - -var obj1 = { - 0b11010: "hi", - 26: "Hello", - "26": "world", -}; diff --git a/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.json b/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.json deleted file mode 100644 index cf8e0fc86da..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.json +++ /dev/null @@ -1,2467 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 60, - "end": 1238, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 60, - "end": 73, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 64, - "end": 72, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 64, - "end": 67, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 67, - "end": 72, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 74, - "end": 83, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 78, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 78, - "end": 82, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 84, - "end": 111, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 88, - "end": 110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 88, - "end": 92, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 92, - "end": 99, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 94, - "end": 99, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 94, - "end": 97, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 102, - "end": 110, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 103, - "end": 105, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 107, - "end": 109, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 116, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 116, - "end": 119, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 127, - "end": 129, - "ctxt": 0 - }, - "members": [] - } - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 130, - "end": 163, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 134, - "end": 162, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 134, - "end": 138, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 141, - "end": 162, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 143, - "end": 144, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 145, - "end": 147, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 152, - "end": 161, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 165, - "end": 213, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 185, - "end": 213, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 202, - "end": 211, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 209, - "end": 210, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 184, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 220, - "end": 221, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 214, - "end": 302, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 228, - "end": 242, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 236, - "end": 241, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 247, - "end": 300, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 254, - "end": 257, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 247, - "end": 300, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 260, - "end": 300, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 270, - "end": 276, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 285, - "end": 294, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 303, - "end": 338, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 312, - "end": 338, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 318, - "end": 336, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 325, - "end": 336, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 329, - "end": 335, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 330, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 332, - "end": 335, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 339, - "end": 358, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 343, - "end": 357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 343, - "end": 347, - "ctxt": 0 - }, - "value": "objA", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 350, - "end": 357, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 382, - "end": 409, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 386, - "end": 408, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 386, - "end": 400, - "ctxt": 0 - }, - "value": "ResultIsNumber", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 403, - "end": 408, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 404, - "end": 408, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 410, - "end": 438, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 414, - "end": 437, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 414, - "end": 429, - "ctxt": 0 - }, - "value": "ResultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 432, - "end": 437, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 433, - "end": 437, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 439, - "end": 464, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 443, - "end": 463, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 443, - "end": 458, - "ctxt": 0 - }, - "value": "ResultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 461, - "end": 463, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 465, - "end": 490, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 469, - "end": 489, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 469, - "end": 484, - "ctxt": 0 - }, - "value": "ResultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 487, - "end": 489, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 488, - "end": 489, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 491, - "end": 518, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 495, - "end": 517, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 495, - "end": 510, - "ctxt": 0 - }, - "value": "ResultIsNumber4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 513, - "end": 517, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 514, - "end": 517, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 519, - "end": 547, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 523, - "end": 546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 523, - "end": 538, - "ctxt": 0 - }, - "value": "ResultIsNumber5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 541, - "end": 546, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 542, - "end": 546, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 569, - "end": 602, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 573, - "end": 601, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 573, - "end": 588, - "ctxt": 0 - }, - "value": "ResultIsNumber6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 591, - "end": 601, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 592, - "end": 601, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 603, - "end": 631, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 607, - "end": 630, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 607, - "end": 622, - "ctxt": 0 - }, - "value": "ResultIsNumber7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 625, - "end": 630, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "NullLiteral", - "span": { - "start": 626, - "end": 630, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 657, - "end": 687, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 661, - "end": 687, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 661, - "end": 676, - "ctxt": 0 - }, - "value": "ResultIsNumber8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 679, - "end": 687, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 680, - "end": 687, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 680, - "end": 684, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 684, - "end": 687, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 685, - "end": 686, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 688, - "end": 718, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 692, - "end": 717, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 692, - "end": 707, - "ctxt": 0 - }, - "value": "ResultIsNumber9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 710, - "end": 717, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 711, - "end": 717, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 711, - "end": 715, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 716, - "end": 717, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 719, - "end": 750, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 723, - "end": 749, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 723, - "end": 739, - "ctxt": 0 - }, - "value": "ResultIsNumber10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 742, - "end": 749, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 743, - "end": 749, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 743, - "end": 747, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 751, - "end": 782, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 755, - "end": 781, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 755, - "end": 771, - "ctxt": 0 - }, - "value": "ResultIsNumber11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 774, - "end": 781, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 775, - "end": 781, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 775, - "end": 779, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 780, - "end": 781, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 783, - "end": 811, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 787, - "end": 810, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 787, - "end": 803, - "ctxt": 0 - }, - "value": "ResultIsNumber12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 806, - "end": 810, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 807, - "end": 810, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 807, - "end": 808, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 809, - "end": 810, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 812, - "end": 842, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 816, - "end": 841, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 816, - "end": 832, - "ctxt": 0 - }, - "value": "ResultIsNumber13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 835, - "end": 841, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "CallExpression", - "span": { - "start": 836, - "end": 841, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 836, - "end": 839, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 843, - "end": 875, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 847, - "end": 874, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 847, - "end": 863, - "ctxt": 0 - }, - "value": "ResultIsNumber14", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 866, - "end": 874, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "CallExpression", - "span": { - "start": 867, - "end": 874, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 867, - "end": 872, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 867, - "end": 868, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 869, - "end": 872, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 876, - "end": 913, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 880, - "end": 912, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 880, - "end": 896, - "ctxt": 0 - }, - "value": "ResultIsNumber15", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 899, - "end": 912, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 900, - "end": 912, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 901, - "end": 911, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 901, - "end": 904, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 907, - "end": 911, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 914, - "end": 957, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 918, - "end": 956, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 918, - "end": 934, - "ctxt": 0 - }, - "value": "ResultIsNumber16", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 937, - "end": 956, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 938, - "end": 956, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 939, - "end": 955, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 939, - "end": 943, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 946, - "end": 955, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 958, - "end": 996, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 962, - "end": 995, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 962, - "end": 978, - "ctxt": 0 - }, - "value": "ResultIsNumber17", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 981, - "end": 995, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 982, - "end": 995, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 983, - "end": 994, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 983, - "end": 987, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 990, - "end": 994, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 997, - "end": 1045, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1001, - "end": 1044, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1001, - "end": 1017, - "ctxt": 0 - }, - "value": "ResultIsNumber18", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 1020, - "end": 1044, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1021, - "end": 1044, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1022, - "end": 1043, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1031, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1034, - "end": 1043, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1071, - "end": 1100, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1075, - "end": 1099, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1075, - "end": 1091, - "ctxt": 0 - }, - "value": "ResultIsNumber19", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 1094, - "end": 1099, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1095, - "end": 1099, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 1096, - "end": 1099, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1101, - "end": 1140, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1105, - "end": 1139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1105, - "end": 1121, - "ctxt": 0 - }, - "value": "ResultIsNumber20", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 1124, - "end": 1139, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1125, - "end": 1139, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1126, - "end": 1139, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1127, - "end": 1139, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1128, - "end": 1138, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1128, - "end": 1131, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1134, - "end": 1138, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1170, - "end": 1175, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1170, - "end": 1174, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 1171, - "end": 1174, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1176, - "end": 1182, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1176, - "end": 1181, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 1177, - "end": 1181, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1183, - "end": 1192, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1183, - "end": 1191, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1184, - "end": 1191, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1184, - "end": 1188, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1188, - "end": 1191, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1189, - "end": 1190, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1193, - "end": 1204, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 1193, - "end": 1203, - "ctxt": 0 - }, - "expressions": [ - { - "type": "UnaryExpression", - "span": { - "start": 1193, - "end": 1197, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "Identifier", - "span": { - "start": 1194, - "end": 1197, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - }, - { - "type": "Identifier", - "span": { - "start": 1199, - "end": 1203, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1205, - "end": 1213, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1205, - "end": 1212, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1206, - "end": 1212, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1206, - "end": 1210, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1211, - "end": 1212, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1214, - "end": 1222, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1214, - "end": 1221, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1215, - "end": 1221, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1215, - "end": 1219, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1220, - "end": 1221, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1223, - "end": 1228, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1223, - "end": 1227, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1224, - "end": 1227, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1224, - "end": 1225, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1227, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1229, - "end": 1238, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1229, - "end": 1237, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1230, - "end": 1237, - "ctxt": 0 - }, - "operator": "~", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1231, - "end": 1237, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1231, - "end": 1235, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1236, - "end": 1237, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.ts b/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.ts deleted file mode 100644 index 115706d5d37..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/bitwiseNotOperatorWithAnyOtherType.ts +++ /dev/null @@ -1,64 +0,0 @@ -// @allowUnreachableCode: true - -// ~ operator on any type - -var ANY: any; -var ANY1; -var ANY2: any[] = ["", ""]; -var obj: () => {} -var obj1 = { x:"", y: () => { }}; - -function foo(): any { - var a; - return a; -} -class A { - public a: any; - static foo() { - var a; - return a; - } -} -module M { - export var n: any; -} -var objA = new A(); - -// any other type var -var ResultIsNumber = ~ANY1; -var ResultIsNumber1 = ~ANY2; -var ResultIsNumber2 = ~A; -var ResultIsNumber3 = ~M; -var ResultIsNumber4 = ~obj; -var ResultIsNumber5 = ~obj1; - -// any type literal -var ResultIsNumber6 = ~undefined; -var ResultIsNumber7 = ~null; - -// any type expressions -var ResultIsNumber8 = ~ANY2[0] -var ResultIsNumber9 = ~obj1.x; -var ResultIsNumber10 = ~obj1.y; -var ResultIsNumber11 = ~objA.a; -var ResultIsNumber12 = ~M.n; -var ResultIsNumber13 = ~foo(); -var ResultIsNumber14 = ~A.foo(); -var ResultIsNumber15 = ~(ANY + ANY1); -var ResultIsNumber16 = ~(null + undefined); -var ResultIsNumber17 = ~(null + null); -var ResultIsNumber18 = ~(undefined + undefined); - -// multiple ~ operators -var ResultIsNumber19 = ~~ANY; -var ResultIsNumber20 = ~~~(ANY + ANY1); - -//miss assignment operators -~ANY; -~ANY1; -~ANY2[0]; -~ANY, ANY1; -~obj1.y; -~objA.a; -~M.n; -~~obj1.x; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.json b/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.json new file mode 100644 index 00000000000..a6973369031 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.json @@ -0,0 +1,757 @@ +{ + "type": "Module", + "span": { + "start": 135, + "end": 733, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 135, + "end": 180, + "ctxt": 0 + }, + "kind": "var", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 147, + "end": 179, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 147, + "end": 154, + "ctxt": 0 + }, + "value": "require", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 154, + "end": 179, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 156, + "end": 179, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 157, + "end": 171, + "ctxt": 0 + }, + "rest": { + "start": 157, + "end": 160, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 160, + "end": 164, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 164, + "end": 171, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 166, + "end": 171, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 166, + "end": 169, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 173, + "end": 179, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 176, + "end": 179, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 210, + "end": 308, + "ctxt": 0 + }, + "declare": true, + "global": false, + "id": { + "type": "StringLiteral", + "span": { + "start": 225, + "end": 229, + "ctxt": 0 + }, + "value": "fs", + "raw": "\"fs\"" + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 230, + "end": 308, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 236, + "end": 306, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 252, + "end": 264, + "ctxt": 0 + }, + "value": "readFileSync", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 265, + "end": 277, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 265, + "end": 277, + "ctxt": 0 + }, + "value": "path", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 269, + "end": 277, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 271, + "end": 277, + "ctxt": 0 + }, + "kind": "string" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 279, + "end": 296, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 279, + "end": 296, + "ctxt": 0 + }, + "value": "encoding", + "optional": true, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 288, + "end": 296, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 290, + "end": 296, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 243, + "end": 306, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 297, + "end": 305, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 299, + "end": 305, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 309, + "end": 457, + "ctxt": 0 + }, + "declare": true, + "global": false, + "id": { + "type": "StringLiteral", + "span": { + "start": 324, + "end": 330, + "ctxt": 0 + }, + "value": "path", + "raw": "\"path\"" + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 331, + "end": 457, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 337, + "end": 363, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 344, + "end": 346, + "ctxt": 0 + }, + "value": "fs", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 349, + "end": 362, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 357, + "end": 361, + "ctxt": 0 + }, + "value": "fs", + "raw": "\"fs\"" + } + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 374, + "end": 430, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 384, + "end": 388, + "ctxt": 0 + }, + "value": "path", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 389, + "end": 430, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 399, + "end": 424, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 406, + "end": 424, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 412, + "end": 423, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 412, + "end": 415, + "ctxt": 0 + }, + "value": "sep", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 415, + "end": 423, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 417, + "end": 423, + "ctxt": 0 + }, + "kind": "string" + } + } + }, + "init": null, + "definite": false + } + ] + } + } + ] + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 435, + "end": 449, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 444, + "end": 448, + "ctxt": 0 + }, + "value": "path", + "optional": false + } + } + ] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 484, + "end": 505, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 499, + "end": 504, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 506, + "end": 520, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 506, + "end": 519, + "ctxt": 0 + }, + "callee": { + "type": "Import", + "span": { + "start": 506, + "end": 512, + "ctxt": 0 + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 513, + "end": 518, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 521, + "end": 546, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 527, + "end": 545, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 527, + "end": 528, + "ctxt": 0 + }, + "value": "_", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 531, + "end": 545, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 531, + "end": 538, + "ctxt": 0 + }, + "value": "require", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 539, + "end": 544, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 564, + "end": 568, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 564, + "end": 567, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 564, + "end": 565, + "ctxt": 0 + }, + "value": "_", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 566, + "end": 567, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 600, + "end": 621, + "ctxt": 0 + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "span": { + "start": 615, + "end": 620, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 622, + "end": 648, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 629, + "end": 630, + "ctxt": 0 + }, + "value": "_", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 633, + "end": 647, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 641, + "end": 646, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + } + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 658, + "end": 670, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 667, + "end": 669, + "ctxt": 0 + }, + "properties": [] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 680, + "end": 690, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 712, + "end": 733, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 719, + "end": 733, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 725, + "end": 732, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 725, + "end": 726, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 729, + "end": 732, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + }, + "definite": false + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.ts b/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.ts new file mode 100644 index 00000000000..5bdd94d1bef --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/bundlerSyntaxRestrictions.ts @@ -0,0 +1,34 @@ +// @moduleResolution: bundler +// @checkJs: true +// @allowJs: true +// @outDir: out + +// @Filename: /node_modules/@types/node/index.d.ts +declare var require: (...args: any[]) => any; + +// @Filename: /ambient.d.ts +declare module "fs" { + export function readFileSync(path: string, encoding?: string): string; +} +declare module "path" { + import fs = require("fs"); // ok + namespace path { + export const sep: string; + } + export = path; // ok +} + +// @Filename: /mainJs.js +import {} from "./a"; +import("./a"); +const _ = require("./a"); // No resolution +_.a; // any + +// @Filename: /main.ts +import {} from "./a"; +import _ = require("./a"); // Error +export = {}; // Error +export {}; + +// @Filename: /a.ts +export const a = "a"; diff --git a/crates/swc_ecma_parser/tests/tsc/castingTuple.ts b/crates/swc_ecma_parser/tests/tsc/castingTuple.ts index 13e17897dcc..2ffc22ff34c 100644 --- a/crates/swc_ecma_parser/tests/tsc/castingTuple.ts +++ b/crates/swc_ecma_parser/tests/tsc/castingTuple.ts @@ -1,4 +1,4 @@ -interface I { } +interface I { } class A { a = 10; } class C implements I { c }; class D implements I { d }; diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocOptionalParamOrder.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocOptionalParamOrder.ts index f62fd06fcc6..700c2492dfd 100644 --- a/crates/swc_ecma_parser/tests/tsc/checkJsdocOptionalParamOrder.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocOptionalParamOrder.ts @@ -1,4 +1,4 @@ -// @allowJS: true +// @allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocParamTag1.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocParamTag1.ts index 0f5ca7ef1e3..b3273e0d6be 100644 --- a/crates/swc_ecma_parser/tests/tsc/checkJsdocParamTag1.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocParamTag1.ts @@ -1,4 +1,4 @@ -// @allowJS: true +// @allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.json new file mode 100644 index 00000000000..421d659e453 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.json @@ -0,0 +1,664 @@ +{ + "type": "Script", + "span": { + "start": 298, + "end": 769, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 298, + "end": 343, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 304, + "end": 342, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 304, + "end": 306, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 332, + "end": 342, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 333, + "end": 341, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 335, + "end": 336, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 338, + "end": 339, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 344, + "end": 395, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 350, + "end": 394, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 350, + "end": 352, + "ctxt": 0 + }, + "value": "t2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 378, + "end": 394, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 379, + "end": 393, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 381, + "end": 382, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 384, + "end": 385, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 387, + "end": 388, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 390, + "end": 391, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 396, + "end": 435, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 402, + "end": 434, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 402, + "end": 404, + "ctxt": 0 + }, + "value": "t3", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 430, + "end": 434, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 431, + "end": 433, + "ctxt": 0 + }, + "properties": [] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 455, + "end": 502, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 461, + "end": 501, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 461, + "end": 463, + "ctxt": 0 + }, + "value": "t4", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 489, + "end": 501, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 490, + "end": 500, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 492, + "end": 493, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 495, + "end": 498, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 541, + "end": 598, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 547, + "end": 597, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 547, + "end": 549, + "ctxt": 0 + }, + "value": "t5", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 574, + "end": 597, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 575, + "end": 596, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 576, + "end": 577, + "ctxt": 0 + }, + "value": "m", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 582, + "end": 596, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 582, + "end": 593, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 582, + "end": 583, + "ctxt": 0 + }, + "value": "m", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 584, + "end": 593, + "ctxt": 0 + }, + "value": "substring", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 594, + "end": 595, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 599, + "end": 656, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 605, + "end": 655, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 605, + "end": 607, + "ctxt": 0 + }, + "value": "t6", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 647, + "end": 655, + "ctxt": 0 + }, + "expression": { + "type": "ArrayExpression", + "span": { + "start": 648, + "end": 654, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 649, + "end": 650, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 652, + "end": 653, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 657, + "end": 707, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 663, + "end": 706, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 663, + "end": 665, + "ctxt": 0 + }, + "value": "t7", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 691, + "end": 706, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 692, + "end": 705, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 694, + "end": 695, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 697, + "end": 703, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 708, + "end": 769, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 714, + "end": 768, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 714, + "end": 716, + "ctxt": 0 + }, + "value": "t8", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 742, + "end": 768, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 743, + "end": 767, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 745, + "end": 746, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 748, + "end": 754, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 756, + "end": 757, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 759, + "end": 765, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.ts new file mode 100644 index 00000000000..804f1e7d029 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag1.ts @@ -0,0 +1,37 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js + +/** + * @typedef {Object} T1 + * @property {number} a + */ + +/** + * @typedef {Object} T2 + * @property {"a" | "b"} a + */ + +/** + * @typedef {(x: string) => string} T3 + */ + +/** + * @typedef {Object} T4 + * @property {string} a + */ + +const t1 = /** @satisfies {T1} */ ({ a: 1 }); +const t2 = /** @satisfies {T1} */ ({ a: 1, b: 1 }); +const t3 = /** @satisfies {T1} */ ({}); + +/** @type {T2} */ +const t4 = /** @satisfies {T2} */ ({ a: "a" }); + +/** @type {(m: string) => string} */ +const t5 = /** @satisfies {T3} */((m) => m.substring(0)); +const t6 = /** @satisfies {[number, number]} */ ([1, 2]); +const t7 = /** @satisfies {T4} */ ({ a: 'test' }); +const t8 = /** @satisfies {T4} */ ({ a: 'test', b: 'test' }); diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.json similarity index 55% rename from crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.json rename to crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.json index 47083711441..2dca96f374a 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.json +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.json @@ -1,118 +1,16 @@ { "type": "Script", "span": { - "start": 1, - "end": 327, + "start": 121, + "end": 433, "ctxt": 0 }, "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 10, - "ctxt": 0 - }, - "value": "Keys", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 13, - "end": 34, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 13, - "end": 16, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 13, - "end": 16, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "value": "d", - "raw": "'d'" - } - } - ] - } - }, { "type": "VariableDeclaration", "span": { - "start": 37, - "end": 155, + "start": 121, + "end": 260, "ctxt": 0 }, "kind": "const", @@ -121,15 +19,15 @@ { "type": "VariableDeclarator", "span": { - "start": 43, - "end": 154, + "start": 127, + "end": 259, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 43, - "end": 44, + "start": 127, + "end": 128, "ctxt": 0 }, "value": "p", @@ -137,17 +35,17 @@ "typeAnnotation": null }, "init": { - "type": "TsSatisfiesExpression", + "type": "ParenthesisExpression", "span": { - "start": 47, - "end": 154, + "start": 182, + "end": 259, "ctxt": 0 }, "expression": { "type": "ObjectExpression", "span": { - "start": 47, - "end": 122, + "start": 183, + "end": 258, "ctxt": 0 }, "properties": [ @@ -156,8 +54,8 @@ "key": { "type": "Identifier", "span": { - "start": 53, - "end": 54, + "start": 189, + "end": 190, "ctxt": 0 }, "value": "a", @@ -166,8 +64,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 56, - "end": 57, + "start": 192, + "end": 193, "ctxt": 0 }, "value": 0.0, @@ -179,8 +77,8 @@ "key": { "type": "Identifier", "span": { - "start": 63, - "end": 64, + "start": 199, + "end": 200, "ctxt": 0 }, "value": "b", @@ -189,8 +87,8 @@ "value": { "type": "StringLiteral", "span": { - "start": 66, - "end": 73, + "start": 202, + "end": 209, "ctxt": 0 }, "value": "hello", @@ -202,8 +100,8 @@ "key": { "type": "Identifier", "span": { - "start": 79, - "end": 80, + "start": 215, + "end": 216, "ctxt": 0 }, "value": "x", @@ -212,8 +110,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 82, - "end": 83, + "start": 218, + "end": 219, "ctxt": 0 }, "value": 8.0, @@ -221,62 +119,6 @@ } } ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 133, - "end": 154, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "value": "Record", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 139, - "end": 154, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 140, - "end": 144, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 140, - "end": 144, - "ctxt": 0 - }, - "value": "Keys", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 146, - "end": 153, - "ctxt": 0 - }, - "kind": "unknown" - } - ] - } } }, "definite": false @@ -286,8 +128,8 @@ { "type": "VariableDeclaration", "span": { - "start": 221, - "end": 243, + "start": 326, + "end": 348, "ctxt": 0 }, "kind": "let", @@ -296,15 +138,15 @@ { "type": "VariableDeclarator", "span": { - "start": 225, - "end": 242, + "start": 330, + "end": 347, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 225, - "end": 226, + "start": 330, + "end": 331, "ctxt": 0 }, "value": "a", @@ -314,29 +156,29 @@ "init": { "type": "CallExpression", "span": { - "start": 229, - "end": 242, + "start": 334, + "end": 347, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 229, - "end": 240, + "start": 334, + "end": 345, "ctxt": 0 }, "object": { "type": "MemberExpression", "span": { - "start": 229, - "end": 232, + "start": 334, + "end": 337, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 229, - "end": 230, + "start": 334, + "end": 335, "ctxt": 0 }, "value": "p", @@ -345,8 +187,8 @@ "property": { "type": "Identifier", "span": { - "start": 231, - "end": 232, + "start": 336, + "end": 337, "ctxt": 0 }, "value": "a", @@ -356,8 +198,8 @@ "property": { "type": "Identifier", "span": { - "start": 233, - "end": 240, + "start": 338, + "end": 345, "ctxt": 0 }, "value": "toFixed", @@ -374,8 +216,8 @@ { "type": "VariableDeclaration", "span": { - "start": 244, - "end": 269, + "start": 349, + "end": 374, "ctxt": 0 }, "kind": "let", @@ -384,15 +226,15 @@ { "type": "VariableDeclarator", "span": { - "start": 248, - "end": 268, + "start": 353, + "end": 373, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 248, - "end": 249, + "start": 353, + "end": 354, "ctxt": 0 }, "value": "b", @@ -402,29 +244,29 @@ "init": { "type": "CallExpression", "span": { - "start": 252, - "end": 268, + "start": 357, + "end": 373, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 252, - "end": 265, + "start": 357, + "end": 370, "ctxt": 0 }, "object": { "type": "MemberExpression", "span": { - "start": 252, - "end": 255, + "start": 357, + "end": 360, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 252, - "end": 253, + "start": 357, + "end": 358, "ctxt": 0 }, "value": "p", @@ -433,8 +275,8 @@ "property": { "type": "Identifier", "span": { - "start": 254, - "end": 255, + "start": 359, + "end": 360, "ctxt": 0 }, "value": "b", @@ -444,8 +286,8 @@ "property": { "type": "Identifier", "span": { - "start": 256, - "end": 265, + "start": 361, + "end": 370, "ctxt": 0 }, "value": "substring", @@ -458,8 +300,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 266, - "end": 267, + "start": 371, + "end": 372, "ctxt": 0 }, "value": 1.0, @@ -476,8 +318,8 @@ { "type": "VariableDeclaration", "span": { - "start": 315, - "end": 327, + "start": 421, + "end": 433, "ctxt": 0 }, "kind": "let", @@ -486,15 +328,15 @@ { "type": "VariableDeclarator", "span": { - "start": 319, - "end": 326, + "start": 425, + "end": 432, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 319, - "end": 320, + "start": 425, + "end": 426, "ctxt": 0 }, "value": "d", @@ -504,15 +346,15 @@ "init": { "type": "MemberExpression", "span": { - "start": 323, - "end": 326, + "start": 429, + "end": 432, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 323, - "end": 324, + "start": 429, + "end": 430, "ctxt": 0 }, "value": "p", @@ -521,8 +363,8 @@ "property": { "type": "Identifier", "span": { - "start": 325, - "end": 326, + "start": 431, + "end": 432, "ctxt": 0 }, "value": "d", diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.ts similarity index 56% rename from crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.ts rename to crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.ts index e344bcfbff2..991888b6c57 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propertyNameFulfillment.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag10.ts @@ -1,13 +1,19 @@ -type Keys = 'a' | 'b' | 'c' | 'd'; +// @noEmit: true +// @allowJS: true +// @checkJs: true -const p = { +// @filename: /a.js +/** @typedef {"a" | "b" | "c" | "d"} Keys */ + +const p = /** @satisfies {Partial>} */ ({ a: 0, b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' -} satisfies Record; +}); // Should be OK -- retain info that a is number and b is string let a = p.a.toFixed(); let b = p.b.substring(1); + // Should error even though 'd' is in 'Keys' let d = p.d; diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.json new file mode 100644 index 00000000000..181c2520ec9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.json @@ -0,0 +1,126 @@ +{ + "type": "Script", + "span": { + "start": 235, + "end": 330, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 235, + "end": 255, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 241, + "end": 254, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 241, + "end": 243, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 246, + "end": 254, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 248, + "end": 249, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 251, + "end": 252, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 288, + "end": 330, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 294, + "end": 329, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 294, + "end": 296, + "ctxt": 0 + }, + "value": "t2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 326, + "end": 329, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 327, + "end": 328, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.ts new file mode 100644 index 00000000000..694bc1601e4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag11.ts @@ -0,0 +1,25 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** + * @typedef {Object} T1 + * @property {number} a + */ + +/** + * @typedef {Object} T2 + * @property {number} a + */ + +/** + * @satisfies {T1} + * @satisfies {T2} + */ +const t1 = { a: 1 }; + +/** + * @satisfies {number} + */ +const t2 = /** @satisfies {number} */ (1); diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.json new file mode 100644 index 00000000000..4067145c481 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.json @@ -0,0 +1,541 @@ +{ + "type": "Script", + "span": { + "start": 276, + "end": 675, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 276, + "end": 296, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 282, + "end": 295, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 282, + "end": 284, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 287, + "end": 295, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 289, + "end": 290, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 292, + "end": 293, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 325, + "end": 351, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 331, + "end": 350, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 331, + "end": 333, + "ctxt": 0 + }, + "value": "t2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 336, + "end": 350, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 338, + "end": 339, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 344, + "end": 345, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 347, + "end": 348, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 380, + "end": 394, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 386, + "end": 393, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 386, + "end": 388, + "ctxt": 0 + }, + "value": "t3", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 391, + "end": 393, + "ctxt": 0 + }, + "properties": [] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 443, + "end": 461, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 449, + "end": 460, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 449, + "end": 451, + "ctxt": 0 + }, + "value": "t4", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrayExpression", + "span": { + "start": 454, + "end": 460, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 455, + "end": 456, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 458, + "end": 459, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 490, + "end": 515, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 496, + "end": 514, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 496, + "end": 498, + "ctxt": 0 + }, + "value": "t5", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 501, + "end": 514, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 503, + "end": 504, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 506, + "end": 512, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 544, + "end": 580, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 550, + "end": 579, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 550, + "end": 552, + "ctxt": 0 + }, + "value": "t6", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 555, + "end": 579, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 557, + "end": 558, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 560, + "end": 566, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 568, + "end": 569, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 571, + "end": 577, + "ctxt": 0 + }, + "value": "test", + "raw": "'test'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 609, + "end": 631, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 615, + "end": 630, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 615, + "end": 617, + "ctxt": 0 + }, + "value": "t7", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 620, + "end": 630, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 622, + "end": 623, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 625, + "end": 628, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 660, + "end": 675, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 666, + "end": 674, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 666, + "end": 668, + "ctxt": 0 + }, + "value": "t8", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 671, + "end": 674, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 672, + "end": 673, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.ts new file mode 100644 index 00000000000..e8e6ad971fb --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag12.ts @@ -0,0 +1,56 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** + * @typedef {Object} T1 + * @property {number} a + */ + +/** + * @typedef {Object} T2 + * @property {string} a + */ + +/** + * @typedef {Object} T3 + * @property {"a" | "b"} a + */ + +/** + * @satisfies {T1} + */ +const t1 = { a: 1 }; + +/** + * @satisfies {T1} + */ +const t2 = { a: 1, b: 1 }; + +/** + * @satisfies {T1} + */ +const t3 = {}; + +/** + * @satisfies {Array.} + */ +const t4 = [1, 2]; + +/** + * @satisfies {T2} + */ +const t5 = { a: 'test' }; + +/** + * @satisfies {T2} + */ +const t6 = { a: 'test', b: 'test' }; + +/** + * @satisfies {T3} + */ +const t7 = { a: "a" }; + +/** @satisfies {string} */ const t8 = (1); diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.json new file mode 100644 index 00000000000..883a172c4d1 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.json @@ -0,0 +1,194 @@ +{ + "type": "Script", + "span": { + "start": 125, + "end": 255, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 125, + "end": 164, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 131, + "end": 163, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 131, + "end": 133, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 136, + "end": 163, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 138, + "end": 139, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 141, + "end": 161, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 141, + "end": 142, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 146, + "end": 161, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 146, + "end": 159, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "value": "s", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 148, + "end": 159, + "ctxt": 0 + }, + "value": "toLowerCase", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 230, + "end": 255, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 236, + "end": 254, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 236, + "end": 238, + "ctxt": 0 + }, + "value": "t2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 241, + "end": 254, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 243, + "end": 244, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 246, + "end": 252, + "ctxt": 0 + }, + "value": "oops", + "raw": "\"oops\"" + } + } + ] + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.ts new file mode 100644 index 00000000000..b022eab234f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag13.ts @@ -0,0 +1,11 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js + +/** @satisfies {{ f: (x: string) => string }} */ +const t1 = { f: s => s.toLowerCase() }; // should work + +/** @satisfies {{ f: (x: string) => string }} */ +const t2 = { g: "oops" }; // should error diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.json new file mode 100644 index 00000000000..6d594b1be20 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.json @@ -0,0 +1,149 @@ +{ + "type": "Script", + "span": { + "start": 158, + "end": 222, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 158, + "end": 178, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 164, + "end": 177, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 164, + "end": 166, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 169, + "end": 177, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 171, + "end": 172, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 174, + "end": 175, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 179, + "end": 222, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 185, + "end": 221, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 185, + "end": 187, + "ctxt": 0 + }, + "value": "t2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 211, + "end": 221, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 212, + "end": 220, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 214, + "end": 215, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 217, + "end": 218, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.ts new file mode 100644 index 00000000000..26dbf9565a1 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag14.ts @@ -0,0 +1,16 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js + +/** + * @typedef {Object} T1 + * @property {number} a + */ + +/** + * @satisfies T1 + */ +const t1 = { a: 1 }; +const t2 = /** @satisfies T1 */ ({ a: 1 }); diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.json new file mode 100644 index 00000000000..2c734db066c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.json @@ -0,0 +1,233 @@ +{ + "type": "Script", + "span": { + "start": 145, + "end": 250, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 145, + "end": 250, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 151, + "end": 249, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 151, + "end": 152, + "ctxt": 0 + }, + "value": "p", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 186, + "end": 249, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 187, + "end": 248, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 193, + "end": 199, + "ctxt": 0 + }, + "value": "isEven", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 201, + "end": 217, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 201, + "end": 202, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BinaryExpression", + "span": { + "start": 206, + "end": 217, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "BinaryExpression", + "span": { + "start": 206, + "end": 211, + "ctxt": 0 + }, + "operator": "%", + "left": { + "type": "Identifier", + "span": { + "start": 206, + "end": 207, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 210, + "end": 211, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 216, + "end": 217, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 223, + "end": 228, + "ctxt": 0 + }, + "value": "isOdd", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 230, + "end": 246, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BinaryExpression", + "span": { + "start": 235, + "end": 246, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "BinaryExpression", + "span": { + "start": 235, + "end": 240, + "ctxt": 0 + }, + "operator": "%", + "left": { + "type": "Identifier", + "span": { + "start": 235, + "end": 236, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 239, + "end": 240, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 245, + "end": 246, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.ts new file mode 100644 index 00000000000..4d1d41902bb --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag2.ts @@ -0,0 +1,11 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** @typedef {Object. boolean>} Predicates */ + +const p = /** @satisfies {Predicates} */ ({ + isEven: n => n % 2 === 0, + isOdd: n => n % 2 === 1 +}); diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.json new file mode 100644 index 00000000000..dca2872c0a3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.json @@ -0,0 +1,249 @@ +{ + "type": "Script", + "span": { + "start": 158, + "end": 422, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 158, + "end": 305, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 162, + "end": 304, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 162, + "end": 165, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 237, + "end": 304, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 238, + "end": 303, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 244, + "end": 245, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 246, + "end": 247, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 246, + "end": 247, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 244, + "end": 252, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 249, + "end": 252, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 293, + "end": 294, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 295, + "end": 296, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 295, + "end": 296, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 293, + "end": 301, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 298, + "end": 301, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 408, + "end": 422, + "ctxt": 0 + }, + "expression": { + "type": "ParenthesisExpression", + "span": { + "start": 408, + "end": 422, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 409, + "end": 421, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 411, + "end": 412, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 413, + "end": 414, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 413, + "end": 414, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 411, + "end": 419, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 416, + "end": 419, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.ts new file mode 100644 index 00000000000..6a77a622d18 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag3.ts @@ -0,0 +1,14 @@ +// @strict: true +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** @type {{ f(s: string): void } & Record }} */ +let obj = /** @satisfies {{ g(s: string): void } & Record} */ ({ + f(s) { }, // "incorrect" implicit any on 's' + g(s) { } +}); + +// This needs to not crash (outer node is not expression) +/** @satisfies {{ f(s: string): void }} */ ({ f(x) { } }) diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.json new file mode 100644 index 00000000000..62788bd2929 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.json @@ -0,0 +1,85 @@ +{ + "type": "Module", + "span": { + "start": 151, + "end": 325, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDefaultExpression", + "span": { + "start": 151, + "end": 195, + "ctxt": 0 + }, + "expression": { + "type": "ParenthesisExpression", + "span": { + "start": 190, + "end": 194, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 191, + "end": 193, + "ctxt": 0 + }, + "properties": [] + } + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 275, + "end": 325, + "ctxt": 0 + }, + "expression": { + "type": "ParenthesisExpression", + "span": { + "start": 314, + "end": 324, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 315, + "end": 323, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 317, + "end": 318, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 320, + "end": 321, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.ts new file mode 100644 index 00000000000..e9941cae8a2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag4.ts @@ -0,0 +1,19 @@ +// @noEmit: true +// @module: esnext +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** + * @typedef {Object} Foo + * @property {number} a + */ +export default /** @satisfies {Foo} */ ({}); + +// @filename: /b.js +/** + * @typedef {Object} Foo + * @property {number} a + */ + +export default /** @satisfies {Foo} */ ({ a: 1 }); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.json new file mode 100644 index 00000000000..1dbb4534a78 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.json @@ -0,0 +1,181 @@ +{ + "type": "Script", + "span": { + "start": 135, + "end": 289, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 135, + "end": 289, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 141, + "end": 289, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 141, + "end": 144, + "ctxt": 0 + }, + "value": "car", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 201, + "end": 289, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 202, + "end": 288, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 208, + "end": 213, + "ctxt": 0 + }, + "value": "start", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 208, + "end": 219, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 216, + "end": 219, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 225, + "end": 229, + "ctxt": 0 + }, + "value": "move", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 230, + "end": 231, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 225, + "end": 270, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 233, + "end": 270, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 276, + "end": 280, + "ctxt": 0 + }, + "value": "stop", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 276, + "end": 286, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 283, + "end": 286, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.ts new file mode 100644 index 00000000000..1d93127b1fa --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag5.ts @@ -0,0 +1,14 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** @typedef {{ move(distance: number): void }} Movable */ + +const car = /** @satisfies {Movable & Record} */ ({ + start() { }, + move(d) { + // d should be number + }, + stop() { } +}) diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.json new file mode 100644 index 00000000000..4c40b42f1b1 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.json @@ -0,0 +1,250 @@ +{ + "type": "Script", + "span": { + "start": 212, + "end": 343, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 212, + "end": 271, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 218, + "end": 270, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 218, + "end": 219, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 259, + "end": 270, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 260, + "end": 269, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 262, + "end": 263, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 265, + "end": 267, + "ctxt": 0 + }, + "value": 10.0, + "raw": "10" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 286, + "end": 313, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 286, + "end": 312, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 286, + "end": 297, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 286, + "end": 293, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 298, + "end": 311, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 298, + "end": 309, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 298, + "end": 301, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 298, + "end": 299, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 300, + "end": 301, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 302, + "end": 309, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "typeArguments": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 331, + "end": 343, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 335, + "end": 342, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 335, + "end": 336, + "ctxt": 0 + }, + "value": "p", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 339, + "end": 342, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 339, + "end": 340, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.ts new file mode 100644 index 00000000000..4ac9b087f09 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag6.ts @@ -0,0 +1,19 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** + * @typedef {Object} Point2d + * @property {number} x + * @property {number} y + */ + +// Undesirable behavior today with type annotation +const a = /** @satisfies {Partial} */ ({ x: 10 }); + +// Should OK +console.log(a.x.toFixed()); + +// Should error +let p = a.y; diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.json similarity index 51% rename from crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.json rename to crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.json index c2d6f7dbf8c..b617393f8c8 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.json +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.json @@ -1,118 +1,16 @@ { "type": "Script", "span": { - "start": 1, - "end": 336, + "start": 121, + "end": 423, "ctxt": 0 }, "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 10, - "ctxt": 0 - }, - "value": "Keys", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 13, - "end": 34, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 13, - "end": 16, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 13, - "end": 16, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "value": "d", - "raw": "'d'" - } - } - ] - } - }, { "type": "VariableDeclaration", "span": { - "start": 37, - "end": 164, + "start": 121, + "end": 250, "ctxt": 0 }, "kind": "const", @@ -121,15 +19,15 @@ { "type": "VariableDeclarator", "span": { - "start": 43, - "end": 163, + "start": 127, + "end": 250, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 43, - "end": 44, + "start": 127, + "end": 128, "ctxt": 0 }, "value": "p", @@ -137,17 +35,17 @@ "typeAnnotation": null }, "init": { - "type": "TsSatisfiesExpression", + "type": "ParenthesisExpression", "span": { - "start": 47, - "end": 163, + "start": 173, + "end": 250, "ctxt": 0 }, "expression": { "type": "ObjectExpression", "span": { - "start": 47, - "end": 122, + "start": 174, + "end": 249, "ctxt": 0 }, "properties": [ @@ -156,8 +54,8 @@ "key": { "type": "Identifier", "span": { - "start": 53, - "end": 54, + "start": 180, + "end": 181, "ctxt": 0 }, "value": "a", @@ -166,8 +64,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 56, - "end": 57, + "start": 183, + "end": 184, "ctxt": 0 }, "value": 0.0, @@ -179,8 +77,8 @@ "key": { "type": "Identifier", "span": { - "start": 63, - "end": 64, + "start": 190, + "end": 191, "ctxt": 0 }, "value": "b", @@ -189,8 +87,8 @@ "value": { "type": "StringLiteral", "span": { - "start": 66, - "end": 73, + "start": 193, + "end": 200, "ctxt": 0 }, "value": "hello", @@ -202,8 +100,8 @@ "key": { "type": "Identifier", "span": { - "start": 79, - "end": 80, + "start": 206, + "end": 207, "ctxt": 0 }, "value": "x", @@ -212,8 +110,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 82, - "end": 83, + "start": 209, + "end": 210, "ctxt": 0 }, "value": 8.0, @@ -221,90 +119,6 @@ } } ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 133, - "end": 163, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 133, - "end": 140, - "ctxt": 0 - }, - "value": "Partial", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 140, - "end": 163, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 141, - "end": 162, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 141, - "end": 147, - "ctxt": 0 - }, - "value": "Record", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 147, - "end": 162, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 148, - "end": 152, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 148, - "end": 152, - "ctxt": 0 - }, - "value": "Keys", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "kind": "unknown" - } - ] - } - } - ] - } } }, "definite": false @@ -314,8 +128,8 @@ { "type": "VariableDeclaration", "span": { - "start": 230, - "end": 252, + "start": 316, + "end": 338, "ctxt": 0 }, "kind": "let", @@ -324,15 +138,15 @@ { "type": "VariableDeclarator", "span": { - "start": 234, - "end": 251, + "start": 320, + "end": 337, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 234, - "end": 235, + "start": 320, + "end": 321, "ctxt": 0 }, "value": "a", @@ -342,29 +156,29 @@ "init": { "type": "CallExpression", "span": { - "start": 238, - "end": 251, + "start": 324, + "end": 337, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 238, - "end": 249, + "start": 324, + "end": 335, "ctxt": 0 }, "object": { "type": "MemberExpression", "span": { - "start": 238, - "end": 241, + "start": 324, + "end": 327, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 238, - "end": 239, + "start": 324, + "end": 325, "ctxt": 0 }, "value": "p", @@ -373,8 +187,8 @@ "property": { "type": "Identifier", "span": { - "start": 240, - "end": 241, + "start": 326, + "end": 327, "ctxt": 0 }, "value": "a", @@ -384,8 +198,8 @@ "property": { "type": "Identifier", "span": { - "start": 242, - "end": 249, + "start": 328, + "end": 335, "ctxt": 0 }, "value": "toFixed", @@ -402,8 +216,8 @@ { "type": "VariableDeclaration", "span": { - "start": 253, - "end": 278, + "start": 339, + "end": 364, "ctxt": 0 }, "kind": "let", @@ -412,15 +226,15 @@ { "type": "VariableDeclarator", "span": { - "start": 257, - "end": 277, + "start": 343, + "end": 363, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 257, - "end": 258, + "start": 343, + "end": 344, "ctxt": 0 }, "value": "b", @@ -430,29 +244,29 @@ "init": { "type": "CallExpression", "span": { - "start": 261, - "end": 277, + "start": 347, + "end": 363, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 261, - "end": 274, + "start": 347, + "end": 360, "ctxt": 0 }, "object": { "type": "MemberExpression", "span": { - "start": 261, - "end": 264, + "start": 347, + "end": 350, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 261, - "end": 262, + "start": 347, + "end": 348, "ctxt": 0 }, "value": "p", @@ -461,8 +275,8 @@ "property": { "type": "Identifier", "span": { - "start": 263, - "end": 264, + "start": 349, + "end": 350, "ctxt": 0 }, "value": "b", @@ -472,8 +286,8 @@ "property": { "type": "Identifier", "span": { - "start": 265, - "end": 274, + "start": 351, + "end": 360, "ctxt": 0 }, "value": "substring", @@ -486,8 +300,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 275, - "end": 276, + "start": 361, + "end": 362, "ctxt": 0 }, "value": 1.0, @@ -504,8 +318,8 @@ { "type": "VariableDeclaration", "span": { - "start": 324, - "end": 336, + "start": 411, + "end": 423, "ctxt": 0 }, "kind": "let", @@ -514,15 +328,15 @@ { "type": "VariableDeclarator", "span": { - "start": 328, - "end": 335, + "start": 415, + "end": 422, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 328, - "end": 329, + "start": 415, + "end": 416, "ctxt": 0 }, "value": "d", @@ -532,15 +346,15 @@ "init": { "type": "MemberExpression", "span": { - "start": 332, - "end": 335, + "start": 419, + "end": 422, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 332, - "end": 333, + "start": 419, + "end": 420, "ctxt": 0 }, "value": "p", @@ -549,8 +363,8 @@ "property": { "type": "Identifier", "span": { - "start": 334, - "end": 335, + "start": 421, + "end": 422, "ctxt": 0 }, "value": "d", diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.ts similarity index 57% rename from crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.ts rename to crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.ts index 4745de6e77d..e65ac9c167d 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_propNameConstraining.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag7.ts @@ -1,13 +1,19 @@ -type Keys = 'a' | 'b' | 'c' | 'd'; +// @noEmit: true +// @allowJS: true +// @checkJs: true -const p = { +// @filename: /a.js +/** @typedef {"a" | "b" | "c" | "d"} Keys */ + +const p = /** @satisfies {Record} */ ({ a: 0, b: "hello", x: 8 // Should error, 'x' isn't in 'Keys' -} satisfies Partial>; +}) // Should be OK -- retain info that a is number and b is string let a = p.a.toFixed(); let b = p.b.substring(1); + // Should error even though 'd' is in 'Keys' let d = p.d; diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.json new file mode 100644 index 00000000000..0b64c09e904 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.json @@ -0,0 +1,106 @@ +{ + "type": "Script", + "span": { + "start": 169, + "end": 238, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 169, + "end": 238, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 175, + "end": 238, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 175, + "end": 176, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 205, + "end": 238, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 206, + "end": 237, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 212, + "end": 213, + "ctxt": 0 + }, + "value": "m", + "optional": false + }, + "value": { + "type": "BooleanLiteral", + "span": { + "start": 215, + "end": 219, + "ctxt": 0 + }, + "value": true + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 225, + "end": 226, + "ctxt": 0 + }, + "value": "s", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 228, + "end": 235, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.ts new file mode 100644 index 00000000000..05997240e8d --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag8.ts @@ -0,0 +1,13 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js + +/** @typedef {Object.} Facts */ + +// Should be able to detect a failure here +const x = /** @satisfies {Facts} */ ({ + m: true, + s: "false" +}) diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.json new file mode 100644 index 00000000000..32d8f176e2c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.json @@ -0,0 +1,345 @@ +{ + "type": "Module", + "span": { + "start": 251, + "end": 460, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 251, + "end": 460, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 258, + "end": 460, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 264, + "end": 459, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 264, + "end": 271, + "ctxt": 0 + }, + "value": "Palette", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ParenthesisExpression", + "span": { + "start": 316, + "end": 459, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 317, + "end": 458, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 323, + "end": 328, + "ctxt": 0 + }, + "value": "white", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 330, + "end": 356, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 332, + "end": 333, + "ctxt": 0 + }, + "value": "r", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 335, + "end": 338, + "ctxt": 0 + }, + "value": 255.0, + "raw": "255" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 340, + "end": 341, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 343, + "end": 346, + "ctxt": 0 + }, + "value": 255.0, + "raw": "255" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 348, + "end": 349, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 351, + "end": 354, + "ctxt": 0 + }, + "value": 255.0, + "raw": "255" + } + } + ] + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 362, + "end": 367, + "ctxt": 0 + }, + "value": "black", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 369, + "end": 389, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 371, + "end": 372, + "ctxt": 0 + }, + "value": "r", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 374, + "end": 375, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 377, + "end": 378, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 380, + "end": 381, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 383, + "end": 384, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 386, + "end": 387, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 427, + "end": 431, + "ctxt": 0 + }, + "value": "blue", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 433, + "end": 455, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 435, + "end": 436, + "ctxt": 0 + }, + "value": "r", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 438, + "end": 439, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 441, + "end": 442, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 444, + "end": 445, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 447, + "end": 448, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 450, + "end": 453, + "ctxt": 0 + }, + "value": 255.0, + "raw": "255" + } + } + ] + } + } + ] + } + }, + "definite": false + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.ts new file mode 100644 index 00000000000..c8738f182ec --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocSatisfiesTag9.ts @@ -0,0 +1,18 @@ +// @noEmit: true +// @allowJS: true +// @checkJs: true + +// @filename: /a.js +/** + * @typedef {Object} Color + * @property {number} r + * @property {number} g + * @property {number} b + */ + +// All of these should be Colors, but I only use some of them here. +export const Palette = /** @satisfies {Record} */ ({ + white: { r: 255, g: 255, b: 255 }, + black: { r: 0, g: 0, d: 0 }, // <- oops! 'd' in place of 'b' + blue: { r: 0, g: 0, b: 255 }, +}); diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag1.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag1.ts index 943a7b5fb8e..88ef02b5f79 100644 --- a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag1.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag1.ts @@ -1,4 +1,4 @@ -// @allowJS: true +// @allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag2.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag2.ts index 666f332e2a4..0991e9f075f 100644 --- a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag2.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag2.ts @@ -1,4 +1,4 @@ -// @allowJS: true +// @allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList3.json b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.json similarity index 54% rename from crates/swc_ecma_parser/tests/tsc/parserParameterList3.json rename to crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.json index eb6f55e820a..429702c7a93 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList3.json +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.json @@ -1,8 +1,8 @@ { "type": "Script", "span": { - "start": 1, - "end": 27, + "start": 135, + "end": 264, "ctxt": 0 }, "body": [ @@ -11,8 +11,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 7, - "end": 8, + "start": 141, + "end": 142, "ctxt": 0 }, "value": "C", @@ -20,8 +20,8 @@ }, "declare": false, "span": { - "start": 1, - "end": 27, + "start": 135, + "end": 264, "ctxt": 0 }, "decorators": [], @@ -29,18 +29,18 @@ { "type": "ClassMethod", "span": { - "start": 13, - "end": 25, + "start": 172, + "end": 184, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 13, - "end": 14, + "start": 172, + "end": 175, "ctxt": 0 }, - "value": "F", + "value": "foo", "optional": false }, "function": { @@ -48,39 +48,39 @@ { "type": "Parameter", "span": { - "start": 15, - "end": 17, + "start": 176, + "end": 177, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 15, - "end": 16, + "start": 176, + "end": 177, "ctxt": 0 }, - "value": "A", - "optional": true, + "value": "a", + "optional": false, "typeAnnotation": null } }, { "type": "Parameter", "span": { - "start": 19, - "end": 20, + "start": 179, + "end": 180, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 19, - "end": 20, + "start": 179, + "end": 180, "ctxt": 0 }, - "value": "B", + "value": "b", "optional": false, "typeAnnotation": null } @@ -88,15 +88,61 @@ ], "decorators": [], "span": { - "start": 13, - "end": 25, + "start": 172, + "end": 184, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 22, - "end": 25, + "start": 182, + "end": 184, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 229, + "end": 262, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 229, + "end": 257, + "ctxt": 0 + }, + "value": "methodWithOptionalParameters", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 229, + "end": 262, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 260, + "end": 262, "ctxt": 0 }, "stmts": [] diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.ts new file mode 100644 index 00000000000..2981292ba7e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypeTag7.ts @@ -0,0 +1,16 @@ +// @checkJs: true +// @allowJs: true +// @noEmit: true +// @Filename: test.js + +/** + * @typedef {(a: string, b: number) => void} Foo + */ + +class C { + /** @type {Foo} */ + foo(a, b) {} + + /** @type {(optional?) => void} */ + methodWithOptionalParameters() {} +} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypedefInParamTag1.ts b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypedefInParamTag1.ts index b6c0a455fe9..cc533eaf34d 100644 --- a/crates/swc_ecma_parser/tests/tsc/checkJsdocTypedefInParamTag1.ts +++ b/crates/swc_ecma_parser/tests/tsc/checkJsdocTypedefInParamTag1.ts @@ -1,4 +1,4 @@ -// @allowJS: true +// @allowJS: true // @suppressOutputPathCheck: true // @filename: 0.js diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenCanBeTupleType.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenCanBeTupleType.json deleted file mode 100644 index 0483ca3c3d6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenCanBeTupleType.json +++ /dev/null @@ -1,683 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 103, - "end": 439, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 103, - "end": 128, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "span": { - "start": 110, - "end": 115, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 110, - "end": 115, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 121, - "end": 128, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 130, - "end": 210, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 140, - "end": 159, - "ctxt": 0 - }, - "value": "ResizablePanelProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 160, - "end": 210, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 164, - "end": 208, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 164, - "end": 172, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 208, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 174, - "end": 208, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 175, - "end": 190, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeReference", - "span": { - "start": 175, - "end": 190, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 175, - "end": 180, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 181, - "end": 190, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - } - }, - "typeParams": null - } - }, - { - "type": "TsTupleElement", - "span": { - "start": 192, - "end": 207, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeReference", - "span": { - "start": 192, - "end": 207, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 197, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 198, - "end": 207, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - } - }, - "typeParams": null - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 218, - "end": 232, - "ctxt": 0 - }, - "value": "ResizablePanel", - "optional": false - }, - "declare": false, - "span": { - "start": 212, - "end": 288, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 241, - "end": 256, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 241, - "end": 246, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 247, - "end": 256, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 256, - "end": 285, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 260, - "end": 279, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 260, - "end": 279, - "ctxt": 0 - }, - "value": "ResizablePanelProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 281, - "end": 284, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 290, - "end": 357, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 296, - "end": 357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 296, - "end": 300, - "ctxt": 0 - }, - "value": "test", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 303, - "end": 357, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 304, - "end": 318, - "ctxt": 0 - }, - "value": "ResizablePanel", - "optional": false - }, - "span": { - "start": 303, - "end": 319, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 322, - "end": 329, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 322, - "end": 329, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 329, - "end": 332, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 332, - "end": 339, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 333, - "end": 336, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 332, - "end": 339, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 339, - "end": 340, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 340, - "end": 357, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 342, - "end": 356, - "ctxt": 0 - }, - "value": "ResizablePanel", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 359, - "end": 439, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 365, - "end": 439, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 365, - "end": 372, - "ctxt": 0 - }, - "value": "testErr", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 375, - "end": 439, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 376, - "end": 390, - "ctxt": 0 - }, - "value": "ResizablePanel", - "optional": false - }, - "span": { - "start": 375, - "end": 391, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 391, - "end": 394, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 394, - "end": 401, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 398, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 394, - "end": 401, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 404, - "end": 411, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 405, - "end": 408, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 404, - "end": 411, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 414, - "end": 421, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 415, - "end": 418, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 414, - "end": 421, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 422, - "end": 439, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 424, - "end": 438, - "ctxt": 0 - }, - "value": "ResizablePanel", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty1.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty1.json deleted file mode 100644 index ad46f3b327b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty1.json +++ /dev/null @@ -1,955 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 485, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 232, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 232, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 230, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 230, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 210, - "end": 230, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsTypeReference", - "span": { - "start": 219, - "end": 230, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 219, - "end": 222, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 223, - "end": 230, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 243, - "end": 247, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 249, - "end": 255, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 234, - "end": 289, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 257, - "end": 289, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 263, - "end": 287, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 270, - "end": 286, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 271, - "end": 274, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 276, - "end": 279, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 280, - "end": 286, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 282, - "end": 285, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 297, - "end": 344, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 301, - "end": 343, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 301, - "end": 302, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 305, - "end": 343, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 306, - "end": 310, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 305, - "end": 343, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 311, - "end": 317, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 313, - "end": 317, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 314, - "end": 316, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 318, - "end": 324, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 319, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 320, - "end": 324, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 325, - "end": 340, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 325, - "end": 333, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 335, - "end": 340, - "ctxt": 0 - }, - "value": "lol", - "raw": "\"lol\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 345, - "end": 409, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 349, - "end": 408, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 349, - "end": 351, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 358, - "end": 408, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 359, - "end": 363, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 358, - "end": 378, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 364, - "end": 365, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 367, - "end": 369, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 371, - "end": 377, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 371, - "end": 372, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 373, - "end": 377, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 378, - "end": 401, - "ctxt": 0 - }, - "value": "\n\n hi hi hi!\n\n ", - "raw": "\n\n hi hi hi!\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 401, - "end": 408, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 403, - "end": 407, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 410, - "end": 485, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 414, - "end": 484, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 414, - "end": 416, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 423, - "end": 484, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 424, - "end": 428, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 423, - "end": 443, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 429, - "end": 435, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 429, - "end": 430, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 431, - "end": 435, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 432, - "end": 434, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 436, - "end": 442, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 436, - "end": 437, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 438, - "end": 442, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 443, - "end": 452, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 452, - "end": 472, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 453, - "end": 456, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 452, - "end": 457, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 457, - "end": 466, - "ctxt": 0 - }, - "value": "hi hi hi!", - "raw": "hi hi hi!" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 466, - "end": 472, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 468, - "end": 471, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 472, - "end": 477, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 477, - "end": 484, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 479, - "end": 483, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty10.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty10.json deleted file mode 100644 index c435f9bcc8b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty10.json +++ /dev/null @@ -1,1310 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 526, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 204, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 204, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 120, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 122, - "end": 131, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 129, - "end": 131, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 135, - "end": 202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 145, - "end": 162, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 163, - "end": 202, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 177, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 176, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 176, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 188, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 182, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 182, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 191, - "end": 199, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 191, - "end": 193, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 193, - "end": 198, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 206, - "end": 292, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 222, - "end": 231, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 222, - "end": 227, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 229, - "end": 231, - "ctxt": 0 - }, - "members": [] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 236, - "end": 290, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 236, - "end": 290, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 290, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 255, - "end": 284, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 262, - "end": 284, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 263, - "end": 283, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 268, - "end": 277, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 277, - "end": 283, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 300, - "end": 355, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 304, - "end": 354, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 304, - "end": 306, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 309, - "end": 354, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 314, - "end": 315, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 315, - "end": 331, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 318, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 315, - "end": 319, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 319, - "end": 326, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 326, - "end": 331, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 328, - "end": 330, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 332, - "end": 348, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 332, - "end": 336, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 336, - "end": 343, - "ctxt": 0 - }, - "value": " world ", - "raw": " world " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 343, - "end": 348, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 345, - "end": 347, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 348, - "end": 354, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 350, - "end": 353, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 432, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 431, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 362, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 365, - "end": 431, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 369, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 365, - "end": 370, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 371, - "end": 387, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 372, - "end": 374, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 371, - "end": 375, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 375, - "end": 382, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 382, - "end": 387, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 384, - "end": 386, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 387, - "end": 388, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 388, - "end": 425, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 389, - "end": 424, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 390, - "end": 399, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 394, - "end": 399, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 396, - "end": 399, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 404, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 405, - "end": 407, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 404, - "end": 408, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 408, - "end": 419, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 409, - "end": 418, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 409, - "end": 413, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 414, - "end": 418, - "ctxt": 0 - }, - "value": "name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 419, - "end": 424, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 421, - "end": 423, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 425, - "end": 431, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 433, - "end": 480, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 437, - "end": 479, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 442, - "end": 479, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 443, - "end": 446, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 442, - "end": 447, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 447, - "end": 448, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 448, - "end": 451, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 449, - "end": 450, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "type": "JSXText", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 452, - "end": 472, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 453, - "end": 471, - "ctxt": 0 - }, - "value": "That is a number", - "raw": "\"That is a number\"" - } - }, - { - "type": "JSXText", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 473, - "end": 479, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 481, - "end": 526, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 485, - "end": 525, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 485, - "end": 487, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 490, - "end": 525, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 491, - "end": 497, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 490, - "end": 498, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 498, - "end": 499, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 499, - "end": 515, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 500, - "end": 502, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 499, - "end": 503, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 503, - "end": 510, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 510, - "end": 515, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 512, - "end": 514, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 515, - "end": 516, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 516, - "end": 525, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 518, - "end": 524, - "ctxt": 0 - }, - "value": "Button", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty11.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty11.json deleted file mode 100644 index 459fa393030..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty11.json +++ /dev/null @@ -1,1310 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 62, - "end": 549, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 62, - "end": 227, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 77, - "end": 80, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 81, - "end": 227, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 105, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 101, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 107, - "end": 156, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 117, - "end": 142, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 143, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 145, - "end": 154, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 150, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 152, - "end": 154, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 158, - "end": 225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 168, - "end": 185, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 186, - "end": 225, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 191, - "end": 200, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 191, - "end": 194, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 199, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 196, - "end": 199, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 211, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 205, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 205, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 214, - "end": 216, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 218, - "end": 221, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 241, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 229, - "end": 315, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 245, - "end": 254, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 245, - "end": 250, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 250, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 252, - "end": 254, - "ctxt": 0 - }, - "members": [] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 259, - "end": 313, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 259, - "end": 265, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 259, - "end": 313, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 268, - "end": 313, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 278, - "end": 307, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 285, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 286, - "end": 306, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 287, - "end": 290, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 291, - "end": 300, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 300, - "end": 306, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 305, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 323, - "end": 378, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 327, - "end": 377, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 327, - "end": 329, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 332, - "end": 377, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 333, - "end": 336, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 332, - "end": 337, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 337, - "end": 338, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 338, - "end": 354, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 339, - "end": 341, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 338, - "end": 342, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 342, - "end": 349, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 349, - "end": 354, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 351, - "end": 353, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 355, - "end": 371, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 356, - "end": 358, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 355, - "end": 359, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 359, - "end": 366, - "ctxt": 0 - }, - "value": " world ", - "raw": " world " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 366, - "end": 371, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 368, - "end": 370, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 371, - "end": 377, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 379, - "end": 455, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 383, - "end": 454, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 383, - "end": 385, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 388, - "end": 454, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 389, - "end": 392, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 393, - "end": 394, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 394, - "end": 410, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 397, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 394, - "end": 398, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 398, - "end": 405, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 405, - "end": 410, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 407, - "end": 409, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 410, - "end": 411, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 411, - "end": 448, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 412, - "end": 447, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 413, - "end": 422, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 419, - "end": 422, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 427, - "end": 447, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 428, - "end": 430, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 427, - "end": 431, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 431, - "end": 442, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 432, - "end": 441, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 432, - "end": 436, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 437, - "end": 441, - "ctxt": 0 - }, - "value": "name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 442, - "end": 447, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 444, - "end": 446, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 448, - "end": 454, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 450, - "end": 453, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 456, - "end": 503, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 460, - "end": 502, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 460, - "end": 462, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 465, - "end": 502, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 466, - "end": 469, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 465, - "end": 470, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 470, - "end": 471, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 471, - "end": 474, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "type": "JSXText", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 475, - "end": 495, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 476, - "end": 494, - "ctxt": 0 - }, - "value": "That is a number", - "raw": "\"That is a number\"" - } - }, - { - "type": "JSXText", - "span": { - "start": 495, - "end": 496, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 496, - "end": 502, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 504, - "end": 549, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 508, - "end": 548, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 508, - "end": 510, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 513, - "end": 548, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 514, - "end": 520, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 513, - "end": 521, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 521, - "end": 522, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 522, - "end": 538, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 523, - "end": 525, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 522, - "end": 526, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 526, - "end": 533, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 533, - "end": 538, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 535, - "end": 537, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 539, - "end": 548, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 541, - "end": 547, - "ctxt": 0 - }, - "value": "Button", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty12.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty12.json deleted file mode 100644 index 16c95c4829a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty12.json +++ /dev/null @@ -1,977 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 666, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 169, - "ctxt": 0 - }, - "value": "ButtonProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 170, - "end": 225, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 186, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 177, - "end": 185, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 191, - "end": 201, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 192, - "end": 200, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 194, - "end": 200, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 206, - "end": 223, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 233, - "end": 239, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 227, - "end": 505, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 287, - "end": 503, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 287, - "end": 293, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 287, - "end": 503, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 296, - "end": 503, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 300, - "end": 323, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 304, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 304, - "end": 313, - "ctxt": 0 - }, - "value": "condition", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 322, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 315, - "end": 322, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 326, - "end": 497, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 330, - "end": 339, - "ctxt": 0 - }, - "value": "condition", - "optional": false - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 341, - "end": 394, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 352, - "end": 390, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 359, - "end": 390, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 360, - "end": 371, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - }, - "span": { - "start": 359, - "end": 390, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 376, - "end": 386, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 376, - "end": 380, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 381, - "end": 386, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 402, - "end": 497, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 407, - "end": 493, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 414, - "end": 492, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 415, - "end": 491, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 416, - "end": 427, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - }, - "span": { - "start": 415, - "end": 445, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 429, - "end": 432, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 432, - "end": 442, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 432, - "end": 436, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 437, - "end": 442, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 445, - "end": 450, - "ctxt": 0 - }, - "value": "\n\n\t\t\t\t", - "raw": "\n\n\t\t\t\t" - }, - { - "type": "JSXElement", - "span": { - "start": 450, - "end": 472, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 450, - "end": 455, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 455, - "end": 466, - "ctxt": 0 - }, - "value": "Hello World", - "raw": "Hello World" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 466, - "end": 472, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 468, - "end": 471, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 472, - "end": 477, - "ctxt": 0 - }, - "value": "\n\n\t\t\t\t", - "raw": "\n\n\t\t\t\t" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 477, - "end": 491, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 479, - "end": 490, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - } - } - } - } - } - ] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 248, - "end": 263, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 248, - "end": 253, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 254, - "end": 263, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 263, - "end": 280, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 264, - "end": 274, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 264, - "end": 274, - "ctxt": 0 - }, - "value": "ButtonProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 276, - "end": 279, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 507, - "end": 547, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 517, - "end": 532, - "ctxt": 0 - }, - "value": "InnerButtonProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 533, - "end": 547, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 536, - "end": 545, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 537, - "end": 545, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 539, - "end": 545, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 555, - "end": 566, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - }, - "declare": false, - "span": { - "start": 549, - "end": 666, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 616, - "end": 664, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 616, - "end": 622, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 616, - "end": 664, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 625, - "end": 664, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 629, - "end": 661, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 636, - "end": 660, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 637, - "end": 659, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 638, - "end": 644, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 637, - "end": 645, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 645, - "end": 650, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 650, - "end": 659, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 652, - "end": 658, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 575, - "end": 590, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 575, - "end": 580, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 581, - "end": 590, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 590, - "end": 612, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 591, - "end": 606, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 591, - "end": 606, - "ctxt": 0 - }, - "value": "InnerButtonProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 608, - "end": 611, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty13.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty13.json deleted file mode 100644 index 92fa6f4cb73..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty13.json +++ /dev/null @@ -1,844 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 142, - "end": 663, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 142, - "end": 174, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 157, - "end": 173, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 176, - "end": 252, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 196, - "ctxt": 0 - }, - "value": "ButtonProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 197, - "end": 252, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 213, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 218, - "end": 228, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 218, - "end": 219, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 219, - "end": 227, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 221, - "end": 227, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 233, - "end": 250, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 233, - "end": 241, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 241, - "end": 249, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 243, - "end": 249, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 243, - "end": 249, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 260, - "end": 266, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 254, - "end": 502, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 314, - "end": 500, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 314, - "end": 320, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 314, - "end": 500, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 323, - "end": 500, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 379, - "end": 494, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 386, - "end": 493, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 387, - "end": 492, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 388, - "end": 399, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - }, - "span": { - "start": 387, - "end": 430, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 404, - "end": 414, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 404, - "end": 408, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 409, - "end": 414, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 416, - "end": 429, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 416, - "end": 424, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 425, - "end": 429, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 430, - "end": 443, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 443, - "end": 465, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 443, - "end": 448, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 448, - "end": 459, - "ctxt": 0 - }, - "value": "Hello World", - "raw": "Hello World" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 459, - "end": 465, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 461, - "end": 464, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 465, - "end": 478, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 478, - "end": 492, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 480, - "end": 491, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 275, - "end": 290, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 281, - "end": 290, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 290, - "end": 307, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 291, - "end": 301, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 291, - "end": 301, - "ctxt": 0 - }, - "value": "ButtonProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 504, - "end": 544, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 514, - "end": 529, - "ctxt": 0 - }, - "value": "InnerButtonProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 530, - "end": 544, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 533, - "end": 542, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 533, - "end": 534, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 534, - "end": 542, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 536, - "end": 542, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 552, - "end": 563, - "ctxt": 0 - }, - "value": "InnerButton", - "optional": false - }, - "declare": false, - "span": { - "start": 546, - "end": 663, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 613, - "end": 661, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 613, - "end": 619, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 613, - "end": 661, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 622, - "end": 661, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 626, - "end": 658, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 633, - "end": 657, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 634, - "end": 656, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 635, - "end": 641, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 634, - "end": 642, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 642, - "end": 647, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 647, - "end": 656, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 649, - "end": 655, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 572, - "end": 587, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 572, - "end": 577, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 578, - "end": 587, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 587, - "end": 609, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 588, - "end": 603, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 588, - "end": 603, - "ctxt": 0 - }, - "value": "InnerButtonProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 605, - "end": 608, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty14.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty14.json deleted file mode 100644 index 6f0a0f9aadb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty14.json +++ /dev/null @@ -1,2309 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 1070, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 240, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 240, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 238, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 210, - "end": 237, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 221, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 214, - "end": 221, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - }, - { - "type": "TsArrayType", - "span": { - "start": 224, - "end": 237, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 228, - "end": 235, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 242, - "end": 351, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 304, - "end": 349, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 314, - "end": 343, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 321, - "end": 343, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 322, - "end": 342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 322, - "end": 327, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 341, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 263, - "end": 278, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 278, - "end": 288, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 362, - "end": 375, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 353, - "end": 428, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 384, - "end": 428, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 390, - "end": 426, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 397, - "end": 425, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 401, - "end": 420, - "ctxt": 0 - }, - "value": "Just Another Button", - "raw": "Just Another Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 420, - "end": 425, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 424, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 439, - "end": 443, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 445, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 430, - "end": 485, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 453, - "end": 485, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 459, - "end": 483, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 466, - "end": 482, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 467, - "end": 470, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 466, - "end": 471, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 471, - "end": 476, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 472, - "end": 475, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 476, - "end": 482, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 562, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 561, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 499, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 502, - "end": 561, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 507, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 502, - "end": 522, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 508, - "end": 509, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 510, - "end": 514, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 511, - "end": 513, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 515, - "end": 521, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 515, - "end": 516, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 517, - "end": 521, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXFragment", - "span": { - "start": 522, - "end": 527, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 522, - "end": 524, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 524, - "end": 527, - "ctxt": 0 - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 527, - "end": 537, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 528, - "end": 534, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 527, - "end": 537, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 537, - "end": 554, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 538, - "end": 551, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 537, - "end": 554, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 554, - "end": 561, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 556, - "end": 560, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 563, - "end": 632, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 567, - "end": 631, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 567, - "end": 569, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 572, - "end": 631, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 573, - "end": 577, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 572, - "end": 592, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 578, - "end": 584, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 578, - "end": 579, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 580, - "end": 584, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 581, - "end": 583, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 585, - "end": 591, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 585, - "end": 586, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 587, - "end": 591, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXFragment", - "span": { - "start": 592, - "end": 607, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 592, - "end": 594, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 594, - "end": 604, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 595, - "end": 601, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 594, - "end": 604, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 604, - "end": 607, - "ctxt": 0 - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 607, - "end": 624, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 608, - "end": 621, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 607, - "end": 624, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 624, - "end": 631, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 626, - "end": 630, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 633, - "end": 702, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 637, - "end": 701, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 637, - "end": 639, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 642, - "end": 701, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 643, - "end": 647, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 642, - "end": 662, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 648, - "end": 654, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 648, - "end": 649, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 650, - "end": 654, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 651, - "end": 653, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 655, - "end": 661, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 655, - "end": 656, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 657, - "end": 661, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXFragment", - "span": { - "start": 662, - "end": 694, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 662, - "end": 664, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 664, - "end": 674, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 664, - "end": 674, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 674, - "end": 691, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 675, - "end": 688, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 674, - "end": 691, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 691, - "end": 694, - "ctxt": 0 - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 694, - "end": 701, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 696, - "end": 700, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 704, - "end": 790, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 714, - "end": 729, - "ctxt": 0 - }, - "value": "SingleChildProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 730, - "end": 790, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 736, - "end": 746, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 736, - "end": 737, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 737, - "end": 745, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 739, - "end": 745, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 751, - "end": 761, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 751, - "end": 752, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 752, - "end": 760, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 754, - "end": 760, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 766, - "end": 788, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 766, - "end": 774, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 774, - "end": 787, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 776, - "end": 787, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 776, - "end": 779, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 780, - "end": 787, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 801, - "end": 816, - "ctxt": 0 - }, - "value": "SingleChildComp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 817, - "end": 835, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 817, - "end": 835, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 818, - "end": 835, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 820, - "end": 835, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 820, - "end": 835, - "ctxt": 0 - }, - "value": "SingleChildProp", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 792, - "end": 869, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 837, - "end": 869, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 843, - "end": 867, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 850, - "end": 866, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 851, - "end": 854, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 850, - "end": 855, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 855, - "end": 860, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 856, - "end": 859, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 856, - "end": 857, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 858, - "end": 859, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 860, - "end": 866, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 862, - "end": 865, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 877, - "end": 968, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 881, - "end": 967, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 881, - "end": 883, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 886, - "end": 967, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 887, - "end": 902, - "ctxt": 0 - }, - "value": "SingleChildComp", - "optional": false - }, - "span": { - "start": 886, - "end": 917, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 903, - "end": 909, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 903, - "end": 904, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 905, - "end": 909, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 906, - "end": 908, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 910, - "end": 916, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 910, - "end": 911, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 912, - "end": 916, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXFragment", - "span": { - "start": 917, - "end": 949, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 917, - "end": 919, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 919, - "end": 929, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 920, - "end": 926, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 919, - "end": 929, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 929, - "end": 946, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 930, - "end": 943, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 929, - "end": 946, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 946, - "end": 949, - "ctxt": 0 - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 949, - "end": 967, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 951, - "end": 966, - "ctxt": 0 - }, - "value": "SingleChildComp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 979, - "end": 1070, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 983, - "end": 1069, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 983, - "end": 985, - "ctxt": 0 - }, - "value": "k5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 988, - "end": 1069, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 989, - "end": 1004, - "ctxt": 0 - }, - "value": "SingleChildComp", - "optional": false - }, - "span": { - "start": 988, - "end": 1019, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1005, - "end": 1011, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1006, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1007, - "end": 1011, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1008, - "end": 1010, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1012, - "end": 1018, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1012, - "end": 1013, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1014, - "end": 1018, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXFragment", - "span": { - "start": 1019, - "end": 1024, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 1019, - "end": 1021, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 1021, - "end": 1024, - "ctxt": 0 - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 1024, - "end": 1034, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1025, - "end": 1031, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 1024, - "end": 1034, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 1034, - "end": 1051, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1035, - "end": 1048, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 1034, - "end": 1051, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1051, - "end": 1069, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1053, - "end": 1068, - "ctxt": 0 - }, - "value": "SingleChildComp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty15.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty15.json deleted file mode 100644 index 43017996983..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty15.json +++ /dev/null @@ -1,816 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 404, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 184, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "value": "Tag", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 161, - "end": 183, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 163, - "end": 167, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 165, - "end": 167, - "ctxt": 0 - }, - "members": [] - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 172, - "end": 183, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 173, - "end": 176, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 177, - "end": 183, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 179, - "end": 182, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 211, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 198, - "end": 210, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 203, - "end": 210, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 204, - "end": 207, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - }, - "span": { - "start": 203, - "end": 210, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 212, - "end": 235, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 218, - "end": 234, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 218, - "end": 220, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 223, - "end": 234, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - }, - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 228, - "end": 234, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 265, - "end": 307, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 271, - "end": 306, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 271, - "end": 273, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 276, - "end": 306, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - }, - "span": { - "start": 276, - "end": 306, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 281, - "end": 303, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 281, - "end": 289, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 290, - "end": 303, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 291, - "end": 302, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 291, - "end": 296, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 296, - "end": 302, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 308, - "end": 350, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 314, - "end": 349, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 314, - "end": 316, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 319, - "end": 349, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - }, - "span": { - "start": 319, - "end": 332, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 324, - "end": 331, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 328, - "end": 331, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 332, - "end": 343, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 333, - "end": 336, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 332, - "end": 337, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 337, - "end": 343, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 343, - "end": 349, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 345, - "end": 348, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 351, - "end": 404, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 357, - "end": 403, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 357, - "end": 359, - "ctxt": 0 - }, - "value": "k5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 362, - "end": 403, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - }, - "span": { - "start": 362, - "end": 375, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 367, - "end": 374, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 367, - "end": 370, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 371, - "end": 374, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 375, - "end": 386, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 375, - "end": 380, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 380, - "end": 386, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 385, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 386, - "end": 397, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 387, - "end": 390, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 386, - "end": 391, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 391, - "end": 397, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 393, - "end": 396, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 397, - "end": 403, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 399, - "end": 402, - "ctxt": 0 - }, - "value": "Tag", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty2.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty2.json deleted file mode 100644 index 4f77fb66eb0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty2.json +++ /dev/null @@ -1,2107 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 142, - "end": 1021, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 142, - "end": 174, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 157, - "end": 173, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 176, - "end": 259, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 190, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 191, - "end": 259, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 197, - "end": 207, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 198, - "end": 206, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 200, - "end": 206, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 212, - "end": 222, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 227, - "end": 257, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 227, - "end": 235, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 257, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 237, - "end": 257, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 237, - "end": 243, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsTypeReference", - "span": { - "start": 246, - "end": 257, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 246, - "end": 249, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 250, - "end": 257, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 270, - "end": 274, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 275, - "end": 282, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 275, - "end": 282, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 276, - "end": 282, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 278, - "end": 282, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 278, - "end": 282, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 261, - "end": 316, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 284, - "end": 316, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 290, - "end": 314, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 297, - "end": 313, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 297, - "end": 302, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 302, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 307, - "end": 313, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 309, - "end": 312, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 345, - "end": 376, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 349, - "end": 375, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 353, - "end": 375, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 354, - "end": 358, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 353, - "end": 375, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 359, - "end": 365, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 361, - "end": 365, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 362, - "end": 364, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 366, - "end": 372, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 367, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 368, - "end": 372, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 378, - "end": 461, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 382, - "end": 460, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 382, - "end": 384, - "ctxt": 0 - }, - "value": "k0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 391, - "end": 460, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 392, - "end": 396, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 391, - "end": 430, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 397, - "end": 403, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 397, - "end": 398, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 399, - "end": 403, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 400, - "end": 402, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 404, - "end": 410, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 404, - "end": 405, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 406, - "end": 410, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 411, - "end": 428, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 411, - "end": 419, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 420, - "end": 428, - "ctxt": 0 - }, - "value": "Random", - "raw": "\"Random\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 430, - "end": 453, - "ctxt": 0 - }, - "value": "\n\n hi hi hi!\n\n ", - "raw": "\n\n hi hi hi!\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 453, - "end": 460, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 455, - "end": 459, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 463, - "end": 497, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 467, - "end": 497, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 467, - "end": 468, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 471, - "end": 497, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 478, - "end": 486, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 487, - "end": 495, - "ctxt": 0 - }, - "value": "Random", - "raw": "\"Random\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 498, - "end": 570, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 502, - "end": 569, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 502, - "end": 504, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 511, - "end": 569, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 512, - "end": 516, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 511, - "end": 539, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 517, - "end": 523, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 517, - "end": 518, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 519, - "end": 523, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 520, - "end": 522, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 524, - "end": 530, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 524, - "end": 525, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 532, - "end": 535, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 535, - "end": 536, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 539, - "end": 562, - "ctxt": 0 - }, - "value": "\n\n hi hi hi!\n\n ", - "raw": "\n\n hi hi hi!\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 562, - "end": 569, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 564, - "end": 568, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 597, - "end": 727, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 601, - "end": 726, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 601, - "end": 603, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 610, - "end": 726, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 611, - "end": 615, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 610, - "end": 630, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 616, - "end": 622, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 616, - "end": 617, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 618, - "end": 622, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 619, - "end": 621, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 623, - "end": 629, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 623, - "end": 624, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 625, - "end": 629, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 639, - "end": 658, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 640, - "end": 643, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 639, - "end": 644, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 644, - "end": 652, - "ctxt": 0 - }, - "value": " My Div ", - "raw": " My Div " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 652, - "end": 658, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 654, - "end": 657, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 658, - "end": 667, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 667, - "end": 714, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 668, - "end": 713, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 669, - "end": 681, - "ctxt": 0 - }, - "value": "name", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 673, - "end": 681, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 675, - "end": 681, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 686, - "end": 713, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 687, - "end": 690, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 686, - "end": 691, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 691, - "end": 700, - "ctxt": 0 - }, - "value": " My name ", - "raw": " My name " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 700, - "end": 706, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 701, - "end": 705, - "ctxt": 0 - }, - "value": "name", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 706, - "end": 707, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 707, - "end": 713, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 709, - "end": 712, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 714, - "end": 719, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 719, - "end": 726, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 721, - "end": 725, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 729, - "end": 821, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 733, - "end": 820, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 733, - "end": 735, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 742, - "end": 820, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 743, - "end": 747, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 742, - "end": 762, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 748, - "end": 754, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 750, - "end": 754, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 751, - "end": 753, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 755, - "end": 761, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 755, - "end": 756, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 757, - "end": 761, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 762, - "end": 771, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 771, - "end": 790, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 772, - "end": 775, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 771, - "end": 776, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 776, - "end": 784, - "ctxt": 0 - }, - "value": " My Div ", - "raw": " My Div " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 784, - "end": 790, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 786, - "end": 789, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 790, - "end": 799, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 799, - "end": 808, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 800, - "end": 807, - "ctxt": 0 - }, - "value": 1000000.0 - } - }, - { - "type": "JSXText", - "span": { - "start": 808, - "end": 813, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 813, - "end": 820, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 815, - "end": 819, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 823, - "end": 916, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 827, - "end": 915, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 827, - "end": 829, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 836, - "end": 915, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 837, - "end": 841, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 836, - "end": 857, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 842, - "end": 848, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 842, - "end": 843, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 844, - "end": 848, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 845, - "end": 847, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 849, - "end": 855, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 849, - "end": 850, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 851, - "end": 855, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 857, - "end": 866, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 866, - "end": 885, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 867, - "end": 870, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 866, - "end": 871, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 871, - "end": 879, - "ctxt": 0 - }, - "value": " My Div ", - "raw": " My Div " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 879, - "end": 885, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 881, - "end": 884, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 885, - "end": 908, - "ctxt": 0 - }, - "value": "\n\n hi hi hi!\n\n ", - "raw": "\n\n hi hi hi!\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 908, - "end": 915, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 910, - "end": 914, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 918, - "end": 1021, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 922, - "end": 1020, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 922, - "end": 924, - "ctxt": 0 - }, - "value": "k5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 931, - "end": 1020, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 932, - "end": 936, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 931, - "end": 952, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 937, - "end": 943, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 939, - "end": 943, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 940, - "end": 942, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 944, - "end": 950, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 944, - "end": 945, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 946, - "end": 950, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 952, - "end": 961, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 961, - "end": 980, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 962, - "end": 965, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 961, - "end": 966, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 966, - "end": 974, - "ctxt": 0 - }, - "value": " My Div ", - "raw": " My Div " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 974, - "end": 980, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 976, - "end": 979, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 980, - "end": 989, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 989, - "end": 1008, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 990, - "end": 993, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 989, - "end": 994, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 994, - "end": 1002, - "ctxt": 0 - }, - "value": " My Div ", - "raw": " My Div " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1002, - "end": 1008, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1004, - "end": 1007, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1008, - "end": 1013, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1013, - "end": 1020, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1015, - "end": 1019, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty3.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty3.json deleted file mode 100644 index 444d72af7cb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty3.json +++ /dev/null @@ -1,1055 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 787, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 164, - "ctxt": 0 - }, - "value": "IUser", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 165, - "end": 186, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 171, - "end": 184, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "value": "Name", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 175, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 177, - "end": 183, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 188, - "end": 261, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 213, - "ctxt": 0 - }, - "value": "IFetchUserProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 214, - "end": 261, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 220, - "end": 259, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 220, - "end": 228, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 228, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 230, - "end": 258, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "value": "IUser", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 244, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 247, - "end": 258, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 251, - "end": 258, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "declare": false, - "span": { - "start": 263, - "end": 448, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 331, - "end": 446, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 331, - "end": 446, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 340, - "end": 446, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 350, - "end": 440, - "ctxt": 0 - }, - "argument": { - "type": "ConditionalExpression", - "span": { - "start": 357, - "end": 439, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 362, - "end": 367, - "ctxt": 0 - }, - "value": "state", - "optional": false - } - }, - "consequent": { - "type": "CallExpression", - "span": { - "start": 382, - "end": 420, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 382, - "end": 401, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 382, - "end": 392, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 387, - "end": 392, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 393, - "end": 401, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 402, - "end": 419, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 402, - "end": 412, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 402, - "end": 406, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 407, - "end": 412, - "ctxt": 0 - }, - "value": "state", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "value": "result", - "optional": false - } - } - } - ], - "typeArguments": null - }, - "alternate": { - "type": "NullLiteral", - "span": { - "start": 435, - "end": 439, - "ctxt": 0 - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 287, - "end": 302, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 293, - "end": 302, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 302, - "end": 324, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 318, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 318, - "ctxt": 0 - }, - "value": "IFetchUserProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 465, - "end": 474, - "ctxt": 0 - }, - "value": "UserName0", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 456, - "end": 620, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 477, - "end": 620, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 483, - "end": 618, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 490, - "end": 617, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 500, - "end": 611, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 501, - "end": 510, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "span": { - "start": 500, - "end": 511, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 511, - "end": 524, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 524, - "end": 590, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 526, - "end": 588, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 534, - "end": 588, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 552, - "end": 574, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 553, - "end": 555, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 552, - "end": 556, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 556, - "end": 569, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 558, - "end": 567, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 558, - "end": 562, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 563, - "end": 567, - "ctxt": 0 - }, - "value": "Name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 569, - "end": 574, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 573, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 590, - "end": 599, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 599, - "end": 611, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 601, - "end": 610, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 631, - "end": 640, - "ctxt": 0 - }, - "value": "UserName1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 622, - "end": 787, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 643, - "end": 787, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 649, - "end": 785, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 656, - "end": 784, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 666, - "end": 778, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 667, - "end": 676, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "span": { - "start": 666, - "end": 677, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 677, - "end": 691, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 691, - "end": 757, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 693, - "end": 755, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 693, - "end": 697, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 701, - "end": 755, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 719, - "end": 741, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 720, - "end": 722, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 719, - "end": 723, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 723, - "end": 736, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 725, - "end": 734, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 725, - "end": 729, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 730, - "end": 734, - "ctxt": 0 - }, - "value": "Name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 736, - "end": 741, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 738, - "end": 740, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 757, - "end": 766, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 766, - "end": 778, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 768, - "end": 777, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty4.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty4.json deleted file mode 100644 index 1c53c3a5088..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty4.json +++ /dev/null @@ -1,1191 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 882, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 164, - "ctxt": 0 - }, - "value": "IUser", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 165, - "end": 186, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 171, - "end": 184, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "value": "Name", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 175, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 177, - "end": 183, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 188, - "end": 261, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 213, - "ctxt": 0 - }, - "value": "IFetchUserProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 214, - "end": 261, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 220, - "end": 259, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 220, - "end": 228, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 228, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 230, - "end": 258, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "value": "IUser", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 244, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 247, - "end": 258, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 251, - "end": 258, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "declare": false, - "span": { - "start": 263, - "end": 448, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 331, - "end": 446, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 331, - "end": 446, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 340, - "end": 446, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 350, - "end": 440, - "ctxt": 0 - }, - "argument": { - "type": "ConditionalExpression", - "span": { - "start": 357, - "end": 439, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 362, - "end": 367, - "ctxt": 0 - }, - "value": "state", - "optional": false - } - }, - "consequent": { - "type": "CallExpression", - "span": { - "start": 382, - "end": 420, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 382, - "end": 401, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 382, - "end": 392, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 387, - "end": 392, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 393, - "end": 401, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 402, - "end": 419, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 402, - "end": 412, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 402, - "end": 406, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 407, - "end": 412, - "ctxt": 0 - }, - "value": "state", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "value": "result", - "optional": false - } - } - } - ], - "typeArguments": null - }, - "alternate": { - "type": "NullLiteral", - "span": { - "start": 435, - "end": 439, - "ctxt": 0 - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 287, - "end": 302, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 293, - "end": 302, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 302, - "end": 324, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 318, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 318, - "ctxt": 0 - }, - "value": "IFetchUserProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 468, - "end": 476, - "ctxt": 0 - }, - "value": "UserName", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 459, - "end": 622, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 479, - "end": 622, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 485, - "end": 620, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 492, - "end": 619, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 502, - "end": 613, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 512, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "span": { - "start": 502, - "end": 513, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 513, - "end": 526, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 526, - "end": 592, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 528, - "end": 590, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 528, - "end": 532, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 536, - "end": 590, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 554, - "end": 576, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 555, - "end": 557, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 554, - "end": 558, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 558, - "end": 571, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 560, - "end": 569, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 560, - "end": 564, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 565, - "end": 569, - "ctxt": 0 - }, - "value": "NAme", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 571, - "end": 576, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 573, - "end": 575, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 592, - "end": 601, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 601, - "end": 613, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 603, - "end": 612, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 633, - "end": 642, - "ctxt": 0 - }, - "value": "UserName1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 624, - "end": 882, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 645, - "end": 882, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 651, - "end": 880, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 658, - "end": 879, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 668, - "end": 873, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 669, - "end": 678, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - }, - "span": { - "start": 668, - "end": 679, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 679, - "end": 707, - "ctxt": 0 - }, - "value": "\n\n\n\n\n\n \n\n ", - "raw": "\n\n\n\n\n\n \n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 707, - "end": 773, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 709, - "end": 771, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 709, - "end": 713, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 717, - "end": 771, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 735, - "end": 757, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 736, - "end": 738, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 735, - "end": 739, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 739, - "end": 752, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 741, - "end": 750, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 741, - "end": 745, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 746, - "end": 750, - "ctxt": 0 - }, - "value": "Name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 752, - "end": 757, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 754, - "end": 756, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 773, - "end": 786, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 786, - "end": 852, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 788, - "end": 850, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 788, - "end": 792, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 796, - "end": 850, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 814, - "end": 836, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 815, - "end": 817, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 814, - "end": 818, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 818, - "end": 831, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 820, - "end": 829, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 820, - "end": 824, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 825, - "end": 829, - "ctxt": 0 - }, - "value": "Name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 831, - "end": 836, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 833, - "end": 835, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "JSXText", - "span": { - "start": 852, - "end": 861, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 861, - "end": 873, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 863, - "end": 872, - "ctxt": 0 - }, - "value": "FetchUser", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty5.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty5.json deleted file mode 100644 index 9fce3d070f0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty5.json +++ /dev/null @@ -1,1098 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 641, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 219, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 219, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 217, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 227, - "end": 233, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 221, - "end": 330, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 274, - "end": 328, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 274, - "end": 280, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 274, - "end": 328, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 283, - "end": 328, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 293, - "end": 322, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 300, - "end": 322, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 301, - "end": 321, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 305, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 301, - "end": 306, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 306, - "end": 315, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 315, - "end": 321, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 317, - "end": 320, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 242, - "end": 257, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 242, - "end": 247, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 248, - "end": 257, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 257, - "end": 267, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 258, - "end": 261, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 341, - "end": 345, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 346, - "end": 353, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 346, - "end": 353, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 347, - "end": 353, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 332, - "end": 387, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 355, - "end": 387, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 361, - "end": 385, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 368, - "end": 384, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 368, - "end": 373, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 373, - "end": 378, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 374, - "end": 375, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 378, - "end": 384, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 380, - "end": 383, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 421, - "end": 452, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 425, - "end": 451, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 425, - "end": 426, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 429, - "end": 451, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 430, - "end": 434, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 429, - "end": 451, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 435, - "end": 441, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 437, - "end": 441, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 438, - "end": 440, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 442, - "end": 448, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 442, - "end": 443, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 444, - "end": 448, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 512, - "end": 577, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 516, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 516, - "end": 518, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 525, - "end": 576, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 525, - "end": 545, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 531, - "end": 537, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 531, - "end": 532, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 533, - "end": 537, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 534, - "end": 536, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 538, - "end": 544, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 540, - "end": 544, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 545, - "end": 554, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 554, - "end": 564, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 555, - "end": 561, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 554, - "end": 564, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 564, - "end": 569, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 569, - "end": 576, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 575, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 578, - "end": 641, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 582, - "end": 640, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 582, - "end": 584, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 591, - "end": 640, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 592, - "end": 596, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 591, - "end": 611, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 597, - "end": 603, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 597, - "end": 598, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 599, - "end": 603, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 600, - "end": 602, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 604, - "end": 610, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 606, - "end": 610, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 611, - "end": 620, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 620, - "end": 628, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 621, - "end": 627, - "ctxt": 0 - }, - "value": "Button", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 628, - "end": 633, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 633, - "end": 640, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 635, - "end": 639, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty6.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty6.json deleted file mode 100644 index 36bd5a8d26c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty6.json +++ /dev/null @@ -1,1671 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 812, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 240, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 240, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 238, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 210, - "end": 237, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 221, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 214, - "end": 221, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - }, - { - "type": "TsArrayType", - "span": { - "start": 224, - "end": 237, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 228, - "end": 235, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 242, - "end": 351, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 304, - "end": 349, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 314, - "end": 343, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 321, - "end": 343, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 322, - "end": 342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 322, - "end": 327, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 341, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 263, - "end": 278, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 278, - "end": 288, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 362, - "end": 375, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 353, - "end": 428, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 384, - "end": 428, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 390, - "end": 426, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 397, - "end": 425, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 401, - "end": 420, - "ctxt": 0 - }, - "value": "Just Another Button", - "raw": "Just Another Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 420, - "end": 425, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 424, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 439, - "end": 443, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 445, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 430, - "end": 485, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 453, - "end": 485, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 459, - "end": 483, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 466, - "end": 482, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 467, - "end": 470, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 466, - "end": 471, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 471, - "end": 476, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 472, - "end": 475, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 476, - "end": 482, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 584, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 583, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 499, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 506, - "end": 583, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 507, - "end": 511, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 506, - "end": 526, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 512, - "end": 518, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 512, - "end": 513, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 514, - "end": 518, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 515, - "end": 517, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 519, - "end": 525, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 519, - "end": 520, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 521, - "end": 525, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 526, - "end": 535, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 535, - "end": 545, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 536, - "end": 542, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 535, - "end": 545, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 545, - "end": 554, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 554, - "end": 571, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 555, - "end": 568, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 554, - "end": 571, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 571, - "end": 576, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 576, - "end": 583, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 578, - "end": 582, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 586, - "end": 693, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 590, - "end": 692, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 590, - "end": 592, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 599, - "end": 692, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 600, - "end": 604, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 599, - "end": 619, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 605, - "end": 611, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 605, - "end": 606, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 608, - "end": 610, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 612, - "end": 618, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 612, - "end": 613, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 614, - "end": 618, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 619, - "end": 644, - "ctxt": 0 - }, - "value": "\n\n \n\n \n\n \n\n ", - "raw": "\n\n \n\n \n\n \n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 644, - "end": 654, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 645, - "end": 651, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 644, - "end": 654, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 654, - "end": 663, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 663, - "end": 680, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 664, - "end": 677, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 663, - "end": 680, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 680, - "end": 685, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 685, - "end": 692, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 687, - "end": 691, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 695, - "end": 763, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 699, - "end": 762, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 699, - "end": 701, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 704, - "end": 762, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 705, - "end": 709, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 704, - "end": 724, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 710, - "end": 716, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 710, - "end": 711, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 712, - "end": 716, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 713, - "end": 715, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 717, - "end": 723, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 717, - "end": 718, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 719, - "end": 723, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 724, - "end": 734, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 725, - "end": 731, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 724, - "end": 734, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 734, - "end": 737, - "ctxt": 0 - }, - "value": " \n\n", - "raw": " \n\n" - }, - { - "type": "JSXElement", - "span": { - "start": 737, - "end": 754, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 738, - "end": 751, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 737, - "end": 754, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 754, - "end": 755, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 755, - "end": 762, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 757, - "end": 761, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 765, - "end": 812, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 769, - "end": 811, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 769, - "end": 771, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 774, - "end": 811, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 775, - "end": 779, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 774, - "end": 794, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 780, - "end": 786, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 780, - "end": 781, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 782, - "end": 786, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 783, - "end": 785, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 787, - "end": 793, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 787, - "end": 788, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 789, - "end": 793, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 794, - "end": 804, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 795, - "end": 801, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 794, - "end": 804, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 804, - "end": 811, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 806, - "end": 810, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty7.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty7.json deleted file mode 100644 index e8b8d9b81fd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty7.json +++ /dev/null @@ -1,1465 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 729, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 240, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 240, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 238, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 210, - "end": 237, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 221, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 214, - "end": 221, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - }, - { - "type": "TsArrayType", - "span": { - "start": 224, - "end": 237, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 228, - "end": 235, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 242, - "end": 351, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 295, - "end": 349, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 304, - "end": 349, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 314, - "end": 343, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 321, - "end": 343, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 322, - "end": 342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 322, - "end": 327, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 341, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 263, - "end": 278, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 278, - "end": 288, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 362, - "end": 375, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 353, - "end": 428, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 384, - "end": 428, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 390, - "end": 426, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 397, - "end": 425, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 401, - "end": 420, - "ctxt": 0 - }, - "value": "Just Another Button", - "raw": "Just Another Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 420, - "end": 425, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 424, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 439, - "end": 443, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 445, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 430, - "end": 485, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 453, - "end": 485, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 459, - "end": 483, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 466, - "end": 482, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 467, - "end": 470, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 466, - "end": 471, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 471, - "end": 476, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 472, - "end": 475, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 476, - "end": 482, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 517, - "end": 583, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 521, - "end": 582, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 521, - "end": 523, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 526, - "end": 582, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 527, - "end": 531, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 526, - "end": 546, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 532, - "end": 538, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 534, - "end": 538, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 535, - "end": 537, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 539, - "end": 545, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 541, - "end": 545, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 546, - "end": 556, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 547, - "end": 553, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 546, - "end": 556, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 556, - "end": 558, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 558, - "end": 575, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 559, - "end": 572, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 558, - "end": 575, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 575, - "end": 582, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 577, - "end": 581, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 584, - "end": 655, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 588, - "end": 654, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 588, - "end": 590, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 593, - "end": 654, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 594, - "end": 598, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 593, - "end": 613, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 599, - "end": 605, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 599, - "end": 600, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 601, - "end": 605, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 602, - "end": 604, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 606, - "end": 612, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 608, - "end": 612, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 613, - "end": 623, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 614, - "end": 620, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 613, - "end": 623, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 623, - "end": 628, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 628, - "end": 645, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 629, - "end": 642, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 628, - "end": 645, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 645, - "end": 647, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 647, - "end": 654, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 649, - "end": 653, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 656, - "end": 729, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 660, - "end": 728, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 660, - "end": 662, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 665, - "end": 728, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 666, - "end": 670, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 665, - "end": 685, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 671, - "end": 677, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 671, - "end": 672, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 673, - "end": 677, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 674, - "end": 676, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 678, - "end": 684, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 678, - "end": 679, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 680, - "end": 684, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 685, - "end": 689, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 689, - "end": 699, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 690, - "end": 696, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 689, - "end": 699, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 699, - "end": 704, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 704, - "end": 721, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 705, - "end": 718, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 704, - "end": 721, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 721, - "end": 728, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 723, - "end": 727, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty8.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty8.json deleted file mode 100644 index 7fe5481a34a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty8.json +++ /dev/null @@ -1,1687 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 775, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 260, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 260, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 195, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 200, - "end": 258, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 257, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 210, - "end": 257, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsTypeReference", - "span": { - "start": 219, - "end": 230, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 219, - "end": 222, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 223, - "end": 230, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - }, - { - "type": "TsArrayType", - "span": { - "start": 233, - "end": 257, - "ctxt": 0 - }, - "elemType": { - "type": "TsParenthesizedType", - "span": { - "start": 233, - "end": 255, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 234, - "end": 254, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsTypeReference", - "span": { - "start": 243, - "end": 254, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 243, - "end": 246, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 247, - "end": 254, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - ] - } - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 268, - "end": 274, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 262, - "end": 371, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 315, - "end": 369, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 315, - "end": 321, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 315, - "end": 369, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 324, - "end": 369, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 334, - "end": 363, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 341, - "end": 363, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 342, - "end": 362, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 343, - "end": 346, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 342, - "end": 347, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 347, - "end": 356, - "ctxt": 0 - }, - "value": "My Button", - "raw": "My Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 356, - "end": 362, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 361, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 283, - "end": 298, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 283, - "end": 288, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 289, - "end": 298, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 298, - "end": 308, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 299, - "end": 302, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 382, - "end": 395, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 396, - "end": 402, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 396, - "end": 402, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 397, - "end": 402, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 399, - "end": 402, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 373, - "end": 448, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 404, - "end": 448, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 410, - "end": 446, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 417, - "end": 445, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 420, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 417, - "end": 421, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 421, - "end": 440, - "ctxt": 0 - }, - "value": "Just Another Button", - "raw": "Just Another Button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 440, - "end": 445, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 442, - "end": 444, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 459, - "end": 463, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 464, - "end": 471, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 464, - "end": 471, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 465, - "end": 471, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 467, - "end": 471, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 467, - "end": 471, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 450, - "end": 505, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 473, - "end": 505, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 479, - "end": 503, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 486, - "end": 502, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 486, - "end": 491, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 491, - "end": 496, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 492, - "end": 495, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 492, - "end": 493, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 496, - "end": 502, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 579, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 517, - "end": 578, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 517, - "end": 519, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 522, - "end": 578, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 523, - "end": 527, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 522, - "end": 542, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 528, - "end": 534, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 528, - "end": 529, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 531, - "end": 533, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 535, - "end": 541, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 535, - "end": 536, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 537, - "end": 541, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 542, - "end": 552, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 543, - "end": 549, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 542, - "end": 552, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 552, - "end": 554, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 554, - "end": 571, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 555, - "end": 568, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 554, - "end": 571, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 571, - "end": 578, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 573, - "end": 577, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 580, - "end": 651, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 584, - "end": 650, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 584, - "end": 586, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 589, - "end": 650, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 590, - "end": 594, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 589, - "end": 609, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 595, - "end": 601, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 595, - "end": 596, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 597, - "end": 601, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 598, - "end": 600, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 602, - "end": 608, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 602, - "end": 603, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 604, - "end": 608, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 609, - "end": 619, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 610, - "end": 616, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 609, - "end": 619, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 619, - "end": 624, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 624, - "end": 641, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 625, - "end": 638, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 624, - "end": 641, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 641, - "end": 643, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 643, - "end": 650, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 645, - "end": 649, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 652, - "end": 725, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 656, - "end": 724, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 656, - "end": 658, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 661, - "end": 724, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 662, - "end": 666, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 661, - "end": 681, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 667, - "end": 673, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 669, - "end": 673, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 670, - "end": 672, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 674, - "end": 680, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 674, - "end": 675, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 676, - "end": 680, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 681, - "end": 685, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 685, - "end": 695, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 686, - "end": 692, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 685, - "end": 695, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 695, - "end": 700, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 700, - "end": 717, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 701, - "end": 714, - "ctxt": 0 - }, - "value": "AnotherButton", - "optional": false - }, - "span": { - "start": 700, - "end": 717, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 717, - "end": 724, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 719, - "end": 723, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 726, - "end": 775, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 730, - "end": 774, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 730, - "end": 732, - "ctxt": 0 - }, - "value": "k4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 735, - "end": 774, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 736, - "end": 740, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - }, - "span": { - "start": 735, - "end": 755, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 741, - "end": 747, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 741, - "end": 742, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 743, - "end": 747, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 744, - "end": 746, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 748, - "end": 754, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 750, - "end": 754, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 755, - "end": 765, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 756, - "end": 762, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 755, - "end": 765, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 765, - "end": 767, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 767, - "end": 774, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 769, - "end": 773, - "ctxt": 0 - }, - "value": "Comp", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty9.json b/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty9.json deleted file mode 100644 index 63e6139237d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxChildrenProperty9.json +++ /dev/null @@ -1,709 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 335, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 155, - "end": 210, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 159, - "end": 209, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 161, - "ctxt": 0 - }, - "value": "k1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 164, - "end": 209, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 165, - "end": 168, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 164, - "end": 169, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 170, - "end": 186, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 171, - "end": 173, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 170, - "end": 174, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 174, - "end": 181, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 181, - "end": 186, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 183, - "end": 185, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 187, - "end": 203, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 188, - "end": 190, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 191, - "end": 198, - "ctxt": 0 - }, - "value": " world ", - "raw": " world " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 198, - "end": 203, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 200, - "end": 202, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 203, - "end": 209, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 205, - "end": 208, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 211, - "end": 287, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 215, - "end": 286, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 215, - "end": 217, - "ctxt": 0 - }, - "value": "k2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 220, - "end": 286, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 221, - "end": 224, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 220, - "end": 225, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 226, - "end": 242, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 227, - "end": 229, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 226, - "end": 230, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 230, - "end": 237, - "ctxt": 0 - }, - "value": " Hello ", - "raw": " Hello " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 239, - "end": 241, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 242, - "end": 243, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 243, - "end": 280, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 244, - "end": 279, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 245, - "end": 254, - "ctxt": 0 - }, - "value": "user", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 249, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 259, - "end": 279, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 260, - "end": 262, - "ctxt": 0 - }, - "value": "h2", - "optional": false - }, - "span": { - "start": 259, - "end": 263, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 263, - "end": 274, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 264, - "end": 273, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 264, - "end": 268, - "ctxt": 0 - }, - "value": "user", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 273, - "ctxt": 0 - }, - "value": "name", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 274, - "end": 279, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 276, - "end": 278, - "ctxt": 0 - }, - "value": "h2", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 280, - "end": 286, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 282, - "end": 285, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 288, - "end": 335, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 292, - "end": 334, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 292, - "end": 294, - "ctxt": 0 - }, - "value": "k3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 297, - "end": 334, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 297, - "end": 302, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "type": "JSXText", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 307, - "end": 327, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 308, - "end": 326, - "ctxt": 0 - }, - "value": "That is a number", - "raw": "\"That is a number\"" - } - }, - { - "type": "JSXText", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 328, - "end": 334, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxGenericTagHasCorrectInferences.json b/crates/swc_ecma_parser/tests/tsc/checkJsxGenericTagHasCorrectInferences.json deleted file mode 100644 index 4afab009c39..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxGenericTagHasCorrectInferences.json +++ /dev/null @@ -1,1322 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 800, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 114, - "end": 145, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 126, - "end": 131, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 137, - "end": 144, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 146, - "end": 221, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 165, - "ctxt": 0 - }, - "value": "BaseProps", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 165, - "end": 168, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 169, - "end": 221, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 173, - "end": 190, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 173, - "end": 186, - "ctxt": 0 - }, - "value": "initialValues", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 193, - "end": 219, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 193, - "end": 203, - "ctxt": 0 - }, - "value": "nextValues", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 203, - "end": 218, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 205, - "end": 218, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "value": "cur", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 218, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 217, - "end": 218, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 217, - "end": 218, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 236, - "end": 252, - "ctxt": 0 - }, - "value": "GenericComponent", - "optional": false - }, - "declare": true, - "span": { - "start": 222, - "end": 354, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 341, - "end": 352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 341, - "end": 343, - "ctxt": 0 - }, - "value": "iv", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 343, - "end": 351, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 345, - "end": 351, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 345, - "end": 351, - "ctxt": 0 - }, - "value": "Values", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 290, - "end": 305, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 290, - "end": 295, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 296, - "end": 305, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 252, - "end": 281, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 253, - "end": 263, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 253, - "end": 258, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeLiteral", - "span": { - "start": 261, - "end": 263, - "ctxt": 0 - }, - "members": [] - } - }, - { - "type": "TsTypeParameter", - "span": { - "start": 265, - "end": 280, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "value": "Values", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsKeywordType", - "span": { - "start": 274, - "end": 280, - "ctxt": 0 - }, - "kind": "object" - } - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 305, - "end": 336, - "ctxt": 0 - }, - "params": [ - { - "type": "TsIntersectionType", - "span": { - "start": 306, - "end": 331, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 306, - "end": 311, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 306, - "end": 311, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 314, - "end": 331, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 314, - "end": 323, - "ctxt": 0 - }, - "value": "BaseProps", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 323, - "end": 331, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "value": "Values", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 432, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 431, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 361, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 364, - "end": 431, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 381, - "ctxt": 0 - }, - "value": "GenericComponent", - "optional": false - }, - "span": { - "start": 364, - "end": 431, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 382, - "end": 408, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 395, - "ctxt": 0 - }, - "value": "initialValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 396, - "end": 408, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 397, - "end": 407, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 399, - "end": 400, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 402, - "end": 405, - "ctxt": 0 - }, - "value": "y", - "raw": "\"y\"" - } - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 409, - "end": 428, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 409, - "end": 419, - "ctxt": 0 - }, - "value": "nextValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 420, - "end": 428, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 421, - "end": 427, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 426, - "end": 427, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 445, - "end": 513, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 449, - "end": 512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 449, - "end": 450, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 453, - "end": 512, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 454, - "end": 470, - "ctxt": 0 - }, - "value": "GenericComponent", - "optional": false - }, - "span": { - "start": 453, - "end": 512, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 471, - "end": 489, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 471, - "end": 484, - "ctxt": 0 - }, - "value": "initialValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 485, - "end": 489, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 486, - "end": 488, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 490, - "end": 509, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 490, - "end": 500, - "ctxt": 0 - }, - "value": "nextValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 501, - "end": 509, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 502, - "end": 508, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 502, - "end": 503, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 507, - "end": 508, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 622, - "end": 709, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 626, - "end": 708, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 626, - "end": 627, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 630, - "end": 708, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 631, - "end": 647, - "ctxt": 0 - }, - "value": "GenericComponent", - "optional": false - }, - "span": { - "start": 630, - "end": 708, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 648, - "end": 674, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 648, - "end": 661, - "ctxt": 0 - }, - "value": "initialValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 662, - "end": 674, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 663, - "end": 673, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 665, - "end": 666, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 668, - "end": 671, - "ctxt": 0 - }, - "value": "y", - "raw": "\"y\"" - } - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 675, - "end": 705, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 675, - "end": 685, - "ctxt": 0 - }, - "value": "nextValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 686, - "end": 705, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 687, - "end": 704, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 687, - "end": 688, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 692, - "end": 704, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 693, - "end": 703, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 695, - "end": 696, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 698, - "end": 701, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 698, - "end": 699, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 700, - "end": 701, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - ] - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 722, - "end": 800, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 726, - "end": 799, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 726, - "end": 727, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 730, - "end": 799, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 731, - "end": 747, - "ctxt": 0 - }, - "value": "GenericComponent", - "optional": false - }, - "span": { - "start": 730, - "end": 799, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 748, - "end": 774, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 748, - "end": 761, - "ctxt": 0 - }, - "value": "initialValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 762, - "end": 774, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 763, - "end": 773, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 765, - "end": 766, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 768, - "end": 771, - "ctxt": 0 - }, - "value": "y", - "raw": "\"y\"" - } - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 775, - "end": 796, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 775, - "end": 785, - "ctxt": 0 - }, - "value": "nextValues", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 786, - "end": 796, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 787, - "end": 795, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 787, - "end": 788, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 792, - "end": 795, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 792, - "end": 793, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 794, - "end": 795, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxIntersectionElementPropsType.json b/crates/swc_ecma_parser/tests/tsc/checkJsxIntersectionElementPropsType.json deleted file mode 100644 index a8538dfe742..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxIntersectionElementPropsType.json +++ /dev/null @@ -1,687 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 339, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 35, - "end": 115, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 57, - "end": 115, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 63, - "end": 113, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 73, - "end": 98, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 99, - "end": 113, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 101, - "end": 111, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 101, - "end": 106, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 106, - "end": 110, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 108, - "end": 110, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 131, - "end": 140, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": true, - "span": { - "start": 117, - "end": 213, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 148, - "end": 180, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 148, - "end": 159, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 160, - "end": 178, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 160, - "end": 178, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 167, - "end": 178, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 167, - "end": 175, - "ctxt": 0 - }, - "value": "Readonly", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassProperty", - "span": { - "start": 183, - "end": 211, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 192, - "end": 197, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 197, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 199, - "end": 210, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 199, - "end": 207, - "ctxt": 0 - }, - "value": "Readonly", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": true, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 140, - "end": 143, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 221, - "end": 222, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 215, - "end": 268, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 234, - "end": 243, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 222, - "end": 225, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 243, - "end": 265, - "ctxt": 0 - }, - "params": [ - { - "type": "TsIntersectionType", - "span": { - "start": 244, - "end": 264, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 244, - "end": 260, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 246, - "end": 258, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 248, - "end": 257, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 250, - "end": 257, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeReference", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 269, - "end": 306, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 275, - "end": 305, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 275, - "end": 276, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 279, - "end": 305, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 283, - "end": 284, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 285, - "end": 304, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 286, - "end": 292, - "ctxt": 0 - }, - "value": "foobar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 294, - "end": 303, - "ctxt": 0 - }, - "value": "example", - "raw": "\"example\"" - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 307, - "end": 339, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 313, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 317, - "end": 339, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 319, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "span": { - "start": 317, - "end": 339, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 320, - "end": 336, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 320, - "end": 326, - "ctxt": 0 - }, - "value": "foobar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "value": "example", - "raw": "\"example\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxSubtleSkipContextSensitiveBug.json b/crates/swc_ecma_parser/tests/tsc/checkJsxSubtleSkipContextSensitiveBug.json deleted file mode 100644 index bba6a379b00..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxSubtleSkipContextSensitiveBug.json +++ /dev/null @@ -1,997 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 627, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 112, - "end": 143, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 145, - "end": 182, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 166, - "ctxt": 0 - }, - "value": "ErrorResult", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 167, - "end": 182, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 169, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 169, - "end": 174, - "ctxt": 0 - }, - "value": "error", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 176, - "end": 180, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 176, - "end": 180, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 184, - "end": 336, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 194, - "end": 210, - "ctxt": 0 - }, - "value": "AsyncLoaderProps", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 211, - "end": 218, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 211, - "end": 218, - "ctxt": 0 - }, - "value": "TResult", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 220, - "end": 336, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 226, - "end": 265, - "ctxt": 0 - }, - "readonly": true, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 240, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 240, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 242, - "end": 264, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 245, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 248, - "end": 264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 255, - "end": 264, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 256, - "end": 263, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 256, - "end": 263, - "ctxt": 0 - }, - "value": "TResult", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 271, - "end": 334, - "ctxt": 0 - }, - "readonly": true, - "key": { - "type": "Identifier", - "span": { - "start": 280, - "end": 285, - "ctxt": 0 - }, - "value": "prop2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 285, - "end": 333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 287, - "end": 333, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 288, - "end": 325, - "ctxt": 0 - }, - "value": "result", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 325, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 296, - "end": 325, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 296, - "end": 303, - "ctxt": 0 - }, - "value": "Exclude", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 303, - "end": 325, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "value": "TResult", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 313, - "end": 324, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 313, - "end": 324, - "ctxt": 0 - }, - "value": "ErrorResult", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 327, - "end": 333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 344, - "end": 355, - "ctxt": 0 - }, - "value": "AsyncLoader", - "optional": false - }, - "declare": false, - "span": { - "start": 338, - "end": 449, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 422, - "end": 447, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 422, - "end": 428, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 422, - "end": 447, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 431, - "end": 447, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 433, - "end": 445, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 440, - "end": 444, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 373, - "end": 388, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 373, - "end": 378, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 379, - "end": 388, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 355, - "end": 364, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 356, - "end": 363, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 356, - "end": 363, - "ctxt": 0 - }, - "value": "TResult", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 388, - "end": 415, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 389, - "end": 414, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 389, - "end": 405, - "ctxt": 0 - }, - "value": "AsyncLoaderProps", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 405, - "end": 414, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 406, - "end": 413, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 406, - "end": 413, - "ctxt": 0 - }, - "value": "TResult", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - }, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 466, - "end": 470, - "ctxt": 0 - }, - "value": "load", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 451, - "end": 548, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 515, - "end": 548, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 521, - "end": 546, - "ctxt": 0 - }, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 528, - "end": 545, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 530, - "end": 537, - "ctxt": 0 - }, - "value": "success", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 539, - "end": 543, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 472, - "end": 514, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 474, - "end": 514, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 474, - "end": 481, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 481, - "end": 514, - "ctxt": 0 - }, - "params": [ - { - "type": "TsUnionType", - "span": { - "start": 482, - "end": 513, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 482, - "end": 499, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 484, - "end": 497, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 484, - "end": 491, - "ctxt": 0 - }, - "value": "success", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 491, - "end": 497, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 493, - "end": 497, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 493, - "end": 497, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeReference", - "span": { - "start": 502, - "end": 513, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 502, - "end": 513, - "ctxt": 0 - }, - "value": "ErrorResult", - "optional": false - }, - "typeParams": null - } - ] - } - ] - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 550, - "end": 627, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 556, - "end": 626, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 556, - "end": 562, - "ctxt": 0 - }, - "value": "loader", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 565, - "end": 626, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 566, - "end": 577, - "ctxt": 0 - }, - "value": "AsyncLoader", - "optional": false - }, - "span": { - "start": 565, - "end": 626, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 582, - "end": 594, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 582, - "end": 587, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 588, - "end": 594, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 589, - "end": 593, - "ctxt": 0 - }, - "value": "load", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 599, - "end": 623, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 599, - "end": 604, - "ctxt": 0 - }, - "value": "prop2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 605, - "end": 623, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 606, - "end": 622, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 606, - "end": 612, - "ctxt": 0 - }, - "value": "result", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 616, - "end": 622, - "ctxt": 0 - }, - "value": "result", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/checkJsxUnionSFXContextualTypeInferredCorrectly.json b/crates/swc_ecma_parser/tests/tsc/checkJsxUnionSFXContextualTypeInferredCorrectly.json deleted file mode 100644 index 17d84ea7fa6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/checkJsxUnionSFXContextualTypeInferredCorrectly.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 103, - "end": 819, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 103, - "end": 129, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "span": { - "start": 110, - "end": 115, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 110, - "end": 115, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 121, - "end": 128, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 131, - "end": 248, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 141, - "end": 143, - "ctxt": 0 - }, - "value": "PS", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 144, - "end": 248, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 150, - "end": 162, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 150, - "end": 155, - "ctxt": 0 - }, - "value": "multi", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 155, - "end": 162, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 157, - "end": 162, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 157, - "end": 162, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 167, - "end": 192, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 167, - "end": 172, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 192, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 174, - "end": 192, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 183, - "end": 192, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 197, - "end": 246, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 205, - "ctxt": 0 - }, - "value": "onChange", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 205, - "end": 246, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 207, - "end": 246, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 208, - "end": 237, - "ctxt": 0 - }, - "value": "selection", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 217, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 219, - "end": 237, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 219, - "end": 225, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 228, - "end": 237, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 246, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 242, - "end": 246, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 250, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 260, - "end": 262, - "ctxt": 0 - }, - "value": "PM", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 263, - "end": 346, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 269, - "end": 280, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - }, - "value": "multi", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 274, - "end": 280, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 276, - "end": 280, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 276, - "end": 280, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 285, - "end": 300, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 285, - "end": 290, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 290, - "end": 300, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 292, - "end": 300, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 292, - "end": 298, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 305, - "end": 344, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 305, - "end": 313, - "ctxt": 0 - }, - "value": "onChange", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 315, - "end": 344, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 316, - "end": 335, - "ctxt": 0 - }, - "value": "selection", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 325, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 327, - "end": 335, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 327, - "end": 333, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 337, - "end": 344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 340, - "end": 344, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 348, - "end": 424, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 364, - "end": 382, - "ctxt": 0 - }, - "value": "ComponentWithUnion", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 397, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 390, - "end": 397, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 390, - "end": 392, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 390, - "end": 392, - "ctxt": 0 - }, - "value": "PM", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 395, - "end": 397, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 395, - "end": 397, - "ctxt": 0 - }, - "value": "PS", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 355, - "end": 424, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 399, - "end": 424, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 405, - "end": 422, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 412, - "end": 421, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 413, - "end": 415, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 412, - "end": 416, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 416, - "end": 421, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 420, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 450, - "end": 669, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 466, - "end": 480, - "ctxt": 0 - }, - "value": "HereIsTheError", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 457, - "end": 669, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 483, - "end": 669, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 489, - "end": 667, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 496, - "end": 666, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 506, - "end": 660, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 507, - "end": 525, - "ctxt": 0 - }, - "value": "ComponentWithUnion", - "optional": false - }, - "span": { - "start": 506, - "end": 660, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 538, - "end": 551, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 538, - "end": 543, - "ctxt": 0 - }, - "value": "multi", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 544, - "end": 551, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 545, - "end": 550, - "ctxt": 0 - }, - "value": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 564, - "end": 575, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 564, - "end": 569, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 570, - "end": 575, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 571, - "end": 574, - "ctxt": 0 - }, - "value": "s", - "raw": "'s'" - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 588, - "end": 622, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 588, - "end": 596, - "ctxt": 0 - }, - "value": "onChange", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 597, - "end": 622, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 598, - "end": 621, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 598, - "end": 601, - "ctxt": 0 - }, - "value": "val", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 605, - "end": 621, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 605, - "end": 616, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 605, - "end": 612, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 613, - "end": 616, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "value": "val", - "optional": false - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 701, - "end": 819, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 701, - "end": 818, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 701, - "end": 719, - "ctxt": 0 - }, - "value": "ComponentWithUnion", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 720, - "end": 817, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 726, - "end": 731, - "ctxt": 0 - }, - "value": "multi", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 733, - "end": 738, - "ctxt": 0 - }, - "value": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 744, - "end": 749, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 751, - "end": 754, - "ctxt": 0 - }, - "value": "s", - "raw": "'s'" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 760, - "end": 768, - "ctxt": 0 - }, - "value": "onChange", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 770, - "end": 793, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 770, - "end": 773, - "ctxt": 0 - }, - "value": "val", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 777, - "end": 793, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 777, - "end": 788, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 777, - "end": 784, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 785, - "end": 788, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 789, - "end": 792, - "ctxt": 0 - }, - "value": "val", - "optional": false - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.json b/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.json deleted file mode 100644 index 44140977d0b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 175, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 175, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 40, - "end": 57, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 53, - "end": 54, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 40, - "end": 57, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 61, - "end": 92, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 74, - "end": 76, - "ctxt": 0 - }, - "value": "aa", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 61, - "end": 92, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 79, - "end": 92, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 81, - "end": 90, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 123, - "end": 129, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 135, - "end": 164, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 148, - "end": 150, - "ctxt": 0 - }, - "value": "bb", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 151, - "end": 160, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 151, - "end": 160, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 160, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 154, - "end": 160, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 135, - "end": 164, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 162, - "end": 164, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.ts deleted file mode 100644 index 56cf976d018..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractAccessor.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: es5 - -abstract class A { - abstract get a(); - abstract get aa() { return 1; } // error - abstract set b(x: string); - abstract set bb(x: string) {} // error -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.json b/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.json deleted file mode 100644 index c939a81a67d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 24, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 44, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 47, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.ts deleted file mode 100644 index 3701fa36430..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractConstructor.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract class A { - abstract constructor() {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.json b/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.json deleted file mode 100644 index 1ac7d1de882..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.json +++ /dev/null @@ -1,439 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 437, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": true, - "span": { - "start": 1, - "end": 59, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 32, - "end": 57, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 41, - "end": 52, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 55, - "end": 57, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 84, - "end": 86, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "declare": true, - "span": { - "start": 61, - "end": 110, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 93, - "end": 108, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 93, - "end": 108, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 135, - "end": 137, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "declare": true, - "span": { - "start": 112, - "end": 151, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 146, - "end": 148, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 167, - "end": 169, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "declare": true, - "span": { - "start": 153, - "end": 183, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 178, - "end": 180, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 199, - "end": 201, - "ctxt": 0 - }, - "value": "DD", - "optional": false - }, - "declare": true, - "span": { - "start": 185, - "end": 215, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 210, - "end": 212, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 240, - "end": 242, - "ctxt": 0 - }, - "value": "EE", - "optional": false - }, - "declare": true, - "span": { - "start": 217, - "end": 256, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 251, - "end": 253, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 272, - "end": 274, - "ctxt": 0 - }, - "value": "FF", - "optional": false - }, - "declare": true, - "span": { - "start": 258, - "end": 288, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 283, - "end": 285, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 313, - "end": 315, - "ctxt": 0 - }, - "value": "GG", - "optional": false - }, - "declare": true, - "span": { - "start": 290, - "end": 329, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 324, - "end": 326, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 354, - "end": 357, - "ctxt": 0 - }, - "value": "AAA", - "optional": false - }, - "declare": true, - "span": { - "start": 331, - "end": 360, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 385, - "end": 388, - "ctxt": 0 - }, - "value": "BBB", - "optional": false - }, - "declare": true, - "span": { - "start": 362, - "end": 403, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 397, - "end": 400, - "ctxt": 0 - }, - "value": "AAA", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 419, - "end": 422, - "ctxt": 0 - }, - "value": "CCC", - "optional": false - }, - "declare": true, - "span": { - "start": 405, - "end": 437, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 431, - "end": 434, - "ctxt": 0 - }, - "value": "AAA", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.ts deleted file mode 100644 index f30bb716b15..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractDeclarations.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -declare abstract class A { - abstract constructor() {} -} - -declare abstract class AA { - abstract foo(); -} - -declare abstract class BB extends AA {} - -declare class CC extends AA {} - -declare class DD extends BB {} - -declare abstract class EE extends BB {} - -declare class FF extends CC {} - -declare abstract class GG extends CC {} - -declare abstract class AAA {} - -declare abstract class BBB extends AAA {} - -declare class CCC extends AAA {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.json b/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.json deleted file mode 100644 index a0c27369b3e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.json +++ /dev/null @@ -1,1579 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 1119, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 25, - "end": 115, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 48, - "end": 84, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 48, - "end": 51, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 48, - "end": 84, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 62, - "end": 84, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 64, - "end": 82, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 71, - "end": 81, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 71, - "end": 79, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 71, - "end": 75, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 61, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 55, - "end": 61, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 98, - "end": 101, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 104, - "end": 112, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 106, - "end": 112, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 117, - "end": 122, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 121, - "end": 122, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "arguments": null, - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 134, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 138, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 140, - "ctxt": 0 - }, - "value": "BB", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 142, - "end": 150, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeArguments": null - } - } - }, - "init": { - "type": "Identifier", - "span": { - "start": 153, - "end": 154, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 178, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 162, - "ctxt": 0 - }, - "value": "AA", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 162, - "end": 172, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 164, - "end": 172, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 171, - "end": 172, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - } - }, - "init": { - "type": "Identifier", - "span": { - "start": 175, - "end": 177, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 217, - "end": 224, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 217, - "end": 223, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 221, - "end": 223, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "arguments": null, - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 245, - "ctxt": 0 - }, - "value": "constructB", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "value": "Factory", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 254, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 256, - "end": 264, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeArguments": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 226, - "end": 327, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 266, - "end": 327, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 272, - "end": 284, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 272, - "end": 283, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 276, - "end": 283, - "ctxt": 0 - }, - "value": "Factory", - "optional": false - }, - "arguments": null, - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 329, - "end": 340, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 333, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "value": "BB", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 338, - "end": 339, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 341, - "end": 348, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 341, - "end": 347, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 345, - "end": 347, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "arguments": null, - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 386, - "end": 402, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 390, - "end": 401, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 392, - "end": 397, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": { - "type": "Identifier", - "span": { - "start": 400, - "end": 401, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 403, - "end": 409, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 403, - "end": 408, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 407, - "end": 408, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "arguments": null, - "typeArguments": null - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 458, - "end": 459, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 452, - "end": 473, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 468, - "end": 469, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 524, - "end": 525, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 509, - "end": 539, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 534, - "end": 535, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 555, - "end": 556, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": false, - "span": { - "start": 549, - "end": 632, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 611, - "end": 630, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 611, - "end": 614, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 611, - "end": 630, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 617, - "end": 630, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 619, - "end": 628, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 626, - "end": 627, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 565, - "end": 566, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 649, - "end": 650, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "declare": false, - "span": { - "start": 634, - "end": 717, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 667, - "end": 691, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 676, - "end": 679, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 667, - "end": 691, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 682, - "end": 690, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 684, - "end": 690, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 696, - "end": 715, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 696, - "end": 699, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 696, - "end": 715, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 702, - "end": 715, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 704, - "end": 713, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 711, - "end": 712, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 659, - "end": 660, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 734, - "end": 735, - "ctxt": 0 - }, - "value": "G", - "optional": false - }, - "declare": false, - "span": { - "start": 719, - "end": 1043, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 742, - "end": 776, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 751, - "end": 754, - "ctxt": 0 - }, - "value": "qux", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 755, - "end": 765, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 755, - "end": 765, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 757, - "end": 765, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 759, - "end": 765, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 742, - "end": 776, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 767, - "end": 775, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 769, - "end": 775, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 781, - "end": 805, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 790, - "end": 793, - "ctxt": 0 - }, - "value": "qux", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 781, - "end": 805, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 796, - "end": 804, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 798, - "end": 804, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 810, - "end": 821, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 810, - "end": 811, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 812, - "end": 820, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 814, - "end": 820, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 826, - "end": 873, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 835, - "end": 838, - "ctxt": 0 - }, - "value": "quz", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 839, - "end": 849, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 839, - "end": 849, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 841, - "end": 849, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 843, - "end": 849, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 851, - "end": 861, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 851, - "end": 861, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 853, - "end": 861, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 855, - "end": 861, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 826, - "end": 873, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 863, - "end": 872, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 865, - "end": 872, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 921, - "end": 945, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 930, - "end": 933, - "ctxt": 0 - }, - "value": "nom", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 921, - "end": 945, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 935, - "end": 944, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 937, - "end": 944, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 950, - "end": 975, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 950, - "end": 953, - "ctxt": 0 - }, - "value": "nom", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 954, - "end": 964, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 954, - "end": 964, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 956, - "end": 964, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 958, - "end": 964, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 950, - "end": 975, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 965, - "end": 974, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 967, - "end": 974, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1051, - "end": 1052, - "ctxt": 0 - }, - "value": "H", - "optional": false - }, - "declare": false, - "span": { - "start": 1045, - "end": 1119, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1093, - "end": 1117, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1102, - "end": 1105, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1093, - "end": 1117, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1108, - "end": 1116, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1110, - "end": 1116, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.ts deleted file mode 100644 index c9b62c619f0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractInstantiations2.ts +++ /dev/null @@ -1,51 +0,0 @@ -class A { - // ... -} - -abstract class B { - foo(): number { return this.bar(); } - abstract bar() : number; -} - -new B; // error - -var BB: typeof B = B; -var AA: typeof A = BB; // error, AA is not of abstract type. -new AA; - -function constructB(Factory : typeof B) { - new Factory; // error -- Factory is of type typeof B. -} - -var BB = B; -new BB; // error -- BB is of type typeof B. - -var x : any = C; -new x; // okay -- undefined behavior at runtime - -class C extends B { } // error -- not declared abstract - -abstract class D extends B { } // okay - -class E extends B { // okay -- implements abstract method - bar() { return 1; } -} - -abstract class F extends B { - abstract foo() : number; - bar() { return 2; } -} - -abstract class G { - abstract qux(x : number) : string; - abstract qux() : number; - y : number; - abstract quz(x : number, y : string) : boolean; // error -- declarations must be adjacent - - abstract nom(): boolean; - nom(x : number): boolean; // error -- use of modifier abstract must match on all overloads. -} - -class H { // error -- not declared abstract - abstract baz() : number; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.ts deleted file mode 100644 index 68d0f560350..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.ts +++ /dev/null @@ -1,7 +0,0 @@ -class A { - abstract foo(); -} - -class B { - abstract foo() {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.json b/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.json deleted file mode 100644 index 3f43f70bcc5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 43, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 43, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 24, - "end": 41, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 24, - "end": 41, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 41, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.ts deleted file mode 100644 index 8d0f6d239ab..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodWithImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract class A { - abstract foo() {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.json b/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.json deleted file mode 100644 index 22ad398af41..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.json +++ /dev/null @@ -1,497 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 334, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 334, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 24, - "end": 44, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 43, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 37, - "end": 43, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 49, - "end": 76, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 67, - "end": 75, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 69, - "end": 75, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 81, - "end": 111, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 100, - "end": 101, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 102, - "end": 110, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 104, - "end": 110, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "protected", - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 116, - "end": 144, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": "w", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 154, - "end": 177, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 163, - "end": 164, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 176, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 166, - "end": 176, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 176, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 172, - "end": 176, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 188, - "end": 214, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 202, - "ctxt": 0 - }, - "value": "foo_x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 188, - "end": 214, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 205, - "end": 213, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 207, - "end": 213, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 219, - "end": 252, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 240, - "ctxt": 0 - }, - "value": "foo_y", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 219, - "end": 252, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 243, - "end": 251, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 245, - "end": 251, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 257, - "end": 293, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 276, - "end": 281, - "ctxt": 0 - }, - "value": "foo_z", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 257, - "end": 293, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 284, - "end": 292, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 286, - "end": 292, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "protected", - "isAbstract": true, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 298, - "end": 332, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "value": "foo_w", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 298, - "end": 332, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 323, - "end": 331, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 325, - "end": 331, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.ts deleted file mode 100644 index d7287189f84..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractProperties.ts +++ /dev/null @@ -1,13 +0,0 @@ -abstract class A { - abstract x : number; - public abstract y : number; - protected abstract z : number; - private abstract w : number; - - abstract m: () => void; - - abstract foo_x() : number; - public abstract foo_y() : number; - protected abstract foo_z() : number; - private abstract foo_w() : number; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.json b/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.json deleted file mode 100644 index fcc37c4b4c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.json +++ /dev/null @@ -1,527 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 306, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 15, - "end": 30, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 24, - "end": 27, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 15, - "end": 30, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 34, - "end": 55, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 72, - "end": 73, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 57, - "end": 86, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 88, - "end": 122, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 112, - "end": 120, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 112, - "end": 120, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 118, - "end": 120, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 104, - "end": 105, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 139, - "end": 140, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": false, - "span": { - "start": 124, - "end": 167, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 157, - "end": 160, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 163, - "end": 165, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 184, - "end": 186, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "declare": false, - "span": { - "start": 169, - "end": 210, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 193, - "end": 208, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 205, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 193, - "end": 208, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 218, - "end": 220, - "ctxt": 0 - }, - "value": "BB", - "optional": false - }, - "declare": false, - "span": { - "start": 212, - "end": 235, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 229, - "end": 231, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 252, - "end": 254, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "declare": false, - "span": { - "start": 237, - "end": 268, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 263, - "end": 265, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 276, - "end": 278, - "ctxt": 0 - }, - "value": "DD", - "optional": false - }, - "declare": false, - "span": { - "start": 270, - "end": 306, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 296, - "end": 304, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 296, - "end": 299, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 296, - "end": 304, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 302, - "end": 304, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 287, - "end": 289, - "ctxt": 0 - }, - "value": "AA", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.ts deleted file mode 100644 index 337bfe0975c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractUsingAbstractMethods2.ts +++ /dev/null @@ -1,27 +0,0 @@ -class A { - abstract foo(); -} - -class B extends A {} - -abstract class C extends A {} - -class D extends A { - foo() {} -} - -abstract class E extends A { - foo() {} -} - -abstract class AA { - abstract foo(); -} - -class BB extends AA {} - -abstract class CC extends AA {} - -class DD extends AA { - foo() {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.json b/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.json deleted file mode 100644 index 78005f2af65..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 22, - "end": 24, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.ts b/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.ts deleted file mode 100644 index 17b89868943..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractWithInterface.ts +++ /dev/null @@ -1 +0,0 @@ -abstract interface I {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.json b/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.json deleted file mode 100644 index 0a237d5959c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 67, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 67, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "StaticBlock", - "span": { - "start": 15, - "end": 65, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 37, - "end": 65, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.ts b/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.ts deleted file mode 100644 index 6bf40961194..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock19.ts +++ /dev/null @@ -1,6 +0,0 @@ -class C { - @decorator - static { - // something - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.json b/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.json deleted file mode 100644 index 373c2e31e36..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.json +++ /dev/null @@ -1,578 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 29, - "end": 306, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 29, - "end": 80, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 35, - "end": 80, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 39, - "ctxt": 0 - }, - "value": "nums", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 42, - "end": 80, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 42, - "end": 55, - "ctxt": 0 - }, - "object": { - "type": "ArrayExpression", - "span": { - "start": 42, - "end": 51, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - }, - "property": { - "type": "Identifier", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "value": "map", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 56, - "end": 79, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 61, - "end": 79, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 61, - "end": 76, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 61, - "end": 68, - "ctxt": 0 - }, - "value": "Promise", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 69, - "end": 76, - "ctxt": 0 - }, - "value": "resolve", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 77, - "end": 78, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 82, - "end": 173, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "StaticBlock", - "span": { - "start": 94, - "end": 171, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 101, - "end": 171, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForOfStatement", - "span": { - "start": 107, - "end": 167, - "ctxt": 0 - }, - "await": { - "start": 111, - "end": 116, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 118, - "end": 126, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 124, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 124, - "end": 126, - "ctxt": 0 - }, - "value": "nn", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "value": "nums", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 136, - "end": 167, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 146, - "end": 161, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 146, - "end": 161, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 146, - "end": 157, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 146, - "end": 153, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 154, - "end": 157, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 158, - "end": 160, - "ctxt": 0 - }, - "value": "nn", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - } - } - ] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 190, - "end": 193, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 175, - "end": 306, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 197, - "end": 306, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 201, - "end": 304, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "StaticBlock", - "span": { - "start": 215, - "end": 300, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 222, - "end": 300, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForOfStatement", - "span": { - "start": 230, - "end": 294, - "ctxt": 0 - }, - "await": { - "start": 234, - "end": 239, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 241, - "end": 249, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 247, - "end": 249, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 247, - "end": 249, - "ctxt": 0 - }, - "value": "nn", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 253, - "end": 257, - "ctxt": 0 - }, - "value": "nums", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 259, - "end": 294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 271, - "end": 286, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 271, - "end": 286, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 271, - "end": 282, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 271, - "end": 278, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 283, - "end": 285, - "ctxt": 0 - }, - "value": "nn", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - } - } - ] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "generator": false, - "async": true, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.ts b/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.ts deleted file mode 100644 index 80422760d1c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock23.ts +++ /dev/null @@ -1,21 +0,0 @@ -// @target: esnext, es2022 - -const nums = [1, 2, 3].map(n => Promise.resolve(n)) - -class C { - static { - for await (const nn of nums) { - console.log(nn) - } - } -} - -async function foo () { - class C { - static { - for await (const nn of nums) { - console.log(nn) - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.json b/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.json deleted file mode 100644 index b34ee8797a8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.json +++ /dev/null @@ -1,1039 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 1077, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 10, - "end": 13, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 16, - "end": 24, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 18, - "end": 24, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1, - "end": 1077, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 26, - "end": 1077, - "ctxt": 0 - }, - "stmts": [ - { - "type": "LabeledStatement", - "span": { - "start": 32, - "end": 666, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 32, - "end": 37, - "ctxt": 0 - }, - "value": "label", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 39, - "end": 666, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 666, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 59, - "end": 433, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "StaticBlock", - "span": { - "start": 81, - "end": 423, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 88, - "end": 423, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 106, - "end": 171, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 110, - "end": 117, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 119, - "end": 171, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 141, - "end": 153, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 147, - "end": 152, - "ctxt": 0 - }, - "value": "label", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 188, - "end": 256, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 192, - "end": 199, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 198, - "end": 199, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 201, - "end": 256, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 223, - "end": 238, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 232, - "end": 237, - "ctxt": 0 - }, - "value": "label", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 273, - "end": 331, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 277, - "end": 284, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 277, - "end": 278, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 283, - "end": 284, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 286, - "end": 331, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 308, - "end": 313, - "ctxt": 0 - }, - "label": null - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 348, - "end": 409, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 352, - "end": 359, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 361, - "end": 409, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 383, - "end": 391, - "ctxt": 0 - }, - "label": null - } - ] - }, - "alternate": null - } - ] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "IfStatement", - "span": { - "start": 443, - "end": 492, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 447, - "end": 454, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 447, - "end": 448, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 453, - "end": 454, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 456, - "end": 492, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 470, - "end": 482, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 476, - "end": 481, - "ctxt": 0 - }, - "value": "label", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 501, - "end": 553, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 505, - "end": 512, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 505, - "end": 506, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 511, - "end": 512, - "ctxt": 0 - }, - "value": 6.0, - "raw": "6" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 514, - "end": 553, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 528, - "end": 543, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 537, - "end": 542, - "ctxt": 0 - }, - "value": "label", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 562, - "end": 605, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 566, - "end": 573, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 566, - "end": 567, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 572, - "end": 573, - "ctxt": 0 - }, - "value": 7.0, - "raw": "7" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 575, - "end": 605, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 589, - "end": 595, - "ctxt": 0 - }, - "label": null - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 614, - "end": 660, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 618, - "end": 625, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 618, - "end": 619, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 624, - "end": 625, - "ctxt": 0 - }, - "value": 8.0, - "raw": "8" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 627, - "end": 660, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 641, - "end": 650, - "ctxt": 0 - }, - "label": null - } - ] - }, - "alternate": null - } - ] - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 678, - "end": 679, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 672, - "end": 1075, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "StaticBlock", - "span": { - "start": 690, - "end": 1069, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 697, - "end": 1069, - "ctxt": 0 - }, - "stmts": [ - { - "type": "LabeledStatement", - "span": { - "start": 711, - "end": 730, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 711, - "end": 716, - "ctxt": 0 - }, - "value": "outer", - "optional": false - }, - "body": { - "type": "BreakStatement", - "span": { - "start": 718, - "end": 730, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 724, - "end": 729, - "ctxt": 0 - }, - "value": "outer", - "optional": false - } - } - }, - { - "type": "LabeledStatement", - "span": { - "start": 752, - "end": 979, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 752, - "end": 756, - "ctxt": 0 - }, - "value": "loop", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 758, - "end": 979, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 765, - "end": 766, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 768, - "end": 979, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 786, - "end": 810, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 790, - "end": 797, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 790, - "end": 791, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 796, - "end": 797, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BreakStatement", - "span": { - "start": 799, - "end": 810, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 805, - "end": 809, - "ctxt": 0 - }, - "value": "loop", - "optional": false - } - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 836, - "end": 863, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 840, - "end": 847, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 840, - "end": 841, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 846, - "end": 847, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "ContinueStatement", - "span": { - "start": 849, - "end": 863, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 858, - "end": 862, - "ctxt": 0 - }, - "value": "loop", - "optional": false - } - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 889, - "end": 908, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 893, - "end": 900, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 893, - "end": 894, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 899, - "end": 900, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - }, - "consequent": { - "type": "BreakStatement", - "span": { - "start": 902, - "end": 908, - "ctxt": 0 - }, - "label": null - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 934, - "end": 956, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 938, - "end": 945, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 938, - "end": 939, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 944, - "end": 945, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - }, - "consequent": { - "type": "ContinueStatement", - "span": { - "start": 947, - "end": 956, - "ctxt": 0 - }, - "label": null - }, - "alternate": null - } - ] - } - } - }, - { - "type": "SwitchStatement", - "span": { - "start": 992, - "end": 1059, - "ctxt": 0 - }, - "discriminant": { - "type": "Identifier", - "span": { - "start": 1000, - "end": 1001, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "cases": [ - { - "type": "SwitchCase", - "span": { - "start": 1021, - "end": 1036, - "ctxt": 0 - }, - "test": null, - "consequent": [ - { - "type": "BreakStatement", - "span": { - "start": 1030, - "end": 1036, - "ctxt": 0 - }, - "label": null - } - ] - } - ] - } - ] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.ts b/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.ts deleted file mode 100644 index f616a8ea0b4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlock8.ts +++ /dev/null @@ -1,48 +0,0 @@ -function foo (v: number) { - label: while (v) { - class C { - static { - if (v === 1) { - break label; - } - if (v === 2) { - continue label; - } - if (v === 3) { - break - } - if (v === 4) { - continue - } - } - } - - if (v === 5) { - break label; - } - if (v === 6) { - continue label; - } - if (v === 7) { - break; - } - if (v === 8) { - continue; - } - } - - class C { - static { - outer: break outer; // valid - loop: while (v) { - if (v === 1) break loop; // valid - if (v === 2) continue loop; // valid - if (v === 3) break; // valid - if (v === 4) continue; // valid - } - switch (v) { - default: break; // valid - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.json b/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.json deleted file mode 100644 index fbbd60c9995..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.json +++ /dev/null @@ -1,308 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 63, - "end": 208, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 69, - "end": 70, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 63, - "end": 208, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 77, - "end": 86, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 84, - "end": 85, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "StaticBlock", - "span": { - "start": 91, - "end": 125, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 98, - "end": 125, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 108, - "end": 119, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 108, - "end": 118, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 108, - "end": 114, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 108, - "end": 112, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 113, - "end": 114, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - } - }, - { - "type": "ClassProperty", - "span": { - "start": 130, - "end": 148, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 141, - "end": 147, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 141, - "end": 145, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 153, - "end": 162, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "StaticBlock", - "span": { - "start": 167, - "end": 206, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 174, - "end": 206, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 184, - "end": 200, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 184, - "end": 199, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 184, - "end": 190, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 184, - "end": 188, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 189, - "end": 190, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 193, - "end": 197, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 198, - "end": 199, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - } - ] - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.ts b/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.ts deleted file mode 100644 index b5d87576e5b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/classStaticBlockUseBeforeDef1.ts +++ /dev/null @@ -1,15 +0,0 @@ -// @target: esnext, es2022 -// @noEmit: true -// @strict: true - -class C { - static x; - static { - this.x = 1; - } - static y = this.x; - static z; - static { - this.z = this.y; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.json b/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.json deleted file mode 100644 index 92198f2851d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.json +++ /dev/null @@ -1,400 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 486, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 149, - "end": 181, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 149, - "end": 180, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 150, - "end": 153, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 154, - "end": 174, - "ctxt": 0 - }, - "value": "\n\n // Not Comment\n\n", - "raw": "\n\n // Not Comment\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 176, - "end": 179, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 183, - "end": 282, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 183, - "end": 281, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 188, - "end": 212, - "ctxt": 0 - }, - "value": "\n\n // Not Comment\n\n ", - "raw": "\n\n // Not Comment\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 212, - "end": 247, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 246, - "end": 246, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 247, - "end": 275, - "ctxt": 0 - }, - "value": "\n\n // Another not Comment\n\n", - "raw": "\n\n // Another not Comment\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 275, - "end": 281, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 284, - "end": 396, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 284, - "end": 395, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 289, - "end": 313, - "ctxt": 0 - }, - "value": "\n\n // Not Comment\n\n ", - "raw": "\n\n // Not Comment\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 313, - "end": 361, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 351, - "end": 355, - "ctxt": 0 - }, - "value": "Hi", - "raw": "\"Hi\"" - } - }, - { - "type": "JSXText", - "span": { - "start": 361, - "end": 389, - "ctxt": 0 - }, - "value": "\n\n // Another not Comment\n\n", - "raw": "\n\n // Another not Comment\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 389, - "end": 395, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 391, - "end": 394, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 398, - "end": 486, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 398, - "end": 485, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 399, - "end": 402, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 398, - "end": 403, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 403, - "end": 430, - "ctxt": 0 - }, - "value": "\n\n /* Not Comment */\n\n ", - "raw": "\n\n /* Not Comment */\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 430, - "end": 478, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 468, - "end": 472, - "ctxt": 0 - }, - "value": "Hi", - "raw": "\"Hi\"" - } - }, - { - "type": "JSXText", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 479, - "end": 485, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 481, - "end": 484, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.tsx b/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.tsx index af0bccd8b32..c29785f7cc7 100644 --- a/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.tsx +++ b/crates/swc_ecma_parser/tests/tsc/commentEmittingInPreserveJsx1.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: preserve // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.json b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.json deleted file mode 100644 index 6a6347fb6db..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.json +++ /dev/null @@ -1,3729 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 1401, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 35, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 34, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 34, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 36, - "end": 51, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 40, - "end": 50, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 43, - "end": 50, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 52, - "end": 66, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 56, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 57, - "end": 65, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 59, - "end": 65, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 67, - "end": 79, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 72, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 72, - "end": 78, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 74, - "end": 78, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 80, - "end": 89, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 84, - "end": 88, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 84, - "end": 85, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 85, - "end": 88, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 105, - "end": 121, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 109, - "end": 120, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 109, - "end": 112, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 115, - "end": 120, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 119, - "end": 120, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 122, - "end": 138, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 126, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 132, - "end": 137, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 136, - "end": 137, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 139, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 143, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 153, - "end": 154, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 172, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 171, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 163, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 166, - "end": 171, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 173, - "end": 189, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 177, - "end": 188, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 177, - "end": 180, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 183, - "end": 184, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 187, - "end": 188, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 190, - "end": 212, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 194, - "end": 211, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 200, - "end": 211, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 200, - "end": 204, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 213, - "end": 245, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 217, - "end": 244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 217, - "end": 220, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 223, - "end": 244, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 223, - "end": 232, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 235, - "end": 244, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 261, - "end": 277, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 265, - "end": 276, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 268, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 271, - "end": 276, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 275, - "end": 276, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 278, - "end": 294, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 282, - "end": 293, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 282, - "end": 285, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 288, - "end": 293, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 295, - "end": 311, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 299, - "end": 310, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 299, - "end": 302, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 305, - "end": 310, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 312, - "end": 328, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 316, - "end": 327, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 322, - "end": 327, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 329, - "end": 345, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 333, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 333, - "end": 336, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 339, - "end": 344, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 339, - "end": 340, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 346, - "end": 368, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 350, - "end": 367, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 350, - "end": 353, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 356, - "end": 367, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 356, - "end": 360, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 363, - "end": 367, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 369, - "end": 401, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 373, - "end": 400, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 379, - "end": 400, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 379, - "end": 388, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 391, - "end": 400, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 418, - "end": 435, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 422, - "end": 434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 422, - "end": 425, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 428, - "end": 434, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 428, - "end": 429, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 433, - "end": 434, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 436, - "end": 453, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 440, - "end": 452, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 440, - "end": 443, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 446, - "end": 452, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 446, - "end": 447, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 454, - "end": 471, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 458, - "end": 470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 458, - "end": 461, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 464, - "end": 470, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 469, - "end": 470, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 472, - "end": 489, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 476, - "end": 488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 482, - "end": 488, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 490, - "end": 507, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 494, - "end": 506, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "value": "rc5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 500, - "end": 506, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 505, - "end": 506, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 508, - "end": 531, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 512, - "end": 530, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 512, - "end": 515, - "ctxt": 0 - }, - "value": "rc6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 518, - "end": 530, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 518, - "end": 522, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 532, - "end": 565, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 536, - "end": 564, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 536, - "end": 539, - "ctxt": 0 - }, - "value": "rc7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 542, - "end": 564, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 542, - "end": 551, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 555, - "end": 564, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 582, - "end": 599, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 586, - "end": 598, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 586, - "end": 589, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 592, - "end": 598, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 592, - "end": 593, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 597, - "end": 598, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 600, - "end": 617, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 604, - "end": 616, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 604, - "end": 607, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 610, - "end": 616, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 610, - "end": 611, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 615, - "end": 616, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 618, - "end": 635, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 622, - "end": 634, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 622, - "end": 625, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 628, - "end": 634, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 628, - "end": 629, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 633, - "end": 634, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 636, - "end": 653, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 640, - "end": 652, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 640, - "end": 643, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 646, - "end": 652, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 646, - "end": 647, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 654, - "end": 671, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 658, - "end": 670, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 658, - "end": 661, - "ctxt": 0 - }, - "value": "rd5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 664, - "end": 670, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 664, - "end": 665, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 669, - "end": 670, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 672, - "end": 695, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 676, - "end": 694, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 676, - "end": 679, - "ctxt": 0 - }, - "value": "rd6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 682, - "end": 694, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 682, - "end": 686, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 690, - "end": 694, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 696, - "end": 729, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 700, - "end": 728, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 700, - "end": 703, - "ctxt": 0 - }, - "value": "rd7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 706, - "end": 728, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 706, - "end": 715, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 719, - "end": 728, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 746, - "end": 763, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 750, - "end": 762, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 750, - "end": 753, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 756, - "end": 762, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 756, - "end": 757, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 761, - "end": 762, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 764, - "end": 781, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 768, - "end": 780, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 768, - "end": 771, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 774, - "end": 780, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 774, - "end": 775, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 779, - "end": 780, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 782, - "end": 799, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 786, - "end": 798, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 786, - "end": 789, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 792, - "end": 798, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 792, - "end": 793, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 797, - "end": 798, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 800, - "end": 817, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 804, - "end": 816, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 804, - "end": 807, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 810, - "end": 816, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 810, - "end": 811, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 815, - "end": 816, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 818, - "end": 835, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 822, - "end": 834, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 822, - "end": 825, - "ctxt": 0 - }, - "value": "re5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 828, - "end": 834, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 828, - "end": 829, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 833, - "end": 834, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 836, - "end": 859, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 840, - "end": 858, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 840, - "end": 843, - "ctxt": 0 - }, - "value": "re6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 846, - "end": 858, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 846, - "end": 850, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 854, - "end": 858, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 860, - "end": 893, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 864, - "end": 892, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 864, - "end": 867, - "ctxt": 0 - }, - "value": "re7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 870, - "end": 892, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 870, - "end": 879, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 883, - "end": 892, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 910, - "end": 927, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 914, - "end": 926, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 914, - "end": 917, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 920, - "end": 926, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 920, - "end": 921, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 925, - "end": 926, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 928, - "end": 945, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 932, - "end": 944, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 932, - "end": 935, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 938, - "end": 944, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 938, - "end": 939, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 943, - "end": 944, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 946, - "end": 963, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 950, - "end": 962, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 950, - "end": 953, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 956, - "end": 962, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 956, - "end": 957, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 961, - "end": 962, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 964, - "end": 981, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 968, - "end": 980, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 968, - "end": 971, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 974, - "end": 980, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 974, - "end": 975, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 979, - "end": 980, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 982, - "end": 999, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 986, - "end": 998, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 986, - "end": 989, - "ctxt": 0 - }, - "value": "rf5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 992, - "end": 998, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 992, - "end": 993, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 997, - "end": 998, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1000, - "end": 1023, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1004, - "end": 1022, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1004, - "end": 1007, - "ctxt": 0 - }, - "value": "rf6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1010, - "end": 1022, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1010, - "end": 1014, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1018, - "end": 1022, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1024, - "end": 1057, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1028, - "end": 1056, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1028, - "end": 1031, - "ctxt": 0 - }, - "value": "rf7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1034, - "end": 1056, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 1034, - "end": 1043, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1056, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1075, - "end": 1093, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1079, - "end": 1092, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1079, - "end": 1082, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1085, - "end": 1092, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1085, - "end": 1086, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1092, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1094, - "end": 1112, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1098, - "end": 1111, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1098, - "end": 1101, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1104, - "end": 1111, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1104, - "end": 1105, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1111, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1113, - "end": 1131, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1117, - "end": 1130, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1117, - "end": 1120, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1123, - "end": 1130, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1123, - "end": 1124, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1129, - "end": 1130, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1132, - "end": 1150, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1136, - "end": 1149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1136, - "end": 1139, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1142, - "end": 1149, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1142, - "end": 1143, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1148, - "end": 1149, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1151, - "end": 1169, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1155, - "end": 1168, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1155, - "end": 1158, - "ctxt": 0 - }, - "value": "rg5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1161, - "end": 1168, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1161, - "end": 1162, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1167, - "end": 1168, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1170, - "end": 1194, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1174, - "end": 1193, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1174, - "end": 1177, - "ctxt": 0 - }, - "value": "rg6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1180, - "end": 1193, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 1180, - "end": 1184, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1189, - "end": 1193, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1195, - "end": 1229, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1199, - "end": 1228, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1199, - "end": 1202, - "ctxt": 0 - }, - "value": "rg7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1205, - "end": 1228, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 1205, - "end": 1214, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1219, - "end": 1228, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1247, - "end": 1265, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1251, - "end": 1264, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1251, - "end": 1254, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1257, - "end": 1264, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1257, - "end": 1258, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1263, - "end": 1264, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1266, - "end": 1284, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1270, - "end": 1283, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1270, - "end": 1273, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1276, - "end": 1283, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1276, - "end": 1277, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1282, - "end": 1283, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1285, - "end": 1303, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1289, - "end": 1302, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1289, - "end": 1292, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1295, - "end": 1302, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1295, - "end": 1296, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1301, - "end": 1302, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1304, - "end": 1322, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1308, - "end": 1321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1308, - "end": 1311, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1314, - "end": 1321, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1314, - "end": 1315, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1320, - "end": 1321, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1323, - "end": 1341, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1327, - "end": 1340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1327, - "end": 1330, - "ctxt": 0 - }, - "value": "rh5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1333, - "end": 1340, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1333, - "end": 1334, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1339, - "end": 1340, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1342, - "end": 1366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1346, - "end": 1365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1346, - "end": 1349, - "ctxt": 0 - }, - "value": "rh6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1352, - "end": 1365, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1352, - "end": 1356, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1361, - "end": 1365, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1367, - "end": 1401, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1371, - "end": 1400, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1371, - "end": 1374, - "ctxt": 0 - }, - "value": "rh7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1377, - "end": 1400, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1377, - "end": 1386, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1391, - "end": 1400, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.ts b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.ts deleted file mode 100644 index 8cdeda6f1f3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithIdenticalPrimitiveType.ts +++ /dev/null @@ -1,79 +0,0 @@ -enum E { a, b, c } - -var a: number; -var b: boolean; -var c: string; -var d: void; -var e: E; - -// operator < -var ra1 = a < a; -var ra2 = b < b; -var ra3 = c < c; -var ra4 = d < d; -var ra5 = e < e; -var ra6 = null < null; -var ra7 = undefined < undefined; - -// operator > -var rb1 = a > a; -var rb2 = b > b; -var rb3 = c > c; -var rb4 = d > d; -var rb5 = e > e; -var rb6 = null > null; -var rb7 = undefined > undefined; - -// operator <= -var rc1 = a <= a; -var rc2 = b <= b; -var rc3 = c <= c; -var rc4 = d <= d; -var rc5 = e <= e; -var rc6 = null <= null; -var rc7 = undefined <= undefined; - -// operator >= -var rd1 = a >= a; -var rd2 = b >= b; -var rd3 = c >= c; -var rd4 = d >= d; -var rd5 = e >= e; -var rd6 = null >= null; -var rd7 = undefined >= undefined; - -// operator == -var re1 = a == a; -var re2 = b == b; -var re3 = c == c; -var re4 = d == d; -var re5 = e == e; -var re6 = null == null; -var re7 = undefined == undefined; - -// operator != -var rf1 = a != a; -var rf2 = b != b; -var rf3 = c != c; -var rf4 = d != d; -var rf5 = e != e; -var rf6 = null != null; -var rf7 = undefined != undefined; - -// operator === -var rg1 = a === a; -var rg2 = b === b; -var rg3 = c === c; -var rg4 = d === d; -var rg5 = e === e; -var rg6 = null === null; -var rg7 = undefined === undefined; - -// operator !== -var rh1 = a !== a; -var rh2 = b !== b; -var rh3 = c !== c; -var rh4 = d !== d; -var rh5 = e !== e; -var rh6 = null !== null; -var rh7 = undefined !== undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.json b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.json new file mode 100644 index 00000000000..e655c036cec --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.json @@ -0,0 +1,144 @@ +{ + "type": "Script", + "span": { + "start": 52, + "end": 102, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 52, + "end": 94, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 66, + "end": 94, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 66, + "end": 68, + "ctxt": 0 + }, + "value": "t1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 68, + "end": 94, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 70, + "end": 94, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 70, + "end": 76, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsTypeReference", + "span": { + "start": 79, + "end": 94, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 79, + "end": 86, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 86, + "end": 94, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 87, + "end": 93, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 95, + "end": 102, + "ctxt": 0 + }, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 95, + "end": 102, + "ctxt": 0 + }, + "operator": ">=", + "left": { + "type": "Identifier", + "span": { + "start": 95, + "end": 97, + "ctxt": 0 + }, + "value": "t1", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 101, + "end": 102, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.ts b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.ts new file mode 100644 index 00000000000..e6677484cd7 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithNumberOperand.ts @@ -0,0 +1,6 @@ +// @strict: true +// @noEmit: true + +// repro #52036 +declare const t1: number | Promise +t1 >= 0 // error diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.json b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.json deleted file mode 100644 index 073ad58a850..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.json +++ /dev/null @@ -1,8117 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 3193, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 37, - "end": 41, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 37, - "end": 41, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 21, - "end": 495, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 495, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 49, - "end": 71, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 53, - "end": 70, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 59, - "ctxt": 0 - }, - "value": "foo_r1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 62, - "end": 70, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 66, - "end": 70, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 76, - "end": 98, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 80, - "end": 97, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 80, - "end": 86, - "ctxt": 0 - }, - "value": "foo_r2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 89, - "end": 97, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 89, - "end": 90, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 93, - "end": 97, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 103, - "end": 126, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 107, - "end": 125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 107, - "end": 113, - "ctxt": 0 - }, - "value": "foo_r3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 116, - "end": 125, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 121, - "end": 125, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 131, - "end": 154, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 135, - "end": 153, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 141, - "ctxt": 0 - }, - "value": "foo_r4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 144, - "end": 153, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 159, - "end": 182, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 163, - "end": 181, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 163, - "end": 169, - "ctxt": 0 - }, - "value": "foo_r5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 172, - "end": 181, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 177, - "end": 181, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 187, - "end": 210, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 191, - "end": 209, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "value": "foo_r6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 200, - "end": 209, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 205, - "end": 209, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 215, - "end": 239, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 219, - "end": 238, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 219, - "end": 225, - "ctxt": 0 - }, - "value": "foo_r7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 228, - "end": 238, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 244, - "end": 268, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 248, - "end": 267, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "value": "foo_r8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 257, - "end": 267, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 263, - "end": 267, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 274, - "end": 296, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 278, - "end": 295, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 278, - "end": 284, - "ctxt": 0 - }, - "value": "foo_r1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 287, - "end": 295, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 287, - "end": 291, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 301, - "end": 323, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 305, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 305, - "end": 311, - "ctxt": 0 - }, - "value": "foo_r2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 314, - "end": 322, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 314, - "end": 318, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 328, - "end": 351, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 332, - "end": 350, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 332, - "end": 338, - "ctxt": 0 - }, - "value": "foo_r3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 341, - "end": 350, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 341, - "end": 345, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 379, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 378, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 366, - "ctxt": 0 - }, - "value": "foo_r4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 369, - "end": 378, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 369, - "end": 373, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 377, - "end": 378, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 384, - "end": 407, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 388, - "end": 406, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 388, - "end": 394, - "ctxt": 0 - }, - "value": "foo_r5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 397, - "end": 406, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 405, - "end": 406, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 412, - "end": 435, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 416, - "end": 434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 416, - "end": 422, - "ctxt": 0 - }, - "value": "foo_r6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 425, - "end": 434, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 425, - "end": 429, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 433, - "end": 434, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 440, - "end": 464, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 444, - "end": 463, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 444, - "end": 450, - "ctxt": 0 - }, - "value": "foo_r7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 453, - "end": 463, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 453, - "end": 457, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 469, - "end": 493, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 473, - "end": 492, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 473, - "end": 479, - "ctxt": 0 - }, - "value": "foo_r8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 482, - "end": 492, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 482, - "end": 486, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 491, - "end": 492, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 497, - "end": 512, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 501, - "end": 511, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 501, - "end": 502, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 502, - "end": 511, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 504, - "end": 511, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 527, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 517, - "end": 526, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 517, - "end": 518, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 518, - "end": 526, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 520, - "end": 526, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 528, - "end": 542, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 532, - "end": 541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 533, - "end": 541, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 535, - "end": 541, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 543, - "end": 555, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 547, - "end": 554, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 547, - "end": 548, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 548, - "end": 554, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 550, - "end": 554, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 556, - "end": 565, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 560, - "end": 564, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 561, - "end": 564, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 563, - "end": 564, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 563, - "end": 564, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 566, - "end": 576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 570, - "end": 575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 570, - "end": 571, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 571, - "end": 575, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 573, - "end": 575, - "ctxt": 0 - }, - "members": [] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 577, - "end": 593, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 581, - "end": 592, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 581, - "end": 582, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 582, - "end": 592, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 584, - "end": 592, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 584, - "end": 590, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 609, - "end": 629, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 613, - "end": 628, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 613, - "end": 617, - "ctxt": 0 - }, - "value": "r1a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 620, - "end": 628, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 620, - "end": 624, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 627, - "end": 628, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 630, - "end": 650, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 634, - "end": 649, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 634, - "end": 638, - "ctxt": 0 - }, - "value": "r1a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 641, - "end": 649, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 641, - "end": 645, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 648, - "end": 649, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 651, - "end": 671, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 655, - "end": 670, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 655, - "end": 659, - "ctxt": 0 - }, - "value": "r1a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 662, - "end": 670, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 662, - "end": 666, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 669, - "end": 670, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 672, - "end": 692, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 676, - "end": 691, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 676, - "end": 680, - "ctxt": 0 - }, - "value": "r1a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 683, - "end": 691, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 683, - "end": 687, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 690, - "end": 691, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 693, - "end": 713, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 697, - "end": 712, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 697, - "end": 701, - "ctxt": 0 - }, - "value": "r1a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 704, - "end": 712, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 704, - "end": 708, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 711, - "end": 712, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 714, - "end": 734, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 718, - "end": 733, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 718, - "end": 722, - "ctxt": 0 - }, - "value": "r1a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 725, - "end": 733, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 725, - "end": 729, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 732, - "end": 733, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 735, - "end": 755, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 739, - "end": 754, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 739, - "end": 743, - "ctxt": 0 - }, - "value": "r1a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 746, - "end": 754, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "NullLiteral", - "span": { - "start": 746, - "end": 750, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 753, - "end": 754, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 757, - "end": 777, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 761, - "end": 776, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 761, - "end": 765, - "ctxt": 0 - }, - "value": "r1b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 768, - "end": 776, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 768, - "end": 769, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 772, - "end": 776, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 778, - "end": 798, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 782, - "end": 797, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 782, - "end": 786, - "ctxt": 0 - }, - "value": "r1b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 789, - "end": 797, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 789, - "end": 790, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 793, - "end": 797, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 799, - "end": 819, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 803, - "end": 818, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 803, - "end": 807, - "ctxt": 0 - }, - "value": "r1b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 810, - "end": 818, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 810, - "end": 811, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 814, - "end": 818, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 820, - "end": 840, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 824, - "end": 839, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 824, - "end": 828, - "ctxt": 0 - }, - "value": "r1b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 831, - "end": 839, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 831, - "end": 832, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 835, - "end": 839, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 841, - "end": 861, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 845, - "end": 860, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 845, - "end": 849, - "ctxt": 0 - }, - "value": "r1b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 852, - "end": 860, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 852, - "end": 853, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 856, - "end": 860, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 862, - "end": 882, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 866, - "end": 881, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 866, - "end": 870, - "ctxt": 0 - }, - "value": "r1b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 873, - "end": 881, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 873, - "end": 874, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 877, - "end": 881, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 883, - "end": 903, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 887, - "end": 902, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 887, - "end": 891, - "ctxt": 0 - }, - "value": "r1b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 894, - "end": 902, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 894, - "end": 895, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 898, - "end": 902, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 919, - "end": 939, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 923, - "end": 938, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 923, - "end": 927, - "ctxt": 0 - }, - "value": "r2a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 930, - "end": 938, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 930, - "end": 934, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 940, - "end": 960, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 944, - "end": 959, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 944, - "end": 948, - "ctxt": 0 - }, - "value": "r2a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 951, - "end": 959, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 951, - "end": 955, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 958, - "end": 959, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 961, - "end": 981, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 965, - "end": 980, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 965, - "end": 969, - "ctxt": 0 - }, - "value": "r2a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 972, - "end": 980, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 972, - "end": 976, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 979, - "end": 980, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 982, - "end": 1002, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 986, - "end": 1001, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 986, - "end": 990, - "ctxt": 0 - }, - "value": "r2a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 993, - "end": 1001, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 993, - "end": 997, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1000, - "end": 1001, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1003, - "end": 1023, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1007, - "end": 1022, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1007, - "end": 1011, - "ctxt": 0 - }, - "value": "r2a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1014, - "end": 1022, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 1014, - "end": 1018, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1021, - "end": 1022, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1024, - "end": 1044, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1028, - "end": 1043, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1028, - "end": 1032, - "ctxt": 0 - }, - "value": "r2a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1035, - "end": 1043, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 1035, - "end": 1039, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1042, - "end": 1043, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1045, - "end": 1065, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1049, - "end": 1064, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1049, - "end": 1053, - "ctxt": 0 - }, - "value": "r2a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1056, - "end": 1064, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "NullLiteral", - "span": { - "start": 1056, - "end": 1060, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1063, - "end": 1064, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1067, - "end": 1087, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1071, - "end": 1086, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1075, - "ctxt": 0 - }, - "value": "r2b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1078, - "end": 1086, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1078, - "end": 1079, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1082, - "end": 1086, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1088, - "end": 1108, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1092, - "end": 1107, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1092, - "end": 1096, - "ctxt": 0 - }, - "value": "r2b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1099, - "end": 1107, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1099, - "end": 1100, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1103, - "end": 1107, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1109, - "end": 1129, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1113, - "end": 1128, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1113, - "end": 1117, - "ctxt": 0 - }, - "value": "r2b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1120, - "end": 1128, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1120, - "end": 1121, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1124, - "end": 1128, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1130, - "end": 1150, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1134, - "end": 1149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1134, - "end": 1138, - "ctxt": 0 - }, - "value": "r2b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1141, - "end": 1149, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1141, - "end": 1142, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1145, - "end": 1149, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1151, - "end": 1171, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1155, - "end": 1170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1155, - "end": 1159, - "ctxt": 0 - }, - "value": "r2b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1162, - "end": 1170, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1162, - "end": 1163, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1166, - "end": 1170, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1172, - "end": 1192, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1176, - "end": 1191, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1176, - "end": 1180, - "ctxt": 0 - }, - "value": "r2b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1183, - "end": 1191, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1183, - "end": 1184, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1187, - "end": 1191, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1193, - "end": 1213, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1197, - "end": 1212, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1197, - "end": 1201, - "ctxt": 0 - }, - "value": "r2b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1204, - "end": 1212, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 1204, - "end": 1205, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1208, - "end": 1212, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1230, - "end": 1251, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1234, - "end": 1250, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1234, - "end": 1238, - "ctxt": 0 - }, - "value": "r3a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1241, - "end": 1250, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1241, - "end": 1245, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1249, - "end": 1250, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1252, - "end": 1273, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1256, - "end": 1272, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1256, - "end": 1260, - "ctxt": 0 - }, - "value": "r3a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1263, - "end": 1272, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1263, - "end": 1267, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1271, - "end": 1272, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1274, - "end": 1295, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1278, - "end": 1294, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1278, - "end": 1282, - "ctxt": 0 - }, - "value": "r3a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1285, - "end": 1294, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1285, - "end": 1289, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1293, - "end": 1294, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1296, - "end": 1317, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1300, - "end": 1316, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1300, - "end": 1304, - "ctxt": 0 - }, - "value": "r3a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1307, - "end": 1316, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1307, - "end": 1311, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1315, - "end": 1316, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1318, - "end": 1339, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1322, - "end": 1338, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1322, - "end": 1326, - "ctxt": 0 - }, - "value": "r3a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1329, - "end": 1338, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1329, - "end": 1333, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1337, - "end": 1338, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1340, - "end": 1361, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1344, - "end": 1360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1344, - "end": 1348, - "ctxt": 0 - }, - "value": "r3a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1351, - "end": 1360, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1351, - "end": 1355, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1359, - "end": 1360, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1362, - "end": 1383, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1366, - "end": 1382, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1366, - "end": 1370, - "ctxt": 0 - }, - "value": "r3a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1373, - "end": 1382, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1373, - "end": 1377, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1381, - "end": 1382, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1385, - "end": 1406, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1389, - "end": 1405, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1389, - "end": 1393, - "ctxt": 0 - }, - "value": "r3b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1396, - "end": 1405, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1396, - "end": 1397, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1401, - "end": 1405, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1407, - "end": 1428, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1411, - "end": 1427, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1411, - "end": 1415, - "ctxt": 0 - }, - "value": "r3b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1418, - "end": 1427, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1418, - "end": 1419, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1423, - "end": 1427, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1429, - "end": 1450, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1433, - "end": 1449, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1433, - "end": 1437, - "ctxt": 0 - }, - "value": "r3b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1440, - "end": 1449, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1440, - "end": 1441, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1445, - "end": 1449, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1451, - "end": 1472, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1455, - "end": 1471, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1455, - "end": 1459, - "ctxt": 0 - }, - "value": "r3b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1462, - "end": 1471, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1462, - "end": 1463, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1467, - "end": 1471, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1473, - "end": 1494, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1477, - "end": 1493, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1477, - "end": 1481, - "ctxt": 0 - }, - "value": "r3b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1484, - "end": 1493, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1484, - "end": 1485, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1489, - "end": 1493, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1495, - "end": 1516, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1499, - "end": 1515, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1499, - "end": 1503, - "ctxt": 0 - }, - "value": "r3b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1506, - "end": 1515, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1506, - "end": 1507, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1511, - "end": 1515, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1517, - "end": 1538, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1521, - "end": 1537, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1521, - "end": 1525, - "ctxt": 0 - }, - "value": "r3b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1528, - "end": 1537, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1528, - "end": 1529, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1533, - "end": 1537, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1555, - "end": 1576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1559, - "end": 1575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1559, - "end": 1563, - "ctxt": 0 - }, - "value": "r4a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1566, - "end": 1575, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1566, - "end": 1570, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1574, - "end": 1575, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1577, - "end": 1598, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1581, - "end": 1597, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1581, - "end": 1585, - "ctxt": 0 - }, - "value": "r4a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1588, - "end": 1597, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1588, - "end": 1592, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1596, - "end": 1597, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1599, - "end": 1620, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1603, - "end": 1619, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1603, - "end": 1607, - "ctxt": 0 - }, - "value": "r4a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1610, - "end": 1619, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1610, - "end": 1614, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1618, - "end": 1619, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1621, - "end": 1642, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1625, - "end": 1641, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1625, - "end": 1629, - "ctxt": 0 - }, - "value": "r4a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1632, - "end": 1641, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1632, - "end": 1636, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1640, - "end": 1641, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1643, - "end": 1664, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1647, - "end": 1663, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1647, - "end": 1651, - "ctxt": 0 - }, - "value": "r4a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1654, - "end": 1663, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1654, - "end": 1658, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1662, - "end": 1663, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1665, - "end": 1686, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1669, - "end": 1685, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1669, - "end": 1673, - "ctxt": 0 - }, - "value": "r4a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1676, - "end": 1685, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1676, - "end": 1680, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1684, - "end": 1685, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1687, - "end": 1708, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1691, - "end": 1707, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1691, - "end": 1695, - "ctxt": 0 - }, - "value": "r4a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1698, - "end": 1707, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "NullLiteral", - "span": { - "start": 1698, - "end": 1702, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1706, - "end": 1707, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1710, - "end": 1731, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1714, - "end": 1730, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1714, - "end": 1718, - "ctxt": 0 - }, - "value": "r4b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1721, - "end": 1730, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1721, - "end": 1722, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1726, - "end": 1730, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1732, - "end": 1753, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1736, - "end": 1752, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1736, - "end": 1740, - "ctxt": 0 - }, - "value": "r4b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1743, - "end": 1752, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1743, - "end": 1744, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1748, - "end": 1752, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1754, - "end": 1775, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1758, - "end": 1774, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1758, - "end": 1762, - "ctxt": 0 - }, - "value": "r4b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1765, - "end": 1774, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1765, - "end": 1766, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1770, - "end": 1774, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1776, - "end": 1797, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1780, - "end": 1796, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1780, - "end": 1784, - "ctxt": 0 - }, - "value": "r4b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1787, - "end": 1796, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1787, - "end": 1788, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1792, - "end": 1796, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1798, - "end": 1819, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1802, - "end": 1818, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1802, - "end": 1806, - "ctxt": 0 - }, - "value": "r4b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1809, - "end": 1818, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1809, - "end": 1810, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1814, - "end": 1818, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1820, - "end": 1841, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1824, - "end": 1840, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1824, - "end": 1828, - "ctxt": 0 - }, - "value": "r4b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1831, - "end": 1840, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1831, - "end": 1832, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1836, - "end": 1840, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1842, - "end": 1863, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1846, - "end": 1862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1846, - "end": 1850, - "ctxt": 0 - }, - "value": "r4b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1853, - "end": 1862, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 1853, - "end": 1854, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1858, - "end": 1862, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1880, - "end": 1901, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1884, - "end": 1900, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1884, - "end": 1888, - "ctxt": 0 - }, - "value": "r5a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1891, - "end": 1900, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1891, - "end": 1895, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1899, - "end": 1900, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1902, - "end": 1923, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1906, - "end": 1922, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1906, - "end": 1910, - "ctxt": 0 - }, - "value": "r5a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1913, - "end": 1922, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1913, - "end": 1917, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1921, - "end": 1922, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1924, - "end": 1945, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1928, - "end": 1944, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1928, - "end": 1932, - "ctxt": 0 - }, - "value": "r5a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1935, - "end": 1944, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1935, - "end": 1939, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1943, - "end": 1944, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1946, - "end": 1967, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1950, - "end": 1966, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1950, - "end": 1954, - "ctxt": 0 - }, - "value": "r5a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1957, - "end": 1966, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1957, - "end": 1961, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1965, - "end": 1966, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1968, - "end": 1989, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1972, - "end": 1988, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1972, - "end": 1976, - "ctxt": 0 - }, - "value": "r5a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1979, - "end": 1988, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 1979, - "end": 1983, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1987, - "end": 1988, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1990, - "end": 2011, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1994, - "end": 2010, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1994, - "end": 1998, - "ctxt": 0 - }, - "value": "r5a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2001, - "end": 2010, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2001, - "end": 2005, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2009, - "end": 2010, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2012, - "end": 2033, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2016, - "end": 2032, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2016, - "end": 2020, - "ctxt": 0 - }, - "value": "r5a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2023, - "end": 2032, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2023, - "end": 2027, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2031, - "end": 2032, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2035, - "end": 2056, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2039, - "end": 2055, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2039, - "end": 2043, - "ctxt": 0 - }, - "value": "r5b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2046, - "end": 2055, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2046, - "end": 2047, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2051, - "end": 2055, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2057, - "end": 2078, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2061, - "end": 2077, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2061, - "end": 2065, - "ctxt": 0 - }, - "value": "r5b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2068, - "end": 2077, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2068, - "end": 2069, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2073, - "end": 2077, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2079, - "end": 2100, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2083, - "end": 2099, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2083, - "end": 2087, - "ctxt": 0 - }, - "value": "r5b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2090, - "end": 2099, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2090, - "end": 2091, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2095, - "end": 2099, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2101, - "end": 2122, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2105, - "end": 2121, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2105, - "end": 2109, - "ctxt": 0 - }, - "value": "r5b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2112, - "end": 2121, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2112, - "end": 2113, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2117, - "end": 2121, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2123, - "end": 2144, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2127, - "end": 2143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2127, - "end": 2131, - "ctxt": 0 - }, - "value": "r5b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2134, - "end": 2143, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2134, - "end": 2135, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2139, - "end": 2143, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2145, - "end": 2166, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2149, - "end": 2165, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2149, - "end": 2153, - "ctxt": 0 - }, - "value": "r5b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2156, - "end": 2165, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2156, - "end": 2157, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2161, - "end": 2165, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2167, - "end": 2188, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2171, - "end": 2187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2171, - "end": 2175, - "ctxt": 0 - }, - "value": "r5b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2178, - "end": 2187, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 2178, - "end": 2179, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2183, - "end": 2187, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2205, - "end": 2226, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2209, - "end": 2225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2209, - "end": 2213, - "ctxt": 0 - }, - "value": "r6a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2216, - "end": 2225, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2216, - "end": 2220, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2224, - "end": 2225, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2227, - "end": 2248, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2231, - "end": 2247, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2231, - "end": 2235, - "ctxt": 0 - }, - "value": "r6a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2238, - "end": 2247, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2238, - "end": 2242, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2246, - "end": 2247, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2249, - "end": 2270, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2253, - "end": 2269, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2253, - "end": 2257, - "ctxt": 0 - }, - "value": "r6a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2260, - "end": 2269, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2260, - "end": 2264, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2268, - "end": 2269, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2271, - "end": 2292, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2275, - "end": 2291, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2275, - "end": 2279, - "ctxt": 0 - }, - "value": "r6a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2282, - "end": 2291, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2282, - "end": 2286, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2290, - "end": 2291, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2293, - "end": 2314, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2297, - "end": 2313, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2297, - "end": 2301, - "ctxt": 0 - }, - "value": "r6a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2304, - "end": 2313, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2304, - "end": 2308, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2312, - "end": 2313, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2315, - "end": 2336, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2319, - "end": 2335, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2319, - "end": 2323, - "ctxt": 0 - }, - "value": "r6a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2326, - "end": 2335, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2326, - "end": 2330, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2334, - "end": 2335, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2337, - "end": 2358, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2341, - "end": 2357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2341, - "end": 2345, - "ctxt": 0 - }, - "value": "r6a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2348, - "end": 2357, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 2348, - "end": 2352, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2356, - "end": 2357, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2360, - "end": 2381, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2364, - "end": 2380, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2364, - "end": 2368, - "ctxt": 0 - }, - "value": "r6b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2371, - "end": 2380, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2371, - "end": 2372, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2376, - "end": 2380, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2382, - "end": 2403, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2386, - "end": 2402, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2386, - "end": 2390, - "ctxt": 0 - }, - "value": "r6b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2393, - "end": 2402, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2393, - "end": 2394, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2398, - "end": 2402, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2404, - "end": 2425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2408, - "end": 2424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2408, - "end": 2412, - "ctxt": 0 - }, - "value": "r6b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2415, - "end": 2424, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2415, - "end": 2416, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2420, - "end": 2424, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2426, - "end": 2447, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2430, - "end": 2446, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2430, - "end": 2434, - "ctxt": 0 - }, - "value": "r6b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2437, - "end": 2446, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2437, - "end": 2438, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2442, - "end": 2446, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2448, - "end": 2469, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2452, - "end": 2468, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2452, - "end": 2456, - "ctxt": 0 - }, - "value": "r6b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2459, - "end": 2468, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2459, - "end": 2460, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2464, - "end": 2468, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2470, - "end": 2491, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2474, - "end": 2490, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2474, - "end": 2478, - "ctxt": 0 - }, - "value": "r6b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2481, - "end": 2490, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2481, - "end": 2482, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2486, - "end": 2490, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2492, - "end": 2513, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2496, - "end": 2512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2496, - "end": 2500, - "ctxt": 0 - }, - "value": "r6b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2503, - "end": 2512, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 2503, - "end": 2504, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2508, - "end": 2512, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2531, - "end": 2553, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2535, - "end": 2552, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2535, - "end": 2539, - "ctxt": 0 - }, - "value": "r7a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2542, - "end": 2552, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2542, - "end": 2546, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2551, - "end": 2552, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2554, - "end": 2576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2558, - "end": 2575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2558, - "end": 2562, - "ctxt": 0 - }, - "value": "r7a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2565, - "end": 2575, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2565, - "end": 2569, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2574, - "end": 2575, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2577, - "end": 2599, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2581, - "end": 2598, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2581, - "end": 2585, - "ctxt": 0 - }, - "value": "r7a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2588, - "end": 2598, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2588, - "end": 2592, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2597, - "end": 2598, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2600, - "end": 2622, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2604, - "end": 2621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2604, - "end": 2608, - "ctxt": 0 - }, - "value": "r7a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2611, - "end": 2621, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2611, - "end": 2615, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2620, - "end": 2621, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2623, - "end": 2645, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2627, - "end": 2644, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2627, - "end": 2631, - "ctxt": 0 - }, - "value": "r7a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2634, - "end": 2644, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2634, - "end": 2638, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2643, - "end": 2644, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2646, - "end": 2668, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2650, - "end": 2667, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2650, - "end": 2654, - "ctxt": 0 - }, - "value": "r7a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2657, - "end": 2667, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2657, - "end": 2661, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2666, - "end": 2667, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2669, - "end": 2691, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2673, - "end": 2690, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2673, - "end": 2677, - "ctxt": 0 - }, - "value": "r7a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2680, - "end": 2690, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 2680, - "end": 2684, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2689, - "end": 2690, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2693, - "end": 2715, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2697, - "end": 2714, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2697, - "end": 2701, - "ctxt": 0 - }, - "value": "r7b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2704, - "end": 2714, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2704, - "end": 2705, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2710, - "end": 2714, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2716, - "end": 2738, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2720, - "end": 2737, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2720, - "end": 2724, - "ctxt": 0 - }, - "value": "r7b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2727, - "end": 2737, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2727, - "end": 2728, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2733, - "end": 2737, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2739, - "end": 2761, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2743, - "end": 2760, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2743, - "end": 2747, - "ctxt": 0 - }, - "value": "r7b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2750, - "end": 2760, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2750, - "end": 2751, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2756, - "end": 2760, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2762, - "end": 2784, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2766, - "end": 2783, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2766, - "end": 2770, - "ctxt": 0 - }, - "value": "r7b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2773, - "end": 2783, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2773, - "end": 2774, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2779, - "end": 2783, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2785, - "end": 2807, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2789, - "end": 2806, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2789, - "end": 2793, - "ctxt": 0 - }, - "value": "r7b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2796, - "end": 2806, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2796, - "end": 2797, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2802, - "end": 2806, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2808, - "end": 2830, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2812, - "end": 2829, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2812, - "end": 2816, - "ctxt": 0 - }, - "value": "r7b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2819, - "end": 2829, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2819, - "end": 2820, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2825, - "end": 2829, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2831, - "end": 2853, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2835, - "end": 2852, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2835, - "end": 2839, - "ctxt": 0 - }, - "value": "r7b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2842, - "end": 2852, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 2842, - "end": 2843, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2848, - "end": 2852, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2871, - "end": 2893, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2875, - "end": 2892, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2875, - "end": 2879, - "ctxt": 0 - }, - "value": "r8a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2882, - "end": 2892, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2882, - "end": 2886, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2891, - "end": 2892, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2894, - "end": 2916, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2898, - "end": 2915, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2898, - "end": 2902, - "ctxt": 0 - }, - "value": "r8a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2905, - "end": 2915, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2905, - "end": 2909, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2914, - "end": 2915, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2917, - "end": 2939, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2921, - "end": 2938, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2921, - "end": 2925, - "ctxt": 0 - }, - "value": "r8a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2928, - "end": 2938, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2928, - "end": 2932, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2937, - "end": 2938, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2940, - "end": 2962, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2944, - "end": 2961, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2944, - "end": 2948, - "ctxt": 0 - }, - "value": "r8a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2951, - "end": 2961, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2951, - "end": 2955, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2960, - "end": 2961, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2963, - "end": 2985, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2967, - "end": 2984, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2967, - "end": 2971, - "ctxt": 0 - }, - "value": "r8a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2974, - "end": 2984, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2974, - "end": 2978, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2983, - "end": 2984, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2986, - "end": 3008, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2990, - "end": 3007, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2990, - "end": 2994, - "ctxt": 0 - }, - "value": "r8a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2997, - "end": 3007, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 2997, - "end": 3001, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 3006, - "end": 3007, - "ctxt": 0 - }, - "value": "f", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3009, - "end": 3031, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3013, - "end": 3030, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3013, - "end": 3017, - "ctxt": 0 - }, - "value": "r8a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3020, - "end": 3030, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 3020, - "end": 3024, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 3029, - "end": 3030, - "ctxt": 0 - }, - "value": "g", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3033, - "end": 3055, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3037, - "end": 3054, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3037, - "end": 3041, - "ctxt": 0 - }, - "value": "r8b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3044, - "end": 3054, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3044, - "end": 3045, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3050, - "end": 3054, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3056, - "end": 3078, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3060, - "end": 3077, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3060, - "end": 3064, - "ctxt": 0 - }, - "value": "r8b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3067, - "end": 3077, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3067, - "end": 3068, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3073, - "end": 3077, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3079, - "end": 3101, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3083, - "end": 3100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3083, - "end": 3087, - "ctxt": 0 - }, - "value": "r8b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3090, - "end": 3100, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3090, - "end": 3091, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3096, - "end": 3100, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3102, - "end": 3124, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3106, - "end": 3123, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3106, - "end": 3110, - "ctxt": 0 - }, - "value": "r8b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3113, - "end": 3123, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3113, - "end": 3114, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3119, - "end": 3123, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3125, - "end": 3147, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3129, - "end": 3146, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3129, - "end": 3133, - "ctxt": 0 - }, - "value": "r8b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3136, - "end": 3146, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3136, - "end": 3137, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3142, - "end": 3146, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3148, - "end": 3170, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3152, - "end": 3169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3152, - "end": 3156, - "ctxt": 0 - }, - "value": "r8b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3159, - "end": 3169, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3159, - "end": 3160, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3165, - "end": 3169, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3171, - "end": 3193, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3175, - "end": 3192, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3175, - "end": 3179, - "ctxt": 0 - }, - "value": "r8b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3182, - "end": 3192, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 3182, - "end": 3183, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 3188, - "end": 3192, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.ts b/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.ts deleted file mode 100644 index 16a0c4905ae..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/comparisonOperatorWithOneOperandIsNull.ts +++ /dev/null @@ -1,165 +0,0 @@ -enum E { a, b, c } - -function foo(t: T) { - var foo_r1 = t < null; - var foo_r2 = t > null; - var foo_r3 = t <= null; - var foo_r4 = t >= null; - var foo_r5 = t == null; - var foo_r6 = t != null; - var foo_r7 = t === null; - var foo_r8 = t !== null; - - var foo_r1 = null < t; - var foo_r2 = null > t; - var foo_r3 = null <= t; - var foo_r4 = null >= t; - var foo_r5 = null == t; - var foo_r6 = null != t; - var foo_r7 = null === t; - var foo_r8 = null !== t; -} - -var a: boolean; -var b: number; -var c: string; -var d: void; -var e: E; -var f: {}; -var g: string[]; - -// operator < -var r1a1 = null < a; -var r1a2 = null < b; -var r1a3 = null < c; -var r1a4 = null < d; -var r1a5 = null < e; -var r1a6 = null < f; -var r1a7 = null < g; - -var r1b1 = a < null; -var r1b2 = b < null; -var r1b3 = c < null; -var r1b4 = d < null; -var r1b5 = e < null; -var r1b6 = f < null; -var r1b7 = g < null; - -// operator > -var r2a1 = null > a; -var r2a2 = null > b; -var r2a3 = null > c; -var r2a4 = null > d; -var r2a5 = null > e; -var r2a6 = null > f; -var r2a7 = null > g; - -var r2b1 = a > null; -var r2b2 = b > null; -var r2b3 = c > null; -var r2b4 = d > null; -var r2b5 = e > null; -var r2b6 = f > null; -var r2b7 = g > null; - -// operator <= -var r3a1 = null <= a; -var r3a2 = null <= b; -var r3a3 = null <= c; -var r3a4 = null <= d; -var r3a5 = null <= e; -var r3a6 = null <= f; -var r3a7 = null <= g; - -var r3b1 = a <= null; -var r3b2 = b <= null; -var r3b3 = c <= null; -var r3b4 = d <= null; -var r3b5 = e <= null; -var r3b6 = f <= null; -var r3b7 = g <= null; - -// operator >= -var r4a1 = null >= a; -var r4a2 = null >= b; -var r4a3 = null >= c; -var r4a4 = null >= d; -var r4a5 = null >= e; -var r4a6 = null >= f; -var r4a7 = null >= g; - -var r4b1 = a >= null; -var r4b2 = b >= null; -var r4b3 = c >= null; -var r4b4 = d >= null; -var r4b5 = e >= null; -var r4b6 = f >= null; -var r4b7 = g >= null; - -// operator == -var r5a1 = null == a; -var r5a2 = null == b; -var r5a3 = null == c; -var r5a4 = null == d; -var r5a5 = null == e; -var r5a6 = null == f; -var r5a7 = null == g; - -var r5b1 = a == null; -var r5b2 = b == null; -var r5b3 = c == null; -var r5b4 = d == null; -var r5b5 = e == null; -var r5b6 = f == null; -var r5b7 = g == null; - -// operator != -var r6a1 = null != a; -var r6a2 = null != b; -var r6a3 = null != c; -var r6a4 = null != d; -var r6a5 = null != e; -var r6a6 = null != f; -var r6a7 = null != g; - -var r6b1 = a != null; -var r6b2 = b != null; -var r6b3 = c != null; -var r6b4 = d != null; -var r6b5 = e != null; -var r6b6 = f != null; -var r6b7 = g != null; - -// operator === -var r7a1 = null === a; -var r7a2 = null === b; -var r7a3 = null === c; -var r7a4 = null === d; -var r7a5 = null === e; -var r7a6 = null === f; -var r7a7 = null === g; - -var r7b1 = a === null; -var r7b2 = b === null; -var r7b3 = c === null; -var r7b4 = d === null; -var r7b5 = e === null; -var r7b6 = f === null; -var r7b7 = g === null; - -// operator !== -var r8a1 = null !== a; -var r8a2 = null !== b; -var r8a3 = null !== c; -var r8a4 = null !== d; -var r8a5 = null !== e; -var r8a6 = null !== f; -var r8a7 = null !== g; - -var r8b1 = a !== null; -var r8b2 = b !== null; -var r8b3 = c !== null; -var r8b4 = d !== null; -var r8b5 = e !== null; -var r8b6 = f !== null; -var r8b7 = g !== null; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.json b/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.json deleted file mode 100644 index 30df91088c3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 268, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 32, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 31, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 31, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 33, - "end": 47, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 37, - "end": 46, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 38, - "end": 46, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 40, - "end": 46, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 48, - "end": 57, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 52, - "end": 53, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 59, - "end": 71, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 63, - "end": 70, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 63, - "end": 65, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 65, - "end": 70, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 67, - "end": 70, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 72, - "end": 80, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 72, - "end": 79, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 72, - "end": 74, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 78, - "end": 79, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 81, - "end": 89, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 81, - "end": 88, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 81, - "end": 83, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 90, - "end": 97, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 90, - "end": 92, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 96, - "end": 97, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 99, - "end": 110, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 99, - "end": 109, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 99, - "end": 101, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 105, - "end": 109, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 111, - "end": 127, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 111, - "end": 126, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 111, - "end": 113, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 117, - "end": 126, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 129, - "end": 144, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 133, - "end": 143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 133, - "end": 135, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 145, - "end": 153, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 145, - "end": 152, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 145, - "end": 147, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 151, - "end": 152, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 154, - "end": 156, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 163, - "end": 171, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 163, - "end": 170, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 163, - "end": 165, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 172, - "end": 183, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 172, - "end": 182, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 172, - "end": 174, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 178, - "end": 182, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 184, - "end": 200, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 184, - "end": 199, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 184, - "end": 186, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 190, - "end": 199, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 202, - "end": 212, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 206, - "end": 211, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 206, - "end": 208, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 211, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 213, - "end": 220, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 213, - "end": 215, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 222, - "end": 230, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 222, - "end": 224, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 231, - "end": 239, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 231, - "end": 238, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 231, - "end": 233, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 237, - "end": 238, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 240, - "end": 251, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 240, - "end": 250, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 240, - "end": 242, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 246, - "end": 250, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 252, - "end": 268, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 252, - "end": 267, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 252, - "end": 254, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 258, - "end": 267, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.ts b/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.ts deleted file mode 100644 index 58571c6cfac..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentLHSCanBeAssigned.ts +++ /dev/null @@ -1,26 +0,0 @@ -enum E { a, b, c } - -var a: any; -var b: number; -var c: E; - -var x1: any; -x1 *= a; -x1 *= b; -x1 *= c; -x1 *= null; -x1 *= undefined; - -var x2: number; -x2 *= a; -x2 *= b; -x2 *= c; -x2 *= null; -x2 *= undefined; - -var x3: E; -x3 *= a; -x3 *= b; -x3 *= c; -x3 *= null; -x3 *= undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.json deleted file mode 100644 index 1aa5dcd2d40..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.json +++ /dev/null @@ -1,2197 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 606, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 28, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 23, - "end": 28, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 30, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 34, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 37, - "end": 41, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 60, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 59, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 50, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 59, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 61, - "end": 69, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 61, - "end": 68, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 61, - "end": 63, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 67, - "end": 68, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 70, - "end": 78, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 70, - "end": 77, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 70, - "end": 72, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 76, - "end": 77, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 79, - "end": 90, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 79, - "end": 89, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 79, - "end": 81, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 85, - "end": 89, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 91, - "end": 99, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 91, - "end": 98, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 91, - "end": 93, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 97, - "end": 98, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 100, - "end": 108, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 100, - "end": 108, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 100, - "end": 102, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 106, - "end": 108, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 109, - "end": 119, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 109, - "end": 118, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 109, - "end": 111, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 115, - "end": 118, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 120, - "end": 128, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 120, - "end": 122, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 126, - "end": 128, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 130, - "end": 141, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 130, - "end": 140, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 130, - "end": 132, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 142, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 142, - "end": 157, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 142, - "end": 144, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 148, - "end": 157, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 160, - "end": 175, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 164, - "end": 174, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 164, - "end": 166, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 166, - "end": 174, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 168, - "end": 174, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 176, - "end": 184, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 176, - "end": 183, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 176, - "end": 178, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 185, - "end": 193, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 185, - "end": 192, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 185, - "end": 187, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 194, - "end": 205, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 194, - "end": 204, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 200, - "end": 204, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 206, - "end": 213, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 206, - "end": 208, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 215, - "end": 223, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 215, - "end": 223, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 215, - "end": 217, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 221, - "end": 223, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 224, - "end": 234, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 224, - "end": 233, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 224, - "end": 226, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 235, - "end": 244, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 241, - "end": 243, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 245, - "end": 256, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 245, - "end": 255, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 245, - "end": 247, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 257, - "end": 273, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 257, - "end": 272, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 257, - "end": 259, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 263, - "end": 272, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 275, - "end": 286, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 279, - "end": 285, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 279, - "end": 281, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 281, - "end": 285, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 283, - "end": 285, - "ctxt": 0 - }, - "members": [] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 287, - "end": 295, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 287, - "end": 294, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 287, - "end": 289, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 293, - "end": 294, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 296, - "end": 304, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 296, - "end": 303, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 296, - "end": 298, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 305, - "end": 316, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 305, - "end": 315, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 305, - "end": 307, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 311, - "end": 315, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 317, - "end": 325, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 317, - "end": 324, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 317, - "end": 319, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 323, - "end": 324, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 326, - "end": 334, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 326, - "end": 334, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 326, - "end": 328, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 332, - "end": 334, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 335, - "end": 345, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 335, - "end": 344, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 335, - "end": 337, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 341, - "end": 344, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 346, - "end": 355, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 346, - "end": 354, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 356, - "end": 367, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 356, - "end": 366, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 356, - "end": 358, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 362, - "end": 366, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 368, - "end": 384, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 368, - "end": 383, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 368, - "end": 370, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 374, - "end": 383, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 386, - "end": 399, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 390, - "end": 398, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 390, - "end": 392, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 392, - "end": 398, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 394, - "end": 398, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 400, - "end": 408, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 400, - "end": 407, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 400, - "end": 402, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 406, - "end": 407, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 409, - "end": 417, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 409, - "end": 416, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 409, - "end": 411, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 415, - "end": 416, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 418, - "end": 429, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 418, - "end": 428, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 418, - "end": 420, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 424, - "end": 428, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 430, - "end": 438, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 430, - "end": 437, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 430, - "end": 432, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 436, - "end": 437, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 439, - "end": 447, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 439, - "end": 447, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 439, - "end": 441, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 445, - "end": 447, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 448, - "end": 458, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 448, - "end": 457, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 448, - "end": 450, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 454, - "end": 457, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 456, - "end": 457, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 459, - "end": 468, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 459, - "end": 467, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 459, - "end": 461, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 465, - "end": 467, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 469, - "end": 480, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 469, - "end": 479, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 469, - "end": 471, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 475, - "end": 479, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 481, - "end": 497, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 481, - "end": 496, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 481, - "end": 483, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 487, - "end": 496, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 499, - "end": 514, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 503, - "end": 513, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 503, - "end": 505, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 505, - "end": 513, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 507, - "end": 513, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 515, - "end": 523, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 515, - "end": 522, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 515, - "end": 517, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 521, - "end": 522, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 524, - "end": 535, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 524, - "end": 534, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 524, - "end": 526, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 536, - "end": 544, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 536, - "end": 544, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 536, - "end": 538, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 542, - "end": 544, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 545, - "end": 554, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 545, - "end": 553, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 545, - "end": 547, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 551, - "end": 553, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 556, - "end": 566, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 560, - "end": 565, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 560, - "end": 562, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 562, - "end": 565, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 564, - "end": 565, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 564, - "end": 565, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 567, - "end": 575, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 567, - "end": 574, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 567, - "end": 569, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 573, - "end": 574, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 576, - "end": 587, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 576, - "end": 586, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 576, - "end": 578, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 582, - "end": 586, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 588, - "end": 596, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 588, - "end": 596, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 588, - "end": 590, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 594, - "end": 596, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 597, - "end": 606, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 597, - "end": 605, - "ctxt": 0 - }, - "operator": "*=", - "left": { - "type": "Identifier", - "span": { - "start": 597, - "end": 599, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 603, - "end": 605, - "ctxt": 0 - }, - "properties": [] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.ts deleted file mode 100644 index 7dcb73696f5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundArithmeticAssignmentWithInvalidOperands.ts +++ /dev/null @@ -1,60 +0,0 @@ -enum E { a, b } - -var a: any; -var b: void; - -var x1: boolean; -x1 *= a; -x1 *= b; -x1 *= true; -x1 *= 0; -x1 *= '' -x1 *= E.a; -x1 *= {}; -x1 *= null; -x1 *= undefined; - -var x2: string; -x2 *= a; -x2 *= b; -x2 *= true; -x2 *= 0; -x2 *= '' -x2 *= E.a; -x2 *= {}; -x2 *= null; -x2 *= undefined; - -var x3: {}; -x3 *= a; -x3 *= b; -x3 *= true; -x3 *= 0; -x3 *= '' -x3 *= E.a; -x3 *= {}; -x3 *= null; -x3 *= undefined; - -var x4: void; -x4 *= a; -x4 *= b; -x4 *= true; -x4 *= 0; -x4 *= '' -x4 *= E.a; -x4 *= {}; -x4 *= null; -x4 *= undefined; - -var x5: number; -x5 *= b; -x5 *= true; -x5 *= '' -x5 *= {}; - -var x6: E; -x6 *= b; -x6 *= true; -x6 *= '' -x6 *= {}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.json b/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.json deleted file mode 100644 index b5f55a26855..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 283, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 32, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 31, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 31, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 33, - "end": 47, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 37, - "end": 46, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 38, - "end": 46, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 40, - "end": 46, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 48, - "end": 57, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 52, - "end": 53, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 59, - "end": 71, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 63, - "end": 70, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 63, - "end": 65, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 65, - "end": 70, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 67, - "end": 70, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 72, - "end": 81, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 72, - "end": 80, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 72, - "end": 74, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 82, - "end": 91, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 82, - "end": 90, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 82, - "end": 84, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 89, - "end": 90, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 92, - "end": 101, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 92, - "end": 100, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 92, - "end": 94, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 102, - "end": 114, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 102, - "end": 113, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 102, - "end": 104, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 109, - "end": 113, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 115, - "end": 132, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 115, - "end": 131, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 115, - "end": 117, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 122, - "end": 131, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 134, - "end": 149, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 138, - "end": 148, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 140, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 148, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 150, - "end": 159, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 150, - "end": 158, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 150, - "end": 152, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 160, - "end": 169, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 160, - "end": 168, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 160, - "end": 162, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 170, - "end": 172, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 180, - "end": 192, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 180, - "end": 191, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 180, - "end": 182, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 193, - "end": 210, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 193, - "end": 209, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 193, - "end": 195, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 200, - "end": 209, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 212, - "end": 222, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 216, - "end": 218, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 218, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 220, - "end": 221, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 220, - "end": 221, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 223, - "end": 232, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 223, - "end": 231, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 223, - "end": 225, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 233, - "end": 242, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 233, - "end": 241, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 233, - "end": 235, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 240, - "end": 241, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 243, - "end": 251, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 243, - "end": 245, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 253, - "end": 265, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 253, - "end": 264, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 266, - "end": 283, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 266, - "end": 282, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 266, - "end": 268, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 273, - "end": 282, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.ts b/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.ts deleted file mode 100644 index 35b434b6bac..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCanBeAssigned1.ts +++ /dev/null @@ -1,26 +0,0 @@ -enum E { a, b, c } - -var a: any; -var b: number; -var c: E; - -var x1: any; -x1 **= a; -x1 **= b; -x1 **= c; -x1 **= null; -x1 **= undefined; - -var x2: number; -x2 **= a; -x2 **= b; -x2 **= c; -x2 **= null; -x2 **= undefined; - -var x3: E; -x3 **= a; -x3 **= b; -x3 **= c; -x3 **= null; -x3 **= undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.json b/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.json deleted file mode 100644 index a709ddfd41b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.json +++ /dev/null @@ -1,2197 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 650, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 28, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 23, - "end": 28, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 30, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 34, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 37, - "end": 41, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 60, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 59, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 50, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 59, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 61, - "end": 70, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 61, - "end": 69, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 61, - "end": 63, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 68, - "end": 69, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 71, - "end": 80, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 71, - "end": 79, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 71, - "end": 73, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 78, - "end": 79, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 81, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 81, - "end": 92, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 81, - "end": 83, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 88, - "end": 92, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 94, - "end": 103, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 94, - "end": 102, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 94, - "end": 96, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 104, - "end": 113, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 104, - "end": 113, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 104, - "end": 106, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 111, - "end": 113, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 114, - "end": 125, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 114, - "end": 124, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 114, - "end": 116, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 121, - "end": 124, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 121, - "end": 122, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 126, - "end": 135, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 126, - "end": 128, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 133, - "end": 135, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 137, - "end": 149, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 137, - "end": 148, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 137, - "end": 139, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 144, - "end": 148, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 150, - "end": 167, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 150, - "end": 166, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 150, - "end": 152, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 157, - "end": 166, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 169, - "end": 184, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 173, - "end": 183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 173, - "end": 175, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 175, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 177, - "end": 183, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 185, - "end": 194, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 185, - "end": 193, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 185, - "end": 187, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 195, - "end": 204, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 195, - "end": 203, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 195, - "end": 197, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 202, - "end": 203, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 205, - "end": 217, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 205, - "end": 216, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 205, - "end": 207, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 218, - "end": 227, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 218, - "end": 226, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 218, - "end": 220, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 228, - "end": 237, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 228, - "end": 237, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 228, - "end": 230, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 238, - "end": 249, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 238, - "end": 248, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 238, - "end": 240, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 245, - "end": 246, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 250, - "end": 260, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 250, - "end": 259, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 250, - "end": 252, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 257, - "end": 259, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 261, - "end": 272, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 261, - "end": 263, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 268, - "end": 272, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 274, - "end": 291, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 274, - "end": 290, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 274, - "end": 276, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 281, - "end": 290, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 293, - "end": 304, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 297, - "end": 303, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 297, - "end": 299, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 299, - "end": 303, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 301, - "end": 303, - "ctxt": 0 - }, - "members": [] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 305, - "end": 314, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 305, - "end": 313, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 305, - "end": 307, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 315, - "end": 324, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 315, - "end": 323, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 315, - "end": 317, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 325, - "end": 337, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 325, - "end": 336, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 325, - "end": 327, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 332, - "end": 336, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 338, - "end": 347, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 338, - "end": 346, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 338, - "end": 340, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 345, - "end": 346, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 348, - "end": 357, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 348, - "end": 357, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 348, - "end": 350, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 355, - "end": 357, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 358, - "end": 369, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 358, - "end": 368, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 358, - "end": 360, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 365, - "end": 366, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 367, - "end": 368, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 370, - "end": 380, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 370, - "end": 379, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 370, - "end": 372, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 377, - "end": 379, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 381, - "end": 393, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 381, - "end": 392, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 381, - "end": 383, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 388, - "end": 392, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 394, - "end": 411, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 394, - "end": 410, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 394, - "end": 396, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 401, - "end": 410, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 426, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 417, - "end": 425, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 417, - "end": 419, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 419, - "end": 425, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 421, - "end": 425, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 427, - "end": 436, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 427, - "end": 435, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 427, - "end": 429, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 434, - "end": 435, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 437, - "end": 446, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 437, - "end": 445, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 444, - "end": 445, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 447, - "end": 459, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 447, - "end": 458, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 447, - "end": 449, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 454, - "end": 458, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 460, - "end": 469, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 460, - "end": 468, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 460, - "end": 462, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 467, - "end": 468, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 470, - "end": 479, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 470, - "end": 479, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 470, - "end": 472, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 477, - "end": 479, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 480, - "end": 491, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 480, - "end": 490, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 480, - "end": 482, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 492, - "end": 502, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 492, - "end": 501, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 492, - "end": 494, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 499, - "end": 501, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 503, - "end": 515, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 503, - "end": 514, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 503, - "end": 505, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 510, - "end": 514, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 516, - "end": 533, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 516, - "end": 532, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 516, - "end": 518, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 523, - "end": 532, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 535, - "end": 550, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 539, - "end": 549, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 539, - "end": 541, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 541, - "end": 549, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 543, - "end": 549, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 551, - "end": 560, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 551, - "end": 559, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 551, - "end": 553, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 558, - "end": 559, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 561, - "end": 573, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 561, - "end": 572, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 561, - "end": 563, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 568, - "end": 572, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 574, - "end": 583, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 574, - "end": 583, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 574, - "end": 576, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 581, - "end": 583, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 584, - "end": 594, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 584, - "end": 593, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 584, - "end": 586, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 591, - "end": 593, - "ctxt": 0 - }, - "properties": [] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 596, - "end": 606, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 600, - "end": 605, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 600, - "end": 602, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 602, - "end": 605, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 607, - "end": 616, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 607, - "end": 615, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 607, - "end": 609, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 614, - "end": 615, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 617, - "end": 629, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 617, - "end": 628, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 617, - "end": 619, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 624, - "end": 628, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 630, - "end": 632, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 637, - "end": 639, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 640, - "end": 650, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 640, - "end": 649, - "ctxt": 0 - }, - "operator": "**=", - "left": { - "type": "Identifier", - "span": { - "start": 640, - "end": 642, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 647, - "end": 649, - "ctxt": 0 - }, - "properties": [] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.ts b/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.ts deleted file mode 100644 index 93623f667b8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/compoundExponentiationAssignmentLHSCannotBeAssigned.ts +++ /dev/null @@ -1,60 +0,0 @@ -enum E { a, b } - -var a: any; -var b: void; - -var x1: boolean; -x1 **= a; -x1 **= b; -x1 **= true; -x1 **= 0; -x1 **= '' -x1 **= E.a; -x1 **= {}; -x1 **= null; -x1 **= undefined; - -var x2: string; -x2 **= a; -x2 **= b; -x2 **= true; -x2 **= 0; -x2 **= '' -x2 **= E.a; -x2 **= {}; -x2 **= null; -x2 **= undefined; - -var x3: {}; -x3 **= a; -x3 **= b; -x3 **= true; -x3 **= 0; -x3 **= '' -x3 **= E.a; -x3 **= {}; -x3 **= null; -x3 **= undefined; - -var x4: void; -x4 **= a; -x4 **= b; -x4 **= true; -x4 **= 0; -x4 **= '' -x4 **= E.a; -x4 **= {}; -x4 **= null; -x4 **= undefined; - -var x5: number; -x5 **= b; -x5 **= true; -x5 **= '' -x5 **= {}; - -var x6: E; -x6 **= b; -x6 **= true; -x6 **= '' -x6 **= {}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.json deleted file mode 100644 index 81ea3152151..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.json +++ /dev/null @@ -1,859 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 313, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 22, - "end": 30, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 24, - "end": 30, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 32, - "end": 46, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 36, - "end": 45, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 37, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 47, - "end": 58, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 52, - "end": 57, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 59, - "end": 313, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 73, - "end": 85, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 73, - "end": 76, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 76, - "end": 84, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 78, - "end": 84, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 91, - "end": 92, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "value": { - "type": "Identifier", - "span": { - "start": 96, - "end": 97, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 103, - "end": 126, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 110, - "end": 117, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 111, - "end": 116, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 131, - "end": 143, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 131, - "end": 138, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 132, - "end": 137, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 136, - "end": 137, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 148, - "end": 163, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 148, - "end": 152, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 149, - "end": 151, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 162, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 161, - "end": 162, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "typeArguments": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 168, - "end": 188, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 175, - "end": 179, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 176, - "end": 178, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 193, - "end": 205, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 193, - "end": 196, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 210, - "end": 222, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 227, - "end": 254, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 234, - "end": 245, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 235, - "end": 244, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 240, - "end": 244, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 245, - "end": 253, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 247, - "end": 253, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 259, - "end": 277, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 259, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 260, - "end": 271, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 261, - "end": 270, - "ctxt": 0 - }, - "tail": true, - "cooked": "hello bye", - "raw": "hello bye" - } - ] - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 275, - "end": 276, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 282, - "end": 311, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 289, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 290, - "end": 306, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 291, - "end": 297, - "ctxt": 0 - }, - "tail": false, - "cooked": "hello ", - "raw": "hello " - }, - { - "type": "TemplateElement", - "span": { - "start": 301, - "end": 305, - "ctxt": 0 - }, - "tail": true, - "cooked": " bye", - "raw": " bye" - } - ] - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.ts deleted file mode 100644 index 753c6bbbc38..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES5.ts +++ /dev/null @@ -1,17 +0,0 @@ -// @target: es5 -var s: string; -var n: number; -var a: any; -class C { - [s]: number; - [n] = n; - static [s + s]: string; - [s + n] = 2; - [+s]: typeof s; - static [""]: number; - [0]: number; - [a]: number; - static [true]: number; - [`hello bye`] = 0; - static [`hello ${a} bye`] = 0 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.json deleted file mode 100644 index 81ea3152151..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.json +++ /dev/null @@ -1,859 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 313, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 22, - "end": 30, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 24, - "end": 30, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 32, - "end": 46, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 36, - "end": 45, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 37, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 47, - "end": 58, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 52, - "end": 57, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 59, - "end": 313, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 73, - "end": 85, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 73, - "end": 76, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 76, - "end": 84, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 78, - "end": 84, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 91, - "end": 92, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "value": { - "type": "Identifier", - "span": { - "start": 96, - "end": 97, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 103, - "end": 126, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 110, - "end": 117, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 111, - "end": 116, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 131, - "end": 143, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 131, - "end": 138, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 132, - "end": 137, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 136, - "end": 137, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 148, - "end": 163, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 148, - "end": 152, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 149, - "end": 151, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 162, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 161, - "end": 162, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "typeArguments": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 168, - "end": 188, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 175, - "end": 179, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 176, - "end": 178, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 193, - "end": 205, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 193, - "end": 196, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 210, - "end": 222, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 227, - "end": 254, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 234, - "end": 245, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 235, - "end": 244, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 240, - "end": 244, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 245, - "end": 253, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 247, - "end": 253, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 259, - "end": 277, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 259, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 260, - "end": 271, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 261, - "end": 270, - "ctxt": 0 - }, - "tail": true, - "cooked": "hello bye", - "raw": "hello bye" - } - ] - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 275, - "end": 276, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 282, - "end": 311, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 289, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 290, - "end": 306, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 291, - "end": 297, - "ctxt": 0 - }, - "tail": false, - "cooked": "hello ", - "raw": "hello " - }, - { - "type": "TemplateElement", - "span": { - "start": 301, - "end": 305, - "ctxt": 0 - }, - "tail": true, - "cooked": " bye", - "raw": " bye" - } - ] - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.ts deleted file mode 100644 index 6af0bae44fb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames12_ES6.ts +++ /dev/null @@ -1,17 +0,0 @@ -// @target: es6 -var s: string; -var n: number; -var a: any; -class C { - [s]: number; - [n] = n; - static [s + s]: string; - [s + n] = 2; - [+s]: typeof s; - static [""]: number; - [0]: number; - [a]: number; - static [true]: number; - [`hello bye`] = 0; - static [`hello ${a} bye`] = 0 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.json deleted file mode 100644 index 2edddb4ad93..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 17, - "end": 48, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 48, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 37, - "end": 46, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 44, - "end": 46, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 49, - "end": 110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 60, - "end": 63, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 64, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 70, - "end": 84, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 70, - "end": 73, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 77, - "end": 83, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 89, - "end": 108, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "CallExpression", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 93, - "end": 96, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 103, - "end": 107, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.ts deleted file mode 100644 index 48fc8d8a6c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES5.ts +++ /dev/null @@ -1,6 +0,0 @@ -// @target: es5 -function foo() { return '' } -interface I { - bar(): string; - [foo()](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.json deleted file mode 100644 index 2edddb4ad93..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 17, - "end": 48, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 48, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 37, - "end": 46, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 44, - "end": 46, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 49, - "end": 110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 60, - "end": 63, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 64, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 70, - "end": 84, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 70, - "end": 73, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 77, - "end": 83, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 89, - "end": 108, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "CallExpression", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 93, - "end": 96, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 103, - "end": 107, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.ts deleted file mode 100644 index 010d2aa2eb6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames35_ES6.ts +++ /dev/null @@ -1,6 +0,0 @@ -// @target: es6 -function foo() { return '' } -interface I { - bar(): string; - [foo()](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.json deleted file mode 100644 index ba56d6ed93d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.json +++ /dev/null @@ -1,558 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 205, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 23, - "ctxt": 0 - }, - "value": "id", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 25, - "end": 205, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 39, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 39, - "end": 46, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 40, - "end": 45, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 39, - "end": 52, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 57, - "end": 81, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 64, - "end": 75, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 65, - "end": 74, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 71, - "end": 74, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 57, - "end": 81, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 78, - "end": 81, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 86, - "end": 107, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 90, - "end": 101, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 91, - "end": 100, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "Identifier", - "span": { - "start": 98, - "end": 100, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 86, - "end": 107, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 112, - "end": 131, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 116, - "end": 124, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 121, - "end": 122, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 125, - "end": 126, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 125, - "end": 126, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 112, - "end": 131, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 136, - "end": 165, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 147, - "end": 159, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 156, - "end": 158, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 149, - "end": 155, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 149, - "end": 155, - "ctxt": 0 - }, - "value": "String", - "optional": false - }, - "typeParams": null - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 136, - "end": 165, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 170, - "end": 203, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 181, - "end": 196, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 182, - "end": 195, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 182, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 185, - "end": 193, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 170, - "end": 203, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.ts deleted file mode 100644 index 3e887d083bc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES5.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: es5 -var id; -class C { - [0 + 1]() { } - static [() => { }]() { } - get [delete id]() { } - set [[0, 1]](v) { } - static get [""]() { } - static set [id.toString()](v) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.json deleted file mode 100644 index ba56d6ed93d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.json +++ /dev/null @@ -1,558 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 205, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 23, - "ctxt": 0 - }, - "value": "id", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 25, - "end": 205, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 39, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 39, - "end": 46, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 40, - "end": 45, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 39, - "end": 52, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 57, - "end": 81, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 64, - "end": 75, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 65, - "end": 74, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 71, - "end": 74, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 57, - "end": 81, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 78, - "end": 81, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 86, - "end": 107, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 90, - "end": 101, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 91, - "end": 100, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "Identifier", - "span": { - "start": 98, - "end": 100, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 86, - "end": 107, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 112, - "end": 131, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 116, - "end": 124, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 121, - "end": 122, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 125, - "end": 126, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 125, - "end": 126, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 112, - "end": 131, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 136, - "end": 165, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 147, - "end": 159, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 156, - "end": 158, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 149, - "end": 155, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 149, - "end": 155, - "ctxt": 0 - }, - "value": "String", - "optional": false - }, - "typeParams": null - } - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 136, - "end": 165, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 170, - "end": 203, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 181, - "end": 196, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 182, - "end": 195, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 182, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 185, - "end": 193, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 170, - "end": 203, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.ts deleted file mode 100644 index 0d45920615a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames3_ES6.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: es6 -var id; -class C { - [0 + 1]() { } - static [() => { }]() { } - get [delete id]() { } - set [[0, 1]](v) { } - static get [""]() { } - static set [id.toString()](v) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.json deleted file mode 100644 index c1d0e18decb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 2, - "end": 350, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2, - "end": 350, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6, - "end": 350, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 10, - "end": 350, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 16, - "end": 18, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 20, - "end": 22, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 28, - "end": 67, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 32, - "end": 39, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 33, - "end": 38, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 42, - "end": 67, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 52, - "end": 61, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 58, - "end": 60, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 73, - "end": 113, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 77, - "end": 84, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 78, - "end": 83, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 78, - "end": 79, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 87, - "end": 113, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 97, - "end": 107, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 104, - "end": 106, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 119, - "end": 180, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 123, - "end": 130, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 124, - "end": 125, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "param": { - "type": "Invalid", - "span": { - "start": 123, - "end": 130, - "ctxt": 0 - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 133, - "end": 180, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 171, - "end": 173, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 186, - "end": 258, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 190, - "end": 193, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 196, - "end": 258, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 206, - "end": 252, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 215, - "end": 216, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 218, - "end": 252, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 232, - "end": 242, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 239, - "end": 241, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 264, - "end": 336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 274, - "end": 336, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 284, - "end": 330, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 288, - "end": 294, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 293, - "end": 294, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 296, - "end": 330, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 310, - "end": 320, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 317, - "end": 319, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 342, - "end": 344, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.ts deleted file mode 100644 index fd6ff907268..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES5.ts +++ /dev/null @@ -1,25 +0,0 @@ - -var x = { - p1: 10, - get [1 + 1]() { - throw 10; - }, - get [1 + 1]() { - return 10; - }, - set [1 + 1]() { - // just throw - throw 10; - }, - get foo() { - if (1 == 1) { - return 10; - } - }, - get foo() { - if (2 == 2) { - return 20; - } - }, - p2: 20 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.json deleted file mode 100644 index a848772a97c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 366, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 18, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 366, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 26, - "end": 366, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 34, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 36, - "end": 38, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 44, - "end": 83, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 48, - "end": 55, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 49, - "end": 54, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 53, - "end": 54, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 83, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 68, - "end": 77, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 74, - "end": 76, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 89, - "end": 129, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 93, - "end": 100, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 94, - "end": 99, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 98, - "end": 99, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 103, - "end": 129, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 113, - "end": 123, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 120, - "end": 122, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 135, - "end": 196, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 139, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "param": { - "type": "Invalid", - "span": { - "start": 139, - "end": 146, - "ctxt": 0 - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 149, - "end": 196, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 181, - "end": 190, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 187, - "end": 189, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 202, - "end": 274, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 212, - "end": 274, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 222, - "end": 268, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 226, - "end": 232, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 226, - "end": 227, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 234, - "end": 268, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 248, - "end": 258, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 255, - "end": 257, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 280, - "end": 352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 290, - "end": 352, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 300, - "end": 346, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 312, - "end": 346, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 326, - "end": 336, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 358, - "end": 360, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 362, - "end": 364, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.ts deleted file mode 100644 index ecd012911ed..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames49_ES6.ts +++ /dev/null @@ -1,26 +0,0 @@ -// @target: es6 - -var x = { - p1: 10, - get [1 + 1]() { - throw 10; - }, - get [1 + 1]() { - return 10; - }, - set [1 + 1]() { - // just throw - throw 10; - }, - get foo() { - if (1 == 1) { - return 10; - } - }, - get foo() { - if (2 == 2) { - return 20; - } - }, - p2: 20 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.json deleted file mode 100644 index 61fe98d3923..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 2, - "end": 350, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2, - "end": 350, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6, - "end": 350, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 10, - "end": 350, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 16, - "end": 18, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 20, - "end": 22, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 28, - "end": 100, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 38, - "end": 100, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 48, - "end": 94, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 52, - "end": 58, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 52, - "end": 53, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 57, - "end": 58, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 60, - "end": 94, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 74, - "end": 84, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 81, - "end": 83, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 106, - "end": 145, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 110, - "end": 117, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 111, - "end": 116, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 120, - "end": 145, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 130, - "end": 139, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 136, - "end": 138, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 151, - "end": 212, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 155, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 156, - "end": 161, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "param": { - "type": "Invalid", - "span": { - "start": 155, - "end": 162, - "ctxt": 0 - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 165, - "end": 212, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 197, - "end": 206, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 203, - "end": 205, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 218, - "end": 258, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 227, - "end": 228, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 232, - "end": 258, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 242, - "end": 252, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 249, - "end": 251, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 264, - "end": 336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 274, - "end": 336, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 284, - "end": 330, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 288, - "end": 294, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 293, - "end": 294, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 296, - "end": 330, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 310, - "end": 320, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 317, - "end": 319, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 342, - "end": 344, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.ts deleted file mode 100644 index a7e410b7184..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES5.ts +++ /dev/null @@ -1,25 +0,0 @@ - -var x = { - p1: 10, - get foo() { - if (1 == 1) { - return 10; - } - }, - get [1 + 1]() { - throw 10; - }, - set [1 + 1]() { - // just throw - throw 10; - }, - get [1 + 1]() { - return 10; - }, - get foo() { - if (2 == 2) { - return 20; - } - }, - p2: 20 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.json deleted file mode 100644 index 136a2cddf2f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.json +++ /dev/null @@ -1,518 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 366, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 18, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 366, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 26, - "end": 366, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 34, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 36, - "end": 38, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 44, - "end": 116, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 48, - "end": 51, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 54, - "end": 116, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 64, - "end": 110, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 68, - "end": 74, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 68, - "end": 69, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 73, - "end": 74, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 76, - "end": 110, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 90, - "end": 100, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 97, - "end": 99, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 122, - "end": 161, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 126, - "end": 133, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 127, - "end": 132, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 127, - "end": 128, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 131, - "end": 132, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 136, - "end": 161, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 146, - "end": 155, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 152, - "end": 154, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 167, - "end": 228, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 171, - "end": 178, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "param": { - "type": "Invalid", - "span": { - "start": 171, - "end": 178, - "ctxt": 0 - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 181, - "end": 228, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ThrowStatement", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 219, - "end": 221, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 234, - "end": 274, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 238, - "end": 245, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 239, - "end": 244, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 243, - "end": 244, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 248, - "end": 274, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 258, - "end": 268, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 265, - "end": 267, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 280, - "end": 352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 290, - "end": 352, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 300, - "end": 346, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NumericLiteral", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 312, - "end": 346, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 326, - "end": 336, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "alternate": null - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 358, - "end": 360, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 362, - "end": 364, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.ts deleted file mode 100644 index 04434f6e685..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames50_ES6.ts +++ /dev/null @@ -1,26 +0,0 @@ -// @target: es6 - -var x = { - p1: 10, - get foo() { - if (1 == 1) { - return 10; - } - }, - get [1 + 1]() { - throw 10; - }, - set [1 + 1]() { - // just throw - throw 10; - }, - get [1 + 1]() { - return 10; - }, - get foo() { - if (2 == 2) { - return 20; - } - }, - p2: 20 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.json deleted file mode 100644 index 8052d26366a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 125, - "end": 256, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 125, - "end": 142, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 131, - "end": 141, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "array", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 139, - "end": 141, - "ctxt": 0 - }, - "elements": [] - }, - "definite": false - } - ] - }, - { - "type": "ForStatement", - "span": { - "start": 143, - "end": 256, - "ctxt": 0 - }, - "init": { - "type": "VariableDeclaration", - "span": { - "start": 148, - "end": 157, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 152, - "end": 157, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 152, - "end": 153, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - } - ] - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 159, - "end": 165, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 159, - "end": 160, - "ctxt": 0 - }, - "value": "i", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 163, - "end": 165, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - "update": { - "type": "UpdateExpression", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "value": "i", - "optional": false - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 172, - "end": 256, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 178, - "end": 254, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 178, - "end": 254, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": "array", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 188, - "ctxt": 0 - }, - "value": "push", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "span": { - "start": 189, - "end": 253, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 207, - "end": 221, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "value": "i", - "optional": false - } - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 213, - "end": 220, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 230, - "end": 247, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 237, - "end": 240, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 238, - "end": 239, - "ctxt": 0 - }, - "value": "i", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 243, - "end": 246, - "ctxt": 0 - }, - "value": 100.0, - "raw": "100" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "typeArguments": null - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.ts deleted file mode 100644 index f6afef7fec3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNames52.ts +++ /dev/null @@ -1,11 +0,0 @@ -// @filename: computedPropertyNames52.js -// @out: computedPropertyNames52-emit.js -// @allowJs: true -// @target: es5, es2015 -const array = []; -for (let i = 0; i < 10; ++i) { - array.push(class C { - [i] = () => C; - static [i] = 100; - }) -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.json deleted file mode 100644 index 860e38f4981..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 77, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 39, - "end": 77, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 51, - "end": 77, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 57, - "end": 75, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "BinaryExpression", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 60, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 63, - "end": 65, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 68, - "end": 74, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 70, - "end": 74, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.ts deleted file mode 100644 index 64a0e57d6d3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES5.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es5 -// @declaration: true -interface I { - ["" + ""](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.json deleted file mode 100644 index 860e38f4981..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 77, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 39, - "end": 77, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 51, - "end": 77, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 57, - "end": 75, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "BinaryExpression", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 60, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 63, - "end": 65, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 68, - "end": 74, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 70, - "end": 74, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.ts deleted file mode 100644 index bbd035d203e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit3_ES6.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es6 -// @declaration: true -interface I { - ["" + ""](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.json deleted file mode 100644 index d2b2dfbf8fe..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 72, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 39, - "end": 72, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 43, - "end": 72, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 44, - "end": 72, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 46, - "end": 72, - "ctxt": 0 - }, - "members": [ - { - "type": "TsMethodSignature", - "span": { - "start": 52, - "end": 70, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "BinaryExpression", - "span": { - "start": 53, - "end": 60, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 53, - "end": 55, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 60, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 63, - "end": 69, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 65, - "end": 69, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.ts deleted file mode 100644 index e5f1dd749d5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES5.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es5 -// @declaration: true -var v: { - ["" + ""](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.json deleted file mode 100644 index d2b2dfbf8fe..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 72, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 39, - "end": 72, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 43, - "end": 72, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 44, - "end": 72, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 46, - "end": 72, - "ctxt": 0 - }, - "members": [ - { - "type": "TsMethodSignature", - "span": { - "start": 52, - "end": 70, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "BinaryExpression", - "span": { - "start": 53, - "end": 60, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 53, - "end": 55, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 60, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 63, - "end": 69, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 65, - "end": 69, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.ts deleted file mode 100644 index 4b6977df393..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesDeclarationEmit4_ES6.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es6 -// @declaration: true -var v: { - ["" + ""](): void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.json deleted file mode 100644 index d3b471f92f4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 168, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "value": "methodName", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 34, - "end": 42, - "ctxt": 0 - }, - "value": "method", - "raw": "\"method\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 74, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 73, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 60, - "ctxt": 0 - }, - "value": "accessorName", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 63, - "end": 73, - "ctxt": 0 - }, - "value": "accessor", - "raw": "\"accessor\"" - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 75, - "end": 168, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 89, - "end": 101, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 100, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 102, - "end": 111, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 102, - "end": 111, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 111, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 105, - "end": 111, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 118, - "end": 133, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 118, - "end": 130, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 118, - "end": 133, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 138, - "end": 166, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 138, - "end": 150, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 139, - "end": 149, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 151, - "end": 161, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 151, - "end": 161, - "ctxt": 0 - }, - "value": "v", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 138, - "end": 166, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 163, - "end": 166, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.ts deleted file mode 100644 index 33e9ec828fe..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES5.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: es5 -var methodName = "method"; -var accessorName = "accessor"; -class C { - [methodName](v: string); - [methodName](); - [methodName](v?: string) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.json b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.json deleted file mode 100644 index d3b471f92f4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.json +++ /dev/null @@ -1,342 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 168, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "value": "methodName", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 34, - "end": 42, - "ctxt": 0 - }, - "value": "method", - "raw": "\"method\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 74, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 73, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 60, - "ctxt": 0 - }, - "value": "accessorName", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 63, - "end": 73, - "ctxt": 0 - }, - "value": "accessor", - "raw": "\"accessor\"" - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 75, - "end": 168, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 89, - "end": 101, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 100, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 102, - "end": 111, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 102, - "end": 111, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 111, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 105, - "end": 111, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 89, - "end": 113, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 118, - "end": 133, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 118, - "end": 130, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 118, - "end": 133, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 138, - "end": 166, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 138, - "end": 150, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 139, - "end": 149, - "ctxt": 0 - }, - "value": "methodName", - "optional": false - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 151, - "end": 161, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 151, - "end": 161, - "ctxt": 0 - }, - "value": "v", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 138, - "end": 166, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 163, - "end": 166, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.ts b/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.ts deleted file mode 100644 index 92d3b0bb1e2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/computedPropertyNamesOnOverloads_ES6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: es6 -var methodName = "method"; -var accessorName = "accessor"; -class C { - [methodName](v: string); - [methodName](); - [methodName](v?: string) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.json b/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.json deleted file mode 100644 index 2b639ca9f44..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.json +++ /dev/null @@ -1,3624 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 85, - "end": 2567, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 85, - "end": 108, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 89, - "end": 107, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 99, - "ctxt": 0 - }, - "value": "condObject", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 110, - "end": 128, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 114, - "end": 127, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 122, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 124, - "end": 127, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 129, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 133, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 133, - "end": 145, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 154, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 180, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 171, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 181, - "end": 205, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 185, - "end": 204, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 185, - "end": 196, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 206, - "end": 232, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 210, - "end": 231, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 223, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 223, - "end": 231, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 225, - "end": 231, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 225, - "end": 231, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 234, - "end": 252, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 238, - "end": 251, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 238, - "end": 246, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 246, - "end": 251, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 248, - "end": 251, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 253, - "end": 279, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 257, - "end": 278, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 257, - "end": 269, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 271, - "end": 278, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 280, - "end": 304, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 284, - "end": 303, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 284, - "end": 295, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 295, - "end": 303, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 297, - "end": 303, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 305, - "end": 329, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 309, - "end": 328, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 309, - "end": 320, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 320, - "end": 328, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 322, - "end": 328, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 330, - "end": 356, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 334, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 334, - "end": 347, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 347, - "end": 355, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 349, - "end": 355, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 349, - "end": 355, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 367, - "end": 370, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 358, - "end": 376, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "EmptyStatement", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 384, - "end": 385, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 378, - "end": 413, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 388, - "end": 411, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 395, - "end": 399, - "ctxt": 0 - }, - "value": "doIt", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 399, - "end": 411, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 401, - "end": 411, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 404, - "end": 411, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 413, - "end": 414, - "ctxt": 0 - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 450, - "end": 483, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 450, - "end": 482, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 450, - "end": 460, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 463, - "end": 471, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 474, - "end": 482, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 484, - "end": 525, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 484, - "end": 524, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 484, - "end": 494, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 497, - "end": 509, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 512, - "end": 524, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 526, - "end": 565, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 526, - "end": 564, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 526, - "end": 536, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 539, - "end": 550, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 553, - "end": 564, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 566, - "end": 605, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 566, - "end": 604, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 566, - "end": 576, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 579, - "end": 590, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 593, - "end": 604, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 606, - "end": 649, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 606, - "end": 648, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 606, - "end": 616, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 619, - "end": 632, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 635, - "end": 648, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 650, - "end": 690, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 650, - "end": 689, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 650, - "end": 660, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 663, - "end": 674, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 677, - "end": 689, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 734, - "end": 782, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 734, - "end": 781, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 734, - "end": 759, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 735, - "end": 758, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 736, - "end": 745, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 737, - "end": 745, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 739, - "end": 745, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 750, - "end": 758, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 750, - "end": 751, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 752, - "end": 758, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 762, - "end": 770, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 773, - "end": 781, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 783, - "end": 839, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 783, - "end": 838, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 783, - "end": 808, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 784, - "end": 807, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 785, - "end": 794, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 786, - "end": 794, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 788, - "end": 794, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 799, - "end": 807, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 799, - "end": 800, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 801, - "end": 807, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 811, - "end": 823, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 826, - "end": 838, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 840, - "end": 873, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 840, - "end": 872, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 840, - "end": 844, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 841, - "end": 843, - "ctxt": 0 - }, - "properties": [] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 847, - "end": 858, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 861, - "end": 872, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 874, - "end": 921, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 874, - "end": 920, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 874, - "end": 892, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 875, - "end": 891, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 877, - "end": 878, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 880, - "end": 881, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 883, - "end": 884, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 886, - "end": 889, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 895, - "end": 906, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 909, - "end": 920, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 922, - "end": 973, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 922, - "end": 972, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 922, - "end": 940, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 923, - "end": 939, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 925, - "end": 926, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 928, - "end": 929, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 931, - "end": 932, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 934, - "end": 937, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 943, - "end": 956, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 959, - "end": 972, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 974, - "end": 1021, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 974, - "end": 1020, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 974, - "end": 992, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 975, - "end": 991, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 977, - "end": 978, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 980, - "end": 981, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 983, - "end": 984, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 986, - "end": 989, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 995, - "end": 1006, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1008, - "end": 1020, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1068, - "end": 1096, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1068, - "end": 1095, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1068, - "end": 1073, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1068, - "end": 1071, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1076, - "end": 1084, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1087, - "end": 1095, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1097, - "end": 1138, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1097, - "end": 1137, - "ctxt": 0 - }, - "test": { - "type": "NewExpression", - "span": { - "start": 1097, - "end": 1107, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1101, - "end": 1105, - "ctxt": 0 - }, - "value": "Date", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1122, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1125, - "end": 1137, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1139, - "end": 1175, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1139, - "end": 1174, - "ctxt": 0 - }, - "test": { - "type": "NewExpression", - "span": { - "start": 1139, - "end": 1146, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1144, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1149, - "end": 1160, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1163, - "end": 1174, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1176, - "end": 1213, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1176, - "end": 1212, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1176, - "end": 1184, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1176, - "end": 1182, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1176, - "end": 1177, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1178, - "end": 1182, - "ctxt": 0 - }, - "value": "doIt", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1187, - "end": 1198, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1201, - "end": 1212, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1214, - "end": 1267, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1214, - "end": 1266, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1214, - "end": 1234, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1214, - "end": 1232, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1214, - "end": 1224, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1225, - "end": 1232, - "ctxt": 0 - }, - "value": "valueOf", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1237, - "end": 1250, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1253, - "end": 1266, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1268, - "end": 1308, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1268, - "end": 1307, - "ctxt": 0 - }, - "test": { - "type": "NewExpression", - "span": { - "start": 1268, - "end": 1278, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1272, - "end": 1276, - "ctxt": 0 - }, - "value": "Date", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1281, - "end": 1292, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1295, - "end": 1307, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1362, - "end": 1414, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1366, - "end": 1413, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1366, - "end": 1378, - "ctxt": 0 - }, - "value": "resultIsAny1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1381, - "end": 1413, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1381, - "end": 1391, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1394, - "end": 1402, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1405, - "end": 1413, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1415, - "end": 1479, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1419, - "end": 1478, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1419, - "end": 1435, - "ctxt": 0 - }, - "value": "resultIsBoolean1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1438, - "end": 1478, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1438, - "end": 1448, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1451, - "end": 1463, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1466, - "end": 1478, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1480, - "end": 1541, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1484, - "end": 1540, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1484, - "end": 1499, - "ctxt": 0 - }, - "value": "resultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1502, - "end": 1540, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1502, - "end": 1512, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1515, - "end": 1526, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1529, - "end": 1540, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1542, - "end": 1603, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1546, - "end": 1602, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1546, - "end": 1561, - "ctxt": 0 - }, - "value": "resultIsString1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1564, - "end": 1602, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1564, - "end": 1574, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1577, - "end": 1588, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1591, - "end": 1602, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1604, - "end": 1669, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1608, - "end": 1668, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1608, - "end": 1623, - "ctxt": 0 - }, - "value": "resultIsObject1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1626, - "end": 1668, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1626, - "end": 1636, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1639, - "end": 1652, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1655, - "end": 1668, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1670, - "end": 1741, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1674, - "end": 1740, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1674, - "end": 1698, - "ctxt": 0 - }, - "value": "resultIsStringOrBoolean1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1701, - "end": 1740, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1701, - "end": 1711, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1714, - "end": 1725, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1728, - "end": 1740, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1752, - "end": 1819, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1756, - "end": 1818, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1756, - "end": 1768, - "ctxt": 0 - }, - "value": "resultIsAny2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1771, - "end": 1818, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 1771, - "end": 1796, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1772, - "end": 1795, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1773, - "end": 1782, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1774, - "end": 1782, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1776, - "end": 1782, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 1787, - "end": 1795, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1787, - "end": 1788, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1789, - "end": 1795, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1799, - "end": 1807, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1810, - "end": 1818, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1820, - "end": 1899, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1824, - "end": 1898, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1824, - "end": 1840, - "ctxt": 0 - }, - "value": "resultIsBoolean2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1843, - "end": 1898, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 1843, - "end": 1868, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1844, - "end": 1867, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1845, - "end": 1854, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1846, - "end": 1854, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1848, - "end": 1854, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 1859, - "end": 1867, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1859, - "end": 1860, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1861, - "end": 1867, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1871, - "end": 1883, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1886, - "end": 1898, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1900, - "end": 1955, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1904, - "end": 1954, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1904, - "end": 1919, - "ctxt": 0 - }, - "value": "resultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1922, - "end": 1954, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 1922, - "end": 1926, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1923, - "end": 1925, - "ctxt": 0 - }, - "properties": [] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1929, - "end": 1940, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 1943, - "end": 1954, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1956, - "end": 2025, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1960, - "end": 2024, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1960, - "end": 1975, - "ctxt": 0 - }, - "value": "resultIsString2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 1978, - "end": 2024, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 1978, - "end": 1996, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1979, - "end": 1995, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1981, - "end": 1982, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1984, - "end": 1985, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1987, - "end": 1988, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1990, - "end": 1993, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 1999, - "end": 2010, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2013, - "end": 2024, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2026, - "end": 2099, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2030, - "end": 2098, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2030, - "end": 2045, - "ctxt": 0 - }, - "value": "resultIsObject2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2048, - "end": 2098, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 2048, - "end": 2066, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 2049, - "end": 2065, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2051, - "end": 2052, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 2054, - "end": 2055, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2057, - "end": 2058, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2060, - "end": 2063, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2069, - "end": 2082, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2085, - "end": 2098, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2100, - "end": 2179, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2104, - "end": 2178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2104, - "end": 2128, - "ctxt": 0 - }, - "value": "resultIsStringOrBoolean2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2131, - "end": 2178, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 2131, - "end": 2149, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 2132, - "end": 2148, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2134, - "end": 2135, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 2137, - "end": 2138, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2140, - "end": 2141, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2143, - "end": 2146, - "ctxt": 0 - }, - "value": "s", - "raw": "\"s\"" - } - } - ] - } - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2152, - "end": 2163, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2166, - "end": 2178, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2190, - "end": 2237, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2194, - "end": 2236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2194, - "end": 2206, - "ctxt": 0 - }, - "value": "resultIsAny3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2209, - "end": 2236, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 2209, - "end": 2214, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2209, - "end": 2212, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2217, - "end": 2225, - "ctxt": 0 - }, - "value": "exprAny1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2228, - "end": 2236, - "ctxt": 0 - }, - "value": "exprAny2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2238, - "end": 2302, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2242, - "end": 2301, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2242, - "end": 2258, - "ctxt": 0 - }, - "value": "resultIsBoolean3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2261, - "end": 2301, - "ctxt": 0 - }, - "test": { - "type": "NewExpression", - "span": { - "start": 2261, - "end": 2271, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2265, - "end": 2269, - "ctxt": 0 - }, - "value": "Date", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2274, - "end": 2286, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2289, - "end": 2301, - "ctxt": 0 - }, - "value": "exprBoolean2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2303, - "end": 2361, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2307, - "end": 2360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2307, - "end": 2322, - "ctxt": 0 - }, - "value": "resultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2325, - "end": 2360, - "ctxt": 0 - }, - "test": { - "type": "NewExpression", - "span": { - "start": 2325, - "end": 2332, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2329, - "end": 2330, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2335, - "end": 2346, - "ctxt": 0 - }, - "value": "exprNumber1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2349, - "end": 2360, - "ctxt": 0 - }, - "value": "exprNumber2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2362, - "end": 2421, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2366, - "end": 2420, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2366, - "end": 2381, - "ctxt": 0 - }, - "value": "resultIsString3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2384, - "end": 2420, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 2384, - "end": 2392, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 2384, - "end": 2390, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2384, - "end": 2385, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2386, - "end": 2390, - "ctxt": 0 - }, - "value": "doIt", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2395, - "end": 2406, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2409, - "end": 2420, - "ctxt": 0 - }, - "value": "exprString2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2422, - "end": 2497, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2426, - "end": 2496, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2426, - "end": 2441, - "ctxt": 0 - }, - "value": "resultIsObject3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2444, - "end": 2496, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 2444, - "end": 2464, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 2444, - "end": 2462, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2444, - "end": 2454, - "ctxt": 0 - }, - "value": "condObject", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2455, - "end": 2462, - "ctxt": 0 - }, - "value": "valueOf", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2467, - "end": 2480, - "ctxt": 0 - }, - "value": "exprIsObject1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2483, - "end": 2496, - "ctxt": 0 - }, - "value": "exprIsObject2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2498, - "end": 2567, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2502, - "end": 2566, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2502, - "end": 2526, - "ctxt": 0 - }, - "value": "resultIsStringOrBoolean3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2529, - "end": 2566, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 2529, - "end": 2537, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 2529, - "end": 2535, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2529, - "end": 2530, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2531, - "end": 2535, - "ctxt": 0 - }, - "value": "doIt", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "Identifier", - "span": { - "start": 2540, - "end": 2551, - "ctxt": 0 - }, - "value": "exprString1", - "optional": false - }, - "alternate": { - "type": "Identifier", - "span": { - "start": 2554, - "end": 2566, - "ctxt": 0 - }, - "value": "exprBoolean1", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.ts b/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.ts deleted file mode 100644 index 24b6970e12b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/conditionalOperatorConditionIsObjectType.ts +++ /dev/null @@ -1,63 +0,0 @@ -//Cond ? Expr1 : Expr2, Cond is of object type, Expr1 and Expr2 have the same type -var condObject: Object; - -var exprAny1: any; -var exprBoolean1: boolean; -var exprNumber1: number; -var exprString1: string; -var exprIsObject1: Object; - -var exprAny2: any; -var exprBoolean2: boolean; -var exprNumber2: number; -var exprString2: string; -var exprIsObject2: Object; - -function foo() { }; -class C { static doIt: () => void }; - -//Cond is an object type variable -condObject ? exprAny1 : exprAny2; -condObject ? exprBoolean1 : exprBoolean2; -condObject ? exprNumber1 : exprNumber2; -condObject ? exprString1 : exprString2; -condObject ? exprIsObject1 : exprIsObject2; -condObject ? exprString1 : exprBoolean1; // union - -//Cond is an object type literal -((a: string) => a.length) ? exprAny1 : exprAny2; -((a: string) => a.length) ? exprBoolean1 : exprBoolean2; -({}) ? exprNumber1 : exprNumber2; -({ a: 1, b: "s" }) ? exprString1 : exprString2; -({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; -({ a: 1, b: "s" }) ? exprString1: exprBoolean1; // union - -//Cond is an object type expression -foo() ? exprAny1 : exprAny2; -new Date() ? exprBoolean1 : exprBoolean2; -new C() ? exprNumber1 : exprNumber2; -C.doIt() ? exprString1 : exprString2; -condObject.valueOf() ? exprIsObject1 : exprIsObject2; -new Date() ? exprString1 : exprBoolean1; // union - -//Results shoud be same as Expr1 and Expr2 -var resultIsAny1 = condObject ? exprAny1 : exprAny2; -var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; -var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; -var resultIsString1 = condObject ? exprString1 : exprString2; -var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean1 = condObject ? exprString1 : exprBoolean1; // union - -var resultIsAny2 = ((a: string) => a.length) ? exprAny1 : exprAny2; -var resultIsBoolean2 = ((a: string) => a.length) ? exprBoolean1 : exprBoolean2; -var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; -var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; -var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; // union - -var resultIsAny3 = foo() ? exprAny1 : exprAny2; -var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; -var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; -var resultIsString3 = C.doIt() ? exprString1 : exprString2; -var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; -var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union diff --git a/crates/swc_ecma_parser/tests/tsc/constAssertions.json b/crates/swc_ecma_parser/tests/tsc/constAssertions.json deleted file mode 100644 index b3cab07a6b0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/constAssertions.json +++ /dev/null @@ -1,6934 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 60, - "end": 2920, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 60, - "end": 84, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 64, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 64, - "end": 66, - "ctxt": 0 - }, - "value": "v1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 69, - "end": 83, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 69, - "end": 74, - "ctxt": 0 - }, - "value": "abc", - "raw": "'abc'" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 85, - "end": 109, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 89, - "end": 108, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 91, - "ctxt": 0 - }, - "value": "v2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 94, - "end": 108, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 94, - "end": 99, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 95, - "end": 98, - "ctxt": 0 - }, - "tail": true, - "cooked": "abc", - "raw": "abc" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 110, - "end": 131, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 114, - "end": 130, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 116, - "ctxt": 0 - }, - "value": "v3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 119, - "end": 130, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 119, - "end": 121, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 132, - "end": 154, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 136, - "end": 153, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 136, - "end": 138, - "ctxt": 0 - }, - "value": "v4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 141, - "end": 153, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 141, - "end": 144, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "NumericLiteral", - "span": { - "start": 142, - "end": 144, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 155, - "end": 177, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 159, - "end": 176, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 161, - "ctxt": 0 - }, - "value": "v5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 164, - "end": 176, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 164, - "end": 167, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "NumericLiteral", - "span": { - "start": 165, - "end": 167, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 178, - "end": 200, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 182, - "end": 199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "value": "v6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 187, - "end": 199, - "ctxt": 0 - }, - "expression": { - "type": "BigIntLiteral", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "value": [ - 1, - [ - 10 - ] - ], - "raw": "10n" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 201, - "end": 224, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 205, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 207, - "ctxt": 0 - }, - "value": "v7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 210, - "end": 223, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 210, - "end": 214, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "BigIntLiteral", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "value": [ - 1, - [ - 10 - ] - ], - "raw": "10n" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 225, - "end": 248, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 229, - "end": 247, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 229, - "end": 231, - "ctxt": 0 - }, - "value": "v8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 234, - "end": 247, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 249, - "end": 273, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 253, - "end": 272, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "v9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 258, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 258, - "end": 263, - "ctxt": 0 - }, - "value": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 275, - "end": 299, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 279, - "end": 298, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 279, - "end": 281, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 284, - "end": 298, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "value": "abc", - "raw": "'abc'" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 300, - "end": 324, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 304, - "end": 323, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 304, - "end": 306, - "ctxt": 0 - }, - "value": "c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 309, - "end": 323, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "tail": true, - "cooked": "abc", - "raw": "abc" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 325, - "end": 346, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 329, - "end": 345, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 329, - "end": 331, - "ctxt": 0 - }, - "value": "c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 334, - "end": 345, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 334, - "end": 336, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 347, - "end": 369, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 351, - "end": 368, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 351, - "end": 353, - "ctxt": 0 - }, - "value": "c4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 356, - "end": 368, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "NumericLiteral", - "span": { - "start": 357, - "end": 359, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 370, - "end": 392, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 374, - "end": 391, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 374, - "end": 376, - "ctxt": 0 - }, - "value": "c5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 379, - "end": 391, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "NumericLiteral", - "span": { - "start": 380, - "end": 382, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 393, - "end": 415, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 397, - "end": 414, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 397, - "end": 399, - "ctxt": 0 - }, - "value": "c6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 402, - "end": 414, - "ctxt": 0 - }, - "expression": { - "type": "BigIntLiteral", - "span": { - "start": 402, - "end": 405, - "ctxt": 0 - }, - "value": [ - 1, - [ - 10 - ] - ], - "raw": "10n" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 416, - "end": 439, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 420, - "end": 438, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 420, - "end": 422, - "ctxt": 0 - }, - "value": "c7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 425, - "end": 438, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 425, - "end": 429, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "BigIntLiteral", - "span": { - "start": 426, - "end": 429, - "ctxt": 0 - }, - "value": [ - 1, - [ - 10 - ] - ], - "raw": "10n" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 440, - "end": 463, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 444, - "end": 462, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 444, - "end": 446, - "ctxt": 0 - }, - "value": "c8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 449, - "end": 462, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 449, - "end": 453, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 464, - "end": 488, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 468, - "end": 487, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 468, - "end": 470, - "ctxt": 0 - }, - "value": "c9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 473, - "end": 487, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 473, - "end": 478, - "ctxt": 0 - }, - "value": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 490, - "end": 503, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 494, - "end": 502, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "value": "vv1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 500, - "end": 502, - "ctxt": 0 - }, - "value": "v1", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 504, - "end": 517, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 508, - "end": 516, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 508, - "end": 511, - "ctxt": 0 - }, - "value": "vc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 514, - "end": 516, - "ctxt": 0 - }, - "value": "c1", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 519, - "end": 540, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 523, - "end": 539, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 523, - "end": 525, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 528, - "end": 539, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 528, - "end": 530, - "ctxt": 0 - }, - "elements": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 541, - "end": 569, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 545, - "end": 568, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 545, - "end": 547, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 550, - "end": 568, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 550, - "end": 559, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 551, - "end": 552, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 554, - "end": 555, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 557, - "end": 558, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 570, - "end": 608, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 574, - "end": 607, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 574, - "end": 576, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 579, - "end": 607, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 579, - "end": 598, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 580, - "end": 582, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 584, - "end": 591, - "ctxt": 0 - }, - "value": "hello", - "raw": "'hello'" - } - }, - { - "spread": null, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 593, - "end": 597, - "ctxt": 0 - }, - "value": true - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 609, - "end": 642, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 613, - "end": 641, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 613, - "end": 615, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 618, - "end": 641, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 618, - "end": 632, - "ctxt": 0 - }, - "elements": [ - { - "spread": { - "start": 619, - "end": 622, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 622, - "end": 631, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 623, - "end": 624, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 626, - "end": 627, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 629, - "end": 630, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 643, - "end": 662, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 647, - "end": 661, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 647, - "end": 649, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 652, - "end": 661, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 653, - "end": 654, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 656, - "end": 657, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 659, - "end": 660, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 663, - "end": 689, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 667, - "end": 688, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 667, - "end": 669, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 672, - "end": 688, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 672, - "end": 679, - "ctxt": 0 - }, - "elements": [ - { - "spread": { - "start": 673, - "end": 676, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 676, - "end": 678, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 690, - "end": 707, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 694, - "end": 706, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 694, - "end": 696, - "ctxt": 0 - }, - "value": "a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 699, - "end": 706, - "ctxt": 0 - }, - "elements": [ - { - "spread": { - "start": 700, - "end": 703, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 703, - "end": 705, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 708, - "end": 741, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 712, - "end": 740, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 712, - "end": 714, - "ctxt": 0 - }, - "value": "a8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 717, - "end": 740, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 717, - "end": 731, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 718, - "end": 723, - "ctxt": 0 - }, - "value": "abc", - "raw": "'abc'" - } - }, - { - "spread": { - "start": 725, - "end": 728, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 728, - "end": 730, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 742, - "end": 759, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 746, - "end": 758, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 746, - "end": 748, - "ctxt": 0 - }, - "value": "a9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 751, - "end": 758, - "ctxt": 0 - }, - "elements": [ - { - "spread": { - "start": 752, - "end": 755, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 755, - "end": 757, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 761, - "end": 800, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 773, - "end": 799, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 773, - "end": 774, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 774, - "end": 799, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 776, - "end": 799, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 779, - "end": 788, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 780, - "end": 788, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 782, - "end": 788, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 789, - "end": 797, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 791, - "end": 797, - "ctxt": 0 - }, - "kind": "string" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 778, - "end": 797, - "ctxt": 0 - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 802, - "end": 837, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 806, - "end": 836, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 806, - "end": 808, - "ctxt": 0 - }, - "value": "o1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 811, - "end": 836, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 811, - "end": 827, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 813, - "end": 814, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 816, - "end": 818, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 820, - "end": 821, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 823, - "end": 825, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 838, - "end": 906, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 842, - "end": 905, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 842, - "end": 844, - "ctxt": 0 - }, - "value": "o2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 847, - "end": 905, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 847, - "end": 896, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 849, - "end": 850, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 852, - "end": 853, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 855, - "end": 858, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 860, - "end": 861, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 863, - "end": 868, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 864, - "end": 867, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 870, - "end": 871, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - }, - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 873, - "end": 874, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 873, - "end": 879, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 877, - "end": 879, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 881, - "end": 891, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 882, - "end": 890, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 882, - "end": 885, - "ctxt": 0 - }, - "value": "e", - "raw": "'e'" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 888, - "end": 890, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 893, - "end": 894, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 907, - "end": 942, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 911, - "end": 941, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 911, - "end": 913, - "ctxt": 0 - }, - "value": "o3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 916, - "end": 941, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 916, - "end": 932, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 918, - "end": 921, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 921, - "end": 923, - "ctxt": 0 - }, - "value": "o1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 925, - "end": 928, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 928, - "end": 930, - "ctxt": 0 - }, - "value": "o2", - "optional": false - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 943, - "end": 967, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 947, - "end": 966, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 947, - "end": 949, - "ctxt": 0 - }, - "value": "o4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 952, - "end": 966, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 954, - "end": 955, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 957, - "end": 958, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 960, - "end": 961, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 963, - "end": 964, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 968, - "end": 996, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 972, - "end": 995, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 972, - "end": 974, - "ctxt": 0 - }, - "value": "o5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 977, - "end": 995, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 977, - "end": 986, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 979, - "end": 982, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 982, - "end": 984, - "ctxt": 0 - }, - "value": "o4", - "optional": false - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 997, - "end": 1016, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1001, - "end": 1015, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1001, - "end": 1003, - "ctxt": 0 - }, - "value": "o6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1006, - "end": 1015, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1008, - "end": 1011, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1011, - "end": 1013, - "ctxt": 0 - }, - "value": "o5", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1017, - "end": 1044, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1021, - "end": 1043, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1021, - "end": 1023, - "ctxt": 0 - }, - "value": "o7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1026, - "end": 1043, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1026, - "end": 1034, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1028, - "end": 1031, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1031, - "end": 1032, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1045, - "end": 1064, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1049, - "end": 1063, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1049, - "end": 1051, - "ctxt": 0 - }, - "value": "o8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1054, - "end": 1063, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1056, - "end": 1059, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1059, - "end": 1061, - "ctxt": 0 - }, - "value": "o7", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1065, - "end": 1116, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1069, - "end": 1115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1069, - "end": 1071, - "ctxt": 0 - }, - "value": "o9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1074, - "end": 1115, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1074, - "end": 1106, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1076, - "end": 1077, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1079, - "end": 1081, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1083, - "end": 1086, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 1083, - "end": 1104, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1089, - "end": 1104, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1091, - "end": 1102, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1091, - "end": 1102, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1091, - "end": 1097, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1091, - "end": 1095, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1096, - "end": 1097, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1100, - "end": 1102, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1128, - "end": 1151, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1132, - "end": 1150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1132, - "end": 1134, - "ctxt": 0 - }, - "value": "p1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1137, - "end": 1150, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1137, - "end": 1141, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1138, - "end": 1140, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1152, - "end": 1178, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1156, - "end": 1177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1156, - "end": 1158, - "ctxt": 0 - }, - "value": "p2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1161, - "end": 1177, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1161, - "end": 1168, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1162, - "end": 1167, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1163, - "end": 1166, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "NumericLiteral", - "span": { - "start": 1164, - "end": 1166, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1179, - "end": 1206, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1183, - "end": 1205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1183, - "end": 1185, - "ctxt": 0 - }, - "value": "p3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1188, - "end": 1205, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1188, - "end": 1196, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1189, - "end": 1195, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1190, - "end": 1194, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1191, - "end": 1193, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - } - ] - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1207, - "end": 1236, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1211, - "end": 1235, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1211, - "end": 1213, - "ctxt": 0 - }, - "value": "p4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1216, - "end": 1235, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1216, - "end": 1226, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1217, - "end": 1225, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1218, - "end": 1224, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1219, - "end": 1223, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1220, - "end": 1222, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - } - ] - } - } - ] - } - } - ] - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1238, - "end": 1300, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1242, - "end": 1299, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1242, - "end": 1244, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1247, - "end": 1299, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1247, - "end": 1290, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1249, - "end": 1250, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1252, - "end": 1254, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1256, - "end": 1257, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 1259, - "end": 1267, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1260, - "end": 1262, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1264, - "end": 1266, - "ctxt": 0 - }, - "value": 30.0, - "raw": "30" - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1269, - "end": 1270, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 1272, - "end": 1288, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1275, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 1277, - "end": 1286, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1279, - "end": 1280, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1282, - "end": 1284, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - ] - } - } - ] - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1302, - "end": 1322, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1306, - "end": 1321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1306, - "end": 1308, - "ctxt": 0 - }, - "value": "q1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1311, - "end": 1321, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1319, - "end": 1321, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1323, - "end": 1346, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1327, - "end": 1345, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1327, - "end": 1329, - "ctxt": 0 - }, - "value": "q2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1332, - "end": 1345, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1340, - "end": 1345, - "ctxt": 0 - }, - "value": "abc", - "raw": "'abc'" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1347, - "end": 1369, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1351, - "end": 1368, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1351, - "end": 1353, - "ctxt": 0 - }, - "value": "q3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1356, - "end": 1368, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 1364, - "end": 1368, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1370, - "end": 1397, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1374, - "end": 1396, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1374, - "end": 1376, - "ctxt": 0 - }, - "value": "q4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1379, - "end": 1396, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1387, - "end": 1396, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1388, - "end": 1389, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1391, - "end": 1392, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1394, - "end": 1395, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1398, - "end": 1432, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1402, - "end": 1431, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1402, - "end": 1404, - "ctxt": 0 - }, - "value": "q5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1407, - "end": 1431, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1415, - "end": 1431, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1417, - "end": 1418, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1420, - "end": 1422, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1424, - "end": 1425, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1427, - "end": 1429, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1451, - "end": 1453, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1457, - "end": 1461, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1457, - "end": 1461, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1458, - "end": 1461, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1460, - "end": 1461, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1460, - "end": 1461, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1434, - "end": 1466, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1453, - "end": 1456, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1454, - "end": 1455, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1454, - "end": 1455, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1462, - "end": 1465, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1464, - "end": 1465, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1464, - "end": 1465, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1468, - "end": 1489, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1472, - "end": 1488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1472, - "end": 1474, - "ctxt": 0 - }, - "value": "e1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1477, - "end": 1488, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1477, - "end": 1479, - "ctxt": 0 - }, - "value": "v1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1500, - "end": 1533, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1504, - "end": 1532, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1504, - "end": 1506, - "ctxt": 0 - }, - "value": "e2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1509, - "end": 1532, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1509, - "end": 1523, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1510, - "end": 1522, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 1510, - "end": 1514, - "ctxt": 0 - }, - "value": true - }, - "consequent": { - "type": "NumericLiteral", - "span": { - "start": 1517, - "end": 1518, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "alternate": { - "type": "NumericLiteral", - "span": { - "start": 1521, - "end": 1522, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1544, - "end": 1568, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1548, - "end": 1567, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1548, - "end": 1550, - "ctxt": 0 - }, - "value": "e3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1553, - "end": 1567, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1553, - "end": 1558, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1553, - "end": 1555, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1556, - "end": 1557, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1580, - "end": 1604, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1584, - "end": 1603, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1584, - "end": 1586, - "ctxt": 0 - }, - "value": "t1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1589, - "end": 1603, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1589, - "end": 1594, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1605, - "end": 1629, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1609, - "end": 1628, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1609, - "end": 1611, - "ctxt": 0 - }, - "value": "t2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1614, - "end": 1628, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1614, - "end": 1619, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1630, - "end": 1662, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1634, - "end": 1661, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1634, - "end": 1636, - "ctxt": 0 - }, - "value": "t3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1639, - "end": 1661, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1639, - "end": 1652, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1642, - "end": 1644, - "ctxt": 0 - }, - "value": "t1", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 1648, - "end": 1650, - "ctxt": 0 - }, - "value": "t2", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1640, - "end": 1640, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1645, - "end": 1646, - "ctxt": 0 - }, - "tail": false, - "cooked": "-", - "raw": "-" - }, - { - "type": "TemplateElement", - "span": { - "start": 1651, - "end": 1651, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1663, - "end": 1709, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1667, - "end": 1708, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1667, - "end": 1669, - "ctxt": 0 - }, - "value": "t4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 1672, - "end": 1708, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1672, - "end": 1699, - "ctxt": 0 - }, - "expressions": [ - { - "type": "TemplateLiteral", - "span": { - "start": 1675, - "end": 1684, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1679, - "end": 1681, - "ctxt": 0 - }, - "value": "t1", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1676, - "end": 1677, - "ctxt": 0 - }, - "tail": false, - "cooked": "(", - "raw": "(" - }, - { - "type": "TemplateElement", - "span": { - "start": 1682, - "end": 1683, - "ctxt": 0 - }, - "tail": true, - "cooked": ")", - "raw": ")" - } - ] - }, - { - "type": "TemplateLiteral", - "span": { - "start": 1688, - "end": 1697, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1692, - "end": 1694, - "ctxt": 0 - }, - "value": "t2", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1689, - "end": 1690, - "ctxt": 0 - }, - "tail": false, - "cooked": "(", - "raw": "(" - }, - { - "type": "TemplateElement", - "span": { - "start": 1695, - "end": 1696, - "ctxt": 0 - }, - "tail": true, - "cooked": ")", - "raw": ")" - } - ] - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1673, - "end": 1673, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1685, - "end": 1686, - "ctxt": 0 - }, - "tail": false, - "cooked": "-", - "raw": "-" - }, - { - "type": "TemplateElement", - "span": { - "start": 1698, - "end": 1698, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1720, - "end": 1723, - "ctxt": 0 - }, - "value": "ff1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1724, - "end": 1740, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1724, - "end": 1740, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1725, - "end": 1740, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1727, - "end": 1740, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 1727, - "end": 1732, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1727, - "end": 1732, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1735, - "end": 1740, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1735, - "end": 1740, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1742, - "end": 1750, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1742, - "end": 1750, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1743, - "end": 1750, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1745, - "end": 1750, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 1745, - "end": 1746, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1745, - "end": 1746, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1749, - "end": 1750, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1749, - "end": 1750, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1711, - "end": 1788, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1752, - "end": 1788, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1758, - "end": 1786, - "ctxt": 0 - }, - "argument": { - "type": "TsConstAssertion", - "span": { - "start": 1765, - "end": 1785, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1765, - "end": 1776, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1768, - "end": 1769, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 1773, - "end": 1774, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1766, - "end": 1766, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1770, - "end": 1771, - "ctxt": 0 - }, - "tail": false, - "cooked": "-", - "raw": "-" - }, - { - "type": "TemplateElement", - "span": { - "start": 1775, - "end": 1775, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1799, - "end": 1802, - "ctxt": 0 - }, - "value": "ff2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1839, - "end": 1843, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1839, - "end": 1843, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1840, - "end": 1843, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1842, - "end": 1843, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1842, - "end": 1843, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1845, - "end": 1849, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1845, - "end": 1849, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1846, - "end": 1849, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1848, - "end": 1849, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1848, - "end": 1849, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1790, - "end": 1887, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1851, - "end": 1887, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1857, - "end": 1885, - "ctxt": 0 - }, - "argument": { - "type": "TsConstAssertion", - "span": { - "start": 1864, - "end": 1884, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1864, - "end": 1875, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1867, - "end": 1868, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 1872, - "end": 1873, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1865, - "end": 1865, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1869, - "end": 1870, - "ctxt": 0 - }, - "tail": false, - "cooked": "-", - "raw": "-" - }, - { - "type": "TemplateElement", - "span": { - "start": 1874, - "end": 1874, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1802, - "end": 1838, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1803, - "end": 1819, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1803, - "end": 1804, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 1813, - "end": 1819, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 1821, - "end": 1837, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1821, - "end": 1822, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 1831, - "end": 1837, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1889, - "end": 1919, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1895, - "end": 1918, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1895, - "end": 1898, - "ctxt": 0 - }, - "value": "ts1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 1901, - "end": 1918, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1901, - "end": 1904, - "ctxt": 0 - }, - "value": "ff2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1905, - "end": 1910, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1912, - "end": 1917, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1920, - "end": 1963, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1926, - "end": 1962, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1926, - "end": 1929, - "ctxt": 0 - }, - "value": "ts2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 1932, - "end": 1962, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1932, - "end": 1935, - "ctxt": 0 - }, - "value": "ff2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1936, - "end": 1941, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - }, - { - "spread": null, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1943, - "end": 1961, - "ctxt": 0 - }, - "test": { - "type": "UnaryExpression", - "span": { - "start": 1943, - "end": 1949, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1944, - "end": 1949, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 1945, - "end": 1949, - "ctxt": 0 - }, - "value": true - } - } - }, - "consequent": { - "type": "StringLiteral", - "span": { - "start": 1952, - "end": 1955, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - }, - "alternate": { - "type": "StringLiteral", - "span": { - "start": 1958, - "end": 1961, - "ctxt": 0 - }, - "value": "1", - "raw": "'1'" - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1964, - "end": 2034, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1970, - "end": 2033, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1970, - "end": 1973, - "ctxt": 0 - }, - "value": "ts3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 1976, - "end": 2033, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1979, - "ctxt": 0 - }, - "value": "ff2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1980, - "end": 2005, - "ctxt": 0 - }, - "test": { - "type": "UnaryExpression", - "span": { - "start": 1980, - "end": 1986, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 1981, - "end": 1986, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 1982, - "end": 1986, - "ctxt": 0 - }, - "value": true - } - } - }, - "consequent": { - "type": "StringLiteral", - "span": { - "start": 1989, - "end": 1994, - "ctxt": 0 - }, - "value": "top", - "raw": "'top'" - }, - "alternate": { - "type": "StringLiteral", - "span": { - "start": 1997, - "end": 2005, - "ctxt": 0 - }, - "value": "bottom", - "raw": "'bottom'" - } - } - }, - { - "spread": null, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 2007, - "end": 2032, - "ctxt": 0 - }, - "test": { - "type": "UnaryExpression", - "span": { - "start": 2007, - "end": 2013, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "UnaryExpression", - "span": { - "start": 2008, - "end": 2013, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 2009, - "end": 2013, - "ctxt": 0 - }, - "value": true - } - } - }, - "consequent": { - "type": "StringLiteral", - "span": { - "start": 2016, - "end": 2022, - "ctxt": 0 - }, - "value": "left", - "raw": "'left'" - }, - "alternate": { - "type": "StringLiteral", - "span": { - "start": 2025, - "end": 2032, - "ctxt": 0 - }, - "value": "right", - "raw": "'right'" - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2045, - "end": 2048, - "ctxt": 0 - }, - "value": "ff3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2049, - "end": 2065, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2049, - "end": 2065, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2050, - "end": 2065, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 2052, - "end": 2065, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 2052, - "end": 2057, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2052, - "end": 2057, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 2060, - "end": 2065, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2060, - "end": 2065, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2067, - "end": 2076, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2067, - "end": 2076, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2068, - "end": 2076, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2070, - "end": 2076, - "ctxt": 0 - }, - "kind": "object" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2036, - "end": 2113, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2078, - "end": 2113, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2084, - "end": 2111, - "ctxt": 0 - }, - "argument": { - "type": "TsConstAssertion", - "span": { - "start": 2091, - "end": 2110, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2091, - "end": 2101, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2094, - "end": 2095, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 2098, - "end": 2099, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2092, - "end": 2092, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2096, - "end": 2096, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2100, - "end": 2100, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2115, - "end": 2148, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2120, - "end": 2126, - "ctxt": 0 - }, - "value": "Action", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 2129, - "end": 2147, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 2129, - "end": 2137, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2129, - "end": 2137, - "ctxt": 0 - }, - "value": "verify", - "raw": "\"verify\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 2140, - "end": 2147, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2140, - "end": 2147, - "ctxt": 0 - }, - "value": "write", - "raw": "\"write\"" - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2149, - "end": 2190, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2154, - "end": 2166, - "ctxt": 0 - }, - "value": "ContentMatch", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 2169, - "end": 2189, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 2169, - "end": 2176, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2169, - "end": 2176, - "ctxt": 0 - }, - "value": "match", - "raw": "\"match\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 2179, - "end": 2189, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 2179, - "end": 2189, - "ctxt": 0 - }, - "value": "nonMatch", - "raw": "\"nonMatch\"" - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2191, - "end": 2234, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2196, - "end": 2203, - "ctxt": 0 - }, - "value": "Outcome", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 2206, - "end": 2233, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2206, - "end": 2233, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 2209, - "end": 2215, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2209, - "end": 2215, - "ctxt": 0 - }, - "value": "Action", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 2219, - "end": 2231, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2219, - "end": 2231, - "ctxt": 0 - }, - "value": "ContentMatch", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2207, - "end": 2207, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2216, - "end": 2217, - "ctxt": 0 - }, - "tail": false, - "cooked": "_", - "raw": "_" - }, - { - "type": "TemplateElement", - "span": { - "start": 2232, - "end": 2232, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2245, - "end": 2248, - "ctxt": 0 - }, - "value": "ff4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2249, - "end": 2264, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2249, - "end": 2264, - "ctxt": 0 - }, - "value": "verify", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2255, - "end": 2264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2257, - "end": 2264, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2266, - "end": 2289, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2266, - "end": 2289, - "ctxt": 0 - }, - "value": "contentMatches", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2280, - "end": 2289, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2282, - "end": 2289, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2236, - "end": 2516, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2291, - "end": 2516, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2297, - "end": 2349, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2303, - "end": 2348, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2303, - "end": 2309, - "ctxt": 0 - }, - "value": "action", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2310, - "end": 2318, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2312, - "end": 2318, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2312, - "end": 2318, - "ctxt": 0 - }, - "value": "Action", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2321, - "end": 2348, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 2321, - "end": 2327, - "ctxt": 0 - }, - "value": "verify", - "optional": false - }, - "consequent": { - "type": "TemplateLiteral", - "span": { - "start": 2330, - "end": 2338, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2331, - "end": 2337, - "ctxt": 0 - }, - "tail": true, - "cooked": "verify", - "raw": "verify" - } - ] - }, - "alternate": { - "type": "TemplateLiteral", - "span": { - "start": 2341, - "end": 2348, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2342, - "end": 2347, - "ctxt": 0 - }, - "tail": true, - "cooked": "write", - "raw": "write" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2354, - "end": 2427, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2360, - "end": 2426, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2360, - "end": 2372, - "ctxt": 0 - }, - "value": "contentMatch", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2372, - "end": 2386, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2374, - "end": 2386, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2374, - "end": 2386, - "ctxt": 0 - }, - "value": "ContentMatch", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2389, - "end": 2426, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 2389, - "end": 2403, - "ctxt": 0 - }, - "value": "contentMatches", - "optional": false - }, - "consequent": { - "type": "TemplateLiteral", - "span": { - "start": 2406, - "end": 2413, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2407, - "end": 2412, - "ctxt": 0 - }, - "tail": true, - "cooked": "match", - "raw": "match" - } - ] - }, - "alternate": { - "type": "TemplateLiteral", - "span": { - "start": 2416, - "end": 2426, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2417, - "end": 2425, - "ctxt": 0 - }, - "tail": true, - "cooked": "nonMatch", - "raw": "nonMatch" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2432, - "end": 2494, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2438, - "end": 2493, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2438, - "end": 2445, - "ctxt": 0 - }, - "value": "outcome", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2445, - "end": 2454, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2447, - "end": 2454, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2447, - "end": 2454, - "ctxt": 0 - }, - "value": "Outcome", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 2457, - "end": 2493, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2457, - "end": 2484, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2460, - "end": 2466, - "ctxt": 0 - }, - "value": "action", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 2470, - "end": 2482, - "ctxt": 0 - }, - "value": "contentMatch", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2458, - "end": 2458, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2467, - "end": 2468, - "ctxt": 0 - }, - "tail": false, - "cooked": "_", - "raw": "_" - }, - { - "type": "TemplateElement", - "span": { - "start": 2483, - "end": 2483, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 2499, - "end": 2514, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 2506, - "end": 2513, - "ctxt": 0 - }, - "value": "outcome", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2527, - "end": 2530, - "ctxt": 0 - }, - "value": "ff5", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2531, - "end": 2546, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2531, - "end": 2546, - "ctxt": 0 - }, - "value": "verify", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2537, - "end": 2546, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2539, - "end": 2546, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2548, - "end": 2571, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2548, - "end": 2571, - "ctxt": 0 - }, - "value": "contentMatches", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2562, - "end": 2571, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2564, - "end": 2571, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2518, - "end": 2766, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2573, - "end": 2766, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2579, - "end": 2622, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2585, - "end": 2621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2585, - "end": 2591, - "ctxt": 0 - }, - "value": "action", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2594, - "end": 2621, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 2594, - "end": 2600, - "ctxt": 0 - }, - "value": "verify", - "optional": false - }, - "consequent": { - "type": "TemplateLiteral", - "span": { - "start": 2603, - "end": 2611, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2604, - "end": 2610, - "ctxt": 0 - }, - "tail": true, - "cooked": "verify", - "raw": "verify" - } - ] - }, - "alternate": { - "type": "TemplateLiteral", - "span": { - "start": 2614, - "end": 2621, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2615, - "end": 2620, - "ctxt": 0 - }, - "tail": true, - "cooked": "write", - "raw": "write" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2627, - "end": 2686, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2633, - "end": 2685, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2633, - "end": 2645, - "ctxt": 0 - }, - "value": "contentMatch", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ConditionalExpression", - "span": { - "start": 2648, - "end": 2685, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 2648, - "end": 2662, - "ctxt": 0 - }, - "value": "contentMatches", - "optional": false - }, - "consequent": { - "type": "TemplateLiteral", - "span": { - "start": 2665, - "end": 2672, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2666, - "end": 2671, - "ctxt": 0 - }, - "tail": true, - "cooked": "match", - "raw": "match" - } - ] - }, - "alternate": { - "type": "TemplateLiteral", - "span": { - "start": 2675, - "end": 2685, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2676, - "end": 2684, - "ctxt": 0 - }, - "tail": true, - "cooked": "nonMatch", - "raw": "nonMatch" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2691, - "end": 2744, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2697, - "end": 2743, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2697, - "end": 2704, - "ctxt": 0 - }, - "value": "outcome", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 2707, - "end": 2743, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2707, - "end": 2734, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2710, - "end": 2716, - "ctxt": 0 - }, - "value": "action", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 2720, - "end": 2732, - "ctxt": 0 - }, - "value": "contentMatch", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2708, - "end": 2708, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2717, - "end": 2718, - "ctxt": 0 - }, - "tail": false, - "cooked": "_", - "raw": "_" - }, - { - "type": "TemplateElement", - "span": { - "start": 2733, - "end": 2733, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 2749, - "end": 2764, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 2756, - "end": 2763, - "ctxt": 0 - }, - "value": "outcome", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2777, - "end": 2790, - "ctxt": 0 - }, - "value": "accessorNames", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2809, - "end": 2820, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2809, - "end": 2820, - "ctxt": 0 - }, - "value": "propName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2817, - "end": 2820, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2819, - "end": 2820, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2819, - "end": 2820, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2768, - "end": 2885, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2822, - "end": 2885, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2828, - "end": 2883, - "ctxt": 0 - }, - "argument": { - "type": "TsConstAssertion", - "span": { - "start": 2835, - "end": 2882, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 2835, - "end": 2873, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2836, - "end": 2853, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2843, - "end": 2851, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2837, - "end": 2841, - "ctxt": 0 - }, - "tail": false, - "cooked": "get-", - "raw": "get-" - }, - { - "type": "TemplateElement", - "span": { - "start": 2852, - "end": 2852, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2855, - "end": 2872, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2862, - "end": 2870, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2856, - "end": 2860, - "ctxt": 0 - }, - "tail": false, - "cooked": "set-", - "raw": "set-" - }, - { - "type": "TemplateElement", - "span": { - "start": 2871, - "end": 2871, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2790, - "end": 2808, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2791, - "end": 2807, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2791, - "end": 2792, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 2801, - "end": 2807, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2887, - "end": 2920, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2893, - "end": 2919, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2893, - "end": 2896, - "ctxt": 0 - }, - "value": "ns1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 2899, - "end": 2919, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2899, - "end": 2912, - "ctxt": 0 - }, - "value": "accessorNames", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 2913, - "end": 2918, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/constAssertions.ts b/crates/swc_ecma_parser/tests/tsc/constAssertions.ts deleted file mode 100644 index 909330a839d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/constAssertions.ts +++ /dev/null @@ -1,112 +0,0 @@ -// @strict: true -// @declaration: true -// @target: esnext - -let v1 = 'abc' as const; -let v2 = `abc` as const; -let v3 = 10 as const; -let v4 = -10 as const; -let v5 = +10 as const; -let v6 = 10n as const; -let v7 = -10n as const; -let v8 = true as const; -let v9 = false as const; - -let c1 = 'abc' as const; -let c2 = `abc` as const; -let c3 = 10 as const; -let c4 = -10 as const; -let c5 = +10 as const; -let c6 = 10n as const; -let c7 = -10n as const; -let c8 = true as const; -let c9 = false as const; - -let vv1 = v1; -let vc1 = c1; - -let a1 = [] as const; -let a2 = [1, 2, 3] as const; -let a3 = [10, 'hello', true] as const; -let a4 = [...[1, 2, 3]] as const; -let a5 = [1, 2, 3]; -let a6 = [...a5] as const; -let a7 = [...a6]; -let a8 = ['abc', ...a7] as const; -let a9 = [...a8]; - -declare let d: { [x: string]: string }; - -let o1 = { x: 10, y: 20 } as const; -let o2 = { a: 1, 'b': 2, ['c']: 3, d() {}, ['e' + '']: 4 } as const; -let o3 = { ...o1, ...o2 } as const; -let o4 = { a: 1, b: 2 }; -let o5 = { ...o4 } as const; -let o6 = { ...o5 }; -let o7 = { ...d } as const; -let o8 = { ...o7 }; -let o9 = { x: 10, foo() { this.x = 20 } } as const; // Error - -let p1 = (10) as const; -let p2 = ((-10)) as const; -let p3 = ([(10)]) as const; -let p4 = [[[[10]]]] as const; - -let x1 = { x: 10, y: [20, 30], z: { a: { b: 42 } } } as const; - -let q1 = 10; -let q2 = 'abc'; -let q3 = true; -let q4 = [1, 2, 3]; -let q5 = { x: 10, y: 20 }; - -declare function id(x: T): T; - -let e1 = v1 as const; // Error -let e2 = (true ? 1 : 0) as const; // Error -let e3 = id(1) as const; // Error - -let t1 = 'foo' as const; -let t2 = 'bar' as const; -let t3 = `${t1}-${t2}` as const; -let t4 = `${`(${t1})`}-${`(${t2})`}` as const; - -function ff1(x: 'foo' | 'bar', y: 1 | 2) { - return `${x}-${y}` as const; -} - -function ff2(x: T, y: U) { - return `${x}-${y}` as const; -} - -const ts1 = ff2('foo', 'bar'); -const ts2 = ff2('foo', !!true ? '0' : '1'); -const ts3 = ff2(!!true ? 'top' : 'bottom', !!true ? 'left' : 'right'); - -function ff3(x: 'foo' | 'bar', y: object) { - return `${x}${y}` as const; -} - -type Action = "verify" | "write"; -type ContentMatch = "match" | "nonMatch"; -type Outcome = `${Action}_${ContentMatch}`; - -function ff4(verify: boolean, contentMatches: boolean) { - const action : Action = verify ? `verify` : `write`; - const contentMatch: ContentMatch = contentMatches ? `match` : `nonMatch`; - const outcome: Outcome = `${action}_${contentMatch}` as const; - return outcome; -} - -function ff5(verify: boolean, contentMatches: boolean) { - const action = verify ? `verify` : `write`; - const contentMatch = contentMatches ? `match` : `nonMatch`; - const outcome = `${action}_${contentMatch}` as const; - return outcome; -} - -function accessorNames(propName: S) { - return [`get-${propName}`, `set-${propName}`] as const; -} - -const ns1 = accessorNames('foo'); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/constEnum1.ts b/crates/swc_ecma_parser/tests/tsc/constEnum1.ts index 69711485046..de1e06c5382 100644 --- a/crates/swc_ecma_parser/tests/tsc/constEnum1.ts +++ b/crates/swc_ecma_parser/tests/tsc/constEnum1.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true // An enum declaration that specifies a const modifier is a constant enum declaration. // In a constant enum declaration, all members must have constant values and diff --git a/crates/swc_ecma_parser/tests/tsc/constEnum2.json b/crates/swc_ecma_parser/tests/tsc/constEnum2.json new file mode 100644 index 00000000000..a3586175087 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/constEnum2.json @@ -0,0 +1,449 @@ +{ + "type": "Script", + "span": { + "start": 353, + "end": 519, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 353, + "end": 376, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 359, + "end": 375, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 359, + "end": 364, + "ctxt": 0 + }, + "value": "CONST", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "BinaryExpression", + "span": { + "start": 367, + "end": 375, + "ctxt": 0 + }, + "operator": "%", + "left": { + "type": "NumericLiteral", + "span": { + "start": 367, + "end": 371, + "ctxt": 0 + }, + "value": 9000.0, + "raw": "9000" + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 374, + "end": 375, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "definite": false + } + ] + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 377, + "end": 519, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 388, + "end": 389, + "ctxt": 0 + }, + "value": "D", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 396, + "end": 402, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 396, + "end": 397, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 400, + "end": 402, + "ctxt": 0 + }, + "value": 10.0, + "raw": "10" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 408, + "end": 450, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 408, + "end": 409, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "init": { + "type": "BinaryExpression", + "span": { + "start": 412, + "end": 450, + "ctxt": 0 + }, + "operator": "*", + "left": { + "type": "NumericLiteral", + "span": { + "start": 412, + "end": 415, + "ctxt": 0 + }, + "value": 199.0, + "raw": "199" + }, + "right": { + "type": "CallExpression", + "span": { + "start": 418, + "end": 450, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 418, + "end": 428, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 418, + "end": 422, + "ctxt": 0 + }, + "value": "Math", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 423, + "end": 428, + "ctxt": 0 + }, + "value": "floor", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 429, + "end": 449, + "ctxt": 0 + }, + "operator": "*", + "left": { + "type": "CallExpression", + "span": { + "start": 429, + "end": 442, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 429, + "end": 440, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 429, + "end": 433, + "ctxt": 0 + }, + "value": "Math", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 434, + "end": 440, + "ctxt": 0 + }, + "value": "random", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 445, + "end": 449, + "ctxt": 0 + }, + "value": 1000.0, + "raw": "1000" + } + } + } + ], + "typeArguments": null + } + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 456, + "end": 501, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 456, + "end": 457, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "init": { + "type": "BinaryExpression", + "span": { + "start": 460, + "end": 501, + "ctxt": 0 + }, + "operator": "-", + "left": { + "type": "Identifier", + "span": { + "start": 460, + "end": 461, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "right": { + "type": "ParenthesisExpression", + "span": { + "start": 464, + "end": 501, + "ctxt": 0 + }, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 465, + "end": 500, + "ctxt": 0 + }, + "operator": "*", + "left": { + "type": "NumericLiteral", + "span": { + "start": 465, + "end": 468, + "ctxt": 0 + }, + "value": 100.0, + "raw": "100" + }, + "right": { + "type": "CallExpression", + "span": { + "start": 471, + "end": 500, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 471, + "end": 481, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 471, + "end": 475, + "ctxt": 0 + }, + "value": "Math", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 476, + "end": 481, + "ctxt": 0 + }, + "value": "floor", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 482, + "end": 499, + "ctxt": 0 + }, + "operator": "%", + "left": { + "type": "CallExpression", + "span": { + "start": 482, + "end": 495, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 482, + "end": 493, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 482, + "end": 486, + "ctxt": 0 + }, + "value": "Math", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 487, + "end": 493, + "ctxt": 0 + }, + "value": "random", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 498, + "end": 499, + "ctxt": 0 + }, + "value": 8.0, + "raw": "8" + } + } + } + ], + "typeArguments": null + } + } + } + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 507, + "end": 516, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 507, + "end": 508, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "init": { + "type": "Identifier", + "span": { + "start": 511, + "end": 516, + "ctxt": 0 + }, + "value": "CONST", + "optional": false + } + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/constEnum2.ts b/crates/swc_ecma_parser/tests/tsc/constEnum2.ts new file mode 100644 index 00000000000..fb701a53de9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/constEnum2.ts @@ -0,0 +1,15 @@ +// @declaration: true + +// An enum declaration that specifies a const modifier is a constant enum declaration. +// In a constant enum declaration, all members must have constant values and +// it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. + +// Error : not a constant enum expression + +const CONST = 9000 % 2; +const enum D { + d = 10, + e = 199 * Math.floor(Math.random() * 1000), + f = d - (100 * Math.floor(Math.random() % 8)), + g = CONST, +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess1.ts b/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess1.ts index 37275d517c5..250630d77d8 100644 --- a/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess1.ts +++ b/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess1.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true // @target: es6 // constant enum declarations are completely erased in the emitted JavaScript code. diff --git a/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess2.ts b/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess2.ts index 706c5ad4562..0baeb61b3b5 100644 --- a/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess2.ts +++ b/crates/swc_ecma_parser/tests/tsc/constEnumPropertyAccess2.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true // constant enum declarations are completely erased in the emitted JavaScript code. // it is an error to reference a constant enum object in any other context diff --git a/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.json b/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.json new file mode 100644 index 00000000000..0d94f0f36e6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.json @@ -0,0 +1,674 @@ +{ + "type": "Script", + "span": { + "start": 159, + "end": 619, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 168, + "end": 171, + "ctxt": 0 + }, + "value": "Cls", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 172, + "end": 173, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 172, + "end": 173, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 159, + "end": 194, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 175, + "end": 194, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 181, + "end": 192, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 181, + "end": 191, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 181, + "end": 187, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 181, + "end": 185, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 186, + "end": 187, + "ctxt": 0 + }, + "value": "t", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 190, + "end": 191, + "ctxt": 0 + }, + "value": "t", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 275, + "end": 340, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 275, + "end": 339, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 275, + "end": 304, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 275, + "end": 288, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 275, + "end": 278, + "ctxt": 0 + }, + "value": "Cls", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 279, + "end": 288, + "ctxt": 0 + }, + "value": "prototype", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 289, + "end": 304, + "ctxt": 0 + }, + "value": "topLevelComment", + "optional": false + } + }, + "right": { + "type": "FunctionExpression", + "identifier": null, + "params": [ + { + "type": "Parameter", + "span": { + "start": 317, + "end": 318, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 317, + "end": 318, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 320, + "end": 321, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 320, + "end": 321, + "ctxt": 0 + }, + "value": "v", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 307, + "end": 339, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 323, + "end": 339, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 329, + "end": 337, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 336, + "end": 337, + "ctxt": 0 + }, + "value": "v", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 342, + "end": 520, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 342, + "end": 519, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 342, + "end": 369, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 342, + "end": 355, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 342, + "end": 345, + "ctxt": 0 + }, + "value": "Cls", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 346, + "end": 355, + "ctxt": 0 + }, + "value": "prototype", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 356, + "end": 369, + "ctxt": 0 + }, + "value": "nestedComment", + "optional": false + } + }, + "right": { + "type": "FunctionExpression", + "identifier": null, + "params": [ + { + "type": "Parameter", + "span": { + "start": 489, + "end": 490, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 489, + "end": 490, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 492, + "end": 493, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 492, + "end": 493, + "ctxt": 0 + }, + "value": "u", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 479, + "end": 519, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 495, + "end": 519, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 505, + "end": 513, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 512, + "end": 513, + "ctxt": 0 + }, + "value": "t", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 522, + "end": 543, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 526, + "end": 542, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 526, + "end": 527, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 530, + "end": 542, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 534, + "end": 537, + "ctxt": 0 + }, + "value": "Cls", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 538, + "end": 541, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 544, + "end": 582, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 550, + "end": 581, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 550, + "end": 551, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 554, + "end": 581, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 554, + "end": 571, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 554, + "end": 555, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 556, + "end": 571, + "ctxt": 0 + }, + "value": "topLevelComment", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 572, + "end": 575, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 577, + "end": 580, + "ctxt": 0 + }, + "value": "b", + "raw": "'b'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 583, + "end": 619, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 589, + "end": 618, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 589, + "end": 590, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 593, + "end": 618, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 593, + "end": 608, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 593, + "end": 594, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 595, + "end": 608, + "ctxt": 0 + }, + "value": "nestedComment", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 609, + "end": 612, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 614, + "end": 617, + "ctxt": 0 + }, + "value": "b", + "raw": "'b'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.ts b/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.ts new file mode 100644 index 00000000000..bbe6810a150 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/constructorFunctionMethodTypeParameters.ts @@ -0,0 +1,37 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @filename: constructorFunctionMethodTypeParameters.js +/** + * @template {string} T + * @param {T} t + */ +function Cls(t) { + this.t = t; +} + +/** + * @template {string} V + * @param {T} t + * @param {V} v + * @return {V} + */ +Cls.prototype.topLevelComment = function (t, v) { + return v +}; + +Cls.prototype.nestedComment = + /** + * @template {string} U + * @param {T} t + * @param {U} u + * @return {T} + */ + function (t, u) { + return t + }; + +var c = new Cls('a'); +const s = c.topLevelComment('a', 'b'); +const t = c.nestedComment('a', 'b'); + diff --git a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithTuple.ts b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithTuple.ts index 95b7f7f117f..9600ebcd671 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithTuple.ts +++ b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithTuple.ts @@ -1,4 +1,4 @@ -// no error +// no error var numStrTuple: [number, string] = [5, "hello"]; var numStrTuple2: [number, string] = [5, "foo", true]; var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; diff --git a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeCallSignatures.ts b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeCallSignatures.ts index 8f9e8b50980..309c012c35d 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeCallSignatures.ts +++ b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeCallSignatures.ts @@ -1,4 +1,4 @@ -//When used as a contextual type, a union type U has those members that are present in any of +//When used as a contextual type, a union type U has those members that are present in any of // its constituent types, with types that are unions of the respective members in the constituent types. // Let S be the set of types in U that have call signatures. diff --git a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeIndexSignatures.ts b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeIndexSignatures.ts index 26d16bd1293..4e41508b3ef 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeIndexSignatures.ts +++ b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeIndexSignatures.ts @@ -1,4 +1,4 @@ -//When used as a contextual type, a union type U has those members that are present in any of +//When used as a contextual type, a union type U has those members that are present in any of // its constituent types, with types that are unions of the respective members in the constituent types. interface SomeType { (a: number): number; diff --git a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeMembers.ts b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeMembers.ts index b8f105e72e5..26e91762e1c 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeMembers.ts +++ b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeMembers.ts @@ -1,4 +1,4 @@ -//When used as a contextual type, a union type U has those members that are present in any of +//When used as a contextual type, a union type U has those members that are present in any of // its constituent types, with types that are unions of the respective members in the constituent types. interface I1 { commonMethodType(a: string): string; diff --git a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeObjectLiteral.ts b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeObjectLiteral.ts index 719c4595a8a..a7849aa20ea 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeObjectLiteral.ts +++ b/crates/swc_ecma_parser/tests/tsc/contextualTypeWithUnionTypeObjectLiteral.ts @@ -1,4 +1,4 @@ -var str: string; +var str: string; var num: number; var strOrNumber: string | number = str || num; var objStr: { prop: string }; diff --git a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.json b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.json deleted file mode 100644 index c839b94a613..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.json +++ /dev/null @@ -1,744 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 41, - "end": 378, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 41, - "end": 179, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 179, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 61, - "end": 121, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 68, - "end": 121, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 78, - "end": 95, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 96, - "end": 121, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 106, - "end": 115, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 106, - "end": 110, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 110, - "end": 114, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 112, - "end": 114, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 126, - "end": 177, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 133, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 143, - "end": 150, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 151, - "end": 177, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 155, - "end": 171, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 155, - "end": 164, - "ctxt": 0 - }, - "value": "something", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 181, - "end": 264, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 187, - "end": 263, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 187, - "end": 199, - "ctxt": 0 - }, - "value": "FooComponent", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 202, - "end": 263, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 203, - "end": 234, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 210, - "end": 234, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 212, - "end": 232, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 215, - "end": 232, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 217, - "end": 232, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 217, - "end": 220, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 217, - "end": 220, - "ctxt": 0 - }, - "value": "A", - "raw": "\"A\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "value": "B", - "raw": "\"B\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 229, - "end": 232, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 229, - "end": 232, - "ctxt": 0 - }, - "value": "C", - "raw": "\"C\"" - } - } - ] - } - }, - "typeParams": null - } - ] - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 239, - "end": 263, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 240, - "end": 244, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 245, - "end": 256, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 246, - "end": 255, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 246, - "end": 251, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 252, - "end": 255, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 256, - "end": 263, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 258, - "end": 262, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 266, - "end": 293, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 266, - "end": 292, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 279, - "ctxt": 0 - }, - "value": "FooComponent", - "optional": false - }, - "span": { - "start": 266, - "end": 292, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 280, - "end": 289, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "value": "A", - "raw": "\"A\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 294, - "end": 321, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 294, - "end": 320, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 307, - "ctxt": 0 - }, - "value": "FooComponent", - "optional": false - }, - "span": { - "start": 294, - "end": 320, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 308, - "end": 315, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "value": "A", - "raw": "\"A\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 323, - "end": 350, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 323, - "end": 349, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 336, - "ctxt": 0 - }, - "value": "FooComponent", - "optional": false - }, - "span": { - "start": 323, - "end": 349, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 337, - "end": 346, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 337, - "end": 340, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 342, - "end": 345, - "ctxt": 0 - }, - "value": "f", - "raw": "\"f\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 351, - "end": 378, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 351, - "end": 377, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 352, - "end": 364, - "ctxt": 0 - }, - "value": "FooComponent", - "optional": false - }, - "span": { - "start": 351, - "end": 377, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 365, - "end": 372, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "value": "f", - "raw": "\"f\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.tsx b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.tsx index ed2fc285c30..6a613e6ca22 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.tsx +++ b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes01.tsx @@ -1,4 +1,4 @@ -// @jsx: preserve +// @jsx: preserve // @declaration: true namespace JSX { diff --git a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.json b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.json deleted file mode 100644 index 38956b4fc8a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.json +++ /dev/null @@ -1,2396 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 1490, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 164, - "end": 246, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 171, - "end": 246, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 195, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 196, - "end": 246, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 202, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 225, - "end": 244, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 237, - "end": 243, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 248, - "end": 347, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 255, - "end": 347, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 276, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 300, - "end": 347, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 306, - "end": 345, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 306, - "end": 313, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 315, - "end": 344, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 316, - "end": 335, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 317, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 319, - "end": 335, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 319, - "end": 325, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 319, - "end": 325, - "ctxt": 0 - }, - "value": "left", - "raw": "\"left\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 328, - "end": 335, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 328, - "end": 335, - "ctxt": 0 - }, - "value": "right", - "raw": "\"right\"" - } - } - ] - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 337, - "end": 344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 340, - "end": 344, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 349, - "end": 432, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 356, - "end": 432, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 366, - "end": 375, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 384, - "end": 398, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 384, - "end": 398, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 399, - "end": 432, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 405, - "end": 430, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 405, - "end": 409, - "ctxt": 0 - }, - "value": "goTo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 409, - "end": 429, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 411, - "end": 429, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 411, - "end": 417, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 411, - "end": 417, - "ctxt": 0 - }, - "value": "home", - "raw": "\"home\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 420, - "end": 429, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 420, - "end": 429, - "ctxt": 0 - }, - "value": "contact", - "raw": "\"contact\"" - } - } - ] - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 434, - "end": 500, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 450, - "end": 460, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 461, - "end": 485, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 461, - "end": 485, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 472, - "end": 485, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 474, - "end": 485, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 474, - "end": 485, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 441, - "end": 500, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 486, - "end": 499, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 488, - "end": 499, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 488, - "end": 491, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 492, - "end": 499, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 501, - "end": 563, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 517, - "end": 527, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 528, - "end": 548, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 528, - "end": 548, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 537, - "end": 548, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 539, - "end": 548, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 539, - "end": 548, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 508, - "end": 563, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 549, - "end": 562, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 551, - "end": 562, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 551, - "end": 554, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 555, - "end": 562, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 564, - "end": 797, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 580, - "end": 590, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 591, - "end": 621, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 591, - "end": 621, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 596, - "end": 621, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 598, - "end": 621, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 598, - "end": 609, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 598, - "end": 609, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 612, - "end": 621, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 612, - "end": 621, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 571, - "end": 797, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 636, - "end": 797, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 642, - "end": 679, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 648, - "end": 678, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 648, - "end": 657, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsAsExpression", - "span": { - "start": 660, - "end": 678, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 660, - "end": 665, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 669, - "end": 678, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 669, - "end": 678, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 684, - "end": 753, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 687, - "end": 701, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 687, - "end": 696, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 697, - "end": 701, - "ctxt": 0 - }, - "value": "goTo", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 703, - "end": 753, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 713, - "end": 747, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 720, - "end": 746, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 720, - "end": 739, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 720, - "end": 724, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 725, - "end": 739, - "ctxt": 0 - }, - "value": "_buildMainLink", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 740, - "end": 745, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "alternate": null - }, - { - "type": "ReturnStatement", - "span": { - "start": 759, - "end": 795, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 766, - "end": 794, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 766, - "end": 787, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 766, - "end": 770, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 771, - "end": 787, - "ctxt": 0 - }, - "value": "_buildMainButton", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 788, - "end": 793, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 622, - "end": 635, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 624, - "end": 635, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 624, - "end": 627, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 628, - "end": 635, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 799, - "end": 871, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 805, - "end": 870, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 805, - "end": 807, - "ctxt": 0 - }, - "value": "b0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 810, - "end": 870, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 811, - "end": 821, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 810, - "end": 870, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 823, - "end": 826, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 826, - "end": 860, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 827, - "end": 834, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 836, - "end": 859, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 837, - "end": 838, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 843, - "end": 859, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 844, - "end": 858, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 844, - "end": 858, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 844, - "end": 855, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 844, - "end": 851, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 852, - "end": 855, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 856, - "end": 857, - "ctxt": 0 - }, - "value": "k", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 862, - "end": 867, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 862, - "end": 867, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 904, - "end": 968, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 910, - "end": 967, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 910, - "end": 912, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 915, - "end": 967, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 916, - "end": 926, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 915, - "end": 967, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 927, - "end": 958, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 927, - "end": 934, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 935, - "end": 958, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 936, - "end": 957, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 941, - "end": 957, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 942, - "end": 956, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 942, - "end": 956, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 942, - "end": 953, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 942, - "end": 949, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 950, - "end": 953, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 954, - "end": 955, - "ctxt": 0 - }, - "value": "k", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 959, - "end": 964, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 959, - "end": 964, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1001, - "end": 1052, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1007, - "end": 1051, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1007, - "end": 1009, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1012, - "end": 1051, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1013, - "end": 1023, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1012, - "end": 1051, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1025, - "end": 1028, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1028, - "end": 1041, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1029, - "end": 1033, - "ctxt": 0 - }, - "value": "goTo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1034, - "end": 1040, - "ctxt": 0 - }, - "value": "home", - "raw": "\"home\"" - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1043, - "end": 1048, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1043, - "end": 1048, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1089, - "end": 1133, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1095, - "end": 1132, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1095, - "end": 1097, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1100, - "end": 1132, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1101, - "end": 1111, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1100, - "end": 1132, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1112, - "end": 1123, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1112, - "end": 1116, - "ctxt": 0 - }, - "value": "goTo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1117, - "end": 1123, - "ctxt": 0 - }, - "value": "home", - "raw": "\"home\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1124, - "end": 1129, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1124, - "end": 1129, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1172, - "end": 1258, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1188, - "end": 1198, - "ctxt": 0 - }, - "value": "NoOverload", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1199, - "end": 1223, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1199, - "end": 1223, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1210, - "end": 1223, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1212, - "end": 1223, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1212, - "end": 1223, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1179, - "end": 1258, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1238, - "end": 1258, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1240, - "end": 1256, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1247, - "end": 1256, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1224, - "end": 1237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1226, - "end": 1237, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1229, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1230, - "end": 1237, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1259, - "end": 1332, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1265, - "end": 1331, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1265, - "end": 1267, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1270, - "end": 1331, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1271, - "end": 1281, - "ctxt": 0 - }, - "value": "NoOverload", - "optional": false - }, - "span": { - "start": 1270, - "end": 1331, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1284, - "end": 1287, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1287, - "end": 1321, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1288, - "end": 1295, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1297, - "end": 1320, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1298, - "end": 1299, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1304, - "end": 1320, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1305, - "end": 1319, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1305, - "end": 1319, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1305, - "end": 1316, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1305, - "end": 1312, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1313, - "end": 1316, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1317, - "end": 1318, - "ctxt": 0 - }, - "value": "k", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1323, - "end": 1328, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1323, - "end": 1328, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1353, - "end": 1436, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1369, - "end": 1380, - "ctxt": 0 - }, - "value": "NoOverload1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1381, - "end": 1401, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1381, - "end": 1401, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1390, - "end": 1401, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1392, - "end": 1401, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1392, - "end": 1401, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1360, - "end": 1436, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1416, - "end": 1436, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1418, - "end": 1434, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 1425, - "end": 1434, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1402, - "end": 1415, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1404, - "end": 1415, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1404, - "end": 1407, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1408, - "end": 1415, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1437, - "end": 1490, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1443, - "end": 1489, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1443, - "end": 1445, - "ctxt": 0 - }, - "value": "d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1448, - "end": 1489, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1449, - "end": 1460, - "ctxt": 0 - }, - "value": "NoOverload1", - "optional": false - }, - "span": { - "start": 1448, - "end": 1489, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1462, - "end": 1465, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1465, - "end": 1478, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1466, - "end": 1470, - "ctxt": 0 - }, - "value": "goTo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1471, - "end": 1477, - "ctxt": 0 - }, - "value": "home", - "raw": "\"home\"" - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1480, - "end": 1485, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1480, - "end": 1485, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.tsx b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.tsx index 4fce1cf949d..a30e55ec699 100644 --- a/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.tsx +++ b/crates/swc_ecma_parser/tests/tsc/contextuallyTypedStringLiteralsInJsxAttributes02.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: preserve // @module: amd // @noLib: true diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.json b/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.json new file mode 100644 index 00000000000..7a0b5748c91 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.json @@ -0,0 +1,2974 @@ +{ + "type": "Script", + "span": { + "start": 60, + "end": 1885, + "ctxt": 0 + }, + "body": [ + { + "type": "BlockStatement", + "span": { + "start": 60, + "end": 283, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 66, + "end": 99, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 72, + "end": 98, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 72, + "end": 76, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 80, + "end": 98, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 82, + "end": 87, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 89, + "end": 96, + "ctxt": 0 + }, + "value": "value", + "raw": "'value'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 105, + "end": 197, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 111, + "end": 196, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 111, + "end": 189, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 121, + "end": 182, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 121, + "end": 126, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "CallExpression", + "span": { + "start": 129, + "end": 182, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 129, + "end": 180, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 130, + "end": 179, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 136, + "end": 179, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 138, + "end": 177, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 144, + "end": 177, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 148, + "end": 153, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 154, + "end": 176, + "ctxt": 0 + }, + "value": "param is not defined", + "raw": "'param is not defined'" + } + } + ], + "typeArguments": null + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 192, + "end": 196, + "ctxt": 0 + }, + "value": "data", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 207, + "end": 226, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 207, + "end": 225, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 207, + "end": 218, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 207, + "end": 214, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 215, + "end": 218, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 219, + "end": 224, + "ctxt": 0 + }, + "value": "param", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 286, + "end": 500, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 292, + "end": 325, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 298, + "end": 324, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 298, + "end": 302, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 306, + "end": 324, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 308, + "end": 313, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 315, + "end": 322, + "ctxt": 0 + }, + "value": "value", + "raw": "'value'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 331, + "end": 364, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 335, + "end": 363, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 335, + "end": 338, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 338, + "end": 358, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 340, + "end": 358, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 340, + "end": 346, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 349, + "end": 358, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 361, + "end": 363, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 369, + "end": 461, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 375, + "end": 460, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 375, + "end": 453, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 385, + "end": 446, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 385, + "end": 390, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "CallExpression", + "span": { + "start": 393, + "end": 446, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 393, + "end": 444, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 394, + "end": 443, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 400, + "end": 443, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 402, + "end": 441, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 408, + "end": 441, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 412, + "end": 417, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 418, + "end": 440, + "ctxt": 0 + }, + "value": "param is not defined", + "raw": "'param is not defined'" + } + } + ], + "typeArguments": null + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 456, + "end": 460, + "ctxt": 0 + }, + "value": "data", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 471, + "end": 475, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 471, + "end": 474, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 502, + "end": 702, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 508, + "end": 541, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 514, + "end": 540, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 514, + "end": 518, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 522, + "end": 540, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 524, + "end": 529, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 531, + "end": 538, + "ctxt": 0 + }, + "value": "value", + "raw": "'value'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 547, + "end": 580, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 551, + "end": 579, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 551, + "end": 554, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 554, + "end": 574, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 556, + "end": 574, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 556, + "end": 562, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 565, + "end": 574, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 577, + "end": 579, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 585, + "end": 653, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 591, + "end": 652, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 591, + "end": 645, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 601, + "end": 638, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 601, + "end": 606, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "CallExpression", + "span": { + "start": 609, + "end": 638, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 609, + "end": 636, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 610, + "end": 635, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 616, + "end": 635, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 618, + "end": 633, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 618, + "end": 633, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 618, + "end": 621, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 624, + "end": 633, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 648, + "end": 652, + "ctxt": 0 + }, + "value": "data", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 663, + "end": 667, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 663, + "end": 666, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 704, + "end": 890, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 710, + "end": 743, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 716, + "end": 742, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 716, + "end": 720, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 724, + "end": 742, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 726, + "end": 731, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 733, + "end": 740, + "ctxt": 0 + }, + "value": "value", + "raw": "'value'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 749, + "end": 782, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 753, + "end": 781, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 753, + "end": 756, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 756, + "end": 776, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 758, + "end": 776, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 758, + "end": 764, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 767, + "end": 776, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 779, + "end": 781, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 787, + "end": 853, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 793, + "end": 852, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 793, + "end": 845, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 803, + "end": 838, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 803, + "end": 808, + "ctxt": 0 + }, + "value": "param", + "optional": false + }, + "value": { + "type": "CallExpression", + "span": { + "start": 811, + "end": 838, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 811, + "end": 836, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 812, + "end": 835, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 818, + "end": 835, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 820, + "end": 833, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 827, + "end": 833, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "StringLiteral", + "span": { + "start": 827, + "end": 829, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 832, + "end": 833, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 848, + "end": 852, + "ctxt": 0 + }, + "value": "data", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 863, + "end": 867, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 863, + "end": 866, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 892, + "end": 1207, + "ctxt": 0 + }, + "stmts": [ + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 898, + "end": 946, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 908, + "end": 914, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 915, + "end": 946, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 925, + "end": 940, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 925, + "end": 931, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 931, + "end": 939, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 933, + "end": 939, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 933, + "end": 939, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 952, + "end": 980, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 956, + "end": 979, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 956, + "end": 959, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 959, + "end": 979, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 961, + "end": 979, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 961, + "end": 967, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 970, + "end": 979, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 985, + "end": 1011, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 989, + "end": 1010, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 989, + "end": 995, + "ctxt": 0 + }, + "value": "window", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 998, + "end": 1010, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 998, + "end": 1000, + "ctxt": 0 + }, + "properties": [] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1004, + "end": 1010, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1004, + "end": 1010, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1016, + "end": 1039, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1016, + "end": 1038, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 1016, + "end": 1029, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1016, + "end": 1022, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1023, + "end": 1029, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 1032, + "end": 1038, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1045, + "end": 1174, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1051, + "end": 1173, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1051, + "end": 1164, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1053, + "end": 1103, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1054, + "end": 1102, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1054, + "end": 1100, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1055, + "end": 1099, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1061, + "end": 1099, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1063, + "end": 1072, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1063, + "end": 1071, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1063, + "end": 1066, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1069, + "end": 1071, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 1073, + "end": 1097, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1080, + "end": 1097, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1080, + "end": 1088, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "ObjectPattern", + "span": { + "start": 1113, + "end": 1162, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1115, + "end": 1155, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1116, + "end": 1154, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1116, + "end": 1152, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1117, + "end": 1151, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1123, + "end": 1151, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1125, + "end": 1149, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1132, + "end": 1149, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1132, + "end": 1140, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 1157, + "end": 1160, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1167, + "end": 1173, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1180, + "end": 1184, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1180, + "end": 1183, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 1209, + "end": 1525, + "ctxt": 0 + }, + "stmts": [ + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 1215, + "end": 1263, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1225, + "end": 1231, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 1232, + "end": 1263, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1242, + "end": 1257, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1242, + "end": 1248, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1248, + "end": 1256, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1250, + "end": 1256, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1250, + "end": 1256, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1269, + "end": 1297, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1273, + "end": 1296, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1273, + "end": 1276, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1276, + "end": 1296, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1278, + "end": 1296, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1278, + "end": 1284, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1287, + "end": 1296, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1302, + "end": 1328, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1306, + "end": 1327, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1306, + "end": 1312, + "ctxt": 0 + }, + "value": "window", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 1315, + "end": 1327, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1315, + "end": 1317, + "ctxt": 0 + }, + "properties": [] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1321, + "end": 1327, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1321, + "end": 1327, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1333, + "end": 1356, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1333, + "end": 1355, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 1333, + "end": 1346, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1333, + "end": 1339, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1340, + "end": 1346, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 1349, + "end": 1355, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1362, + "end": 1492, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1368, + "end": 1491, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1368, + "end": 1482, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1370, + "end": 1411, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1371, + "end": 1410, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1371, + "end": 1408, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1372, + "end": 1407, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1378, + "end": 1407, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1381, + "end": 1405, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1388, + "end": 1405, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1388, + "end": 1396, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "ObjectPattern", + "span": { + "start": 1421, + "end": 1480, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1423, + "end": 1473, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1424, + "end": 1472, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1424, + "end": 1470, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1425, + "end": 1469, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1431, + "end": 1469, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1433, + "end": 1442, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1433, + "end": 1441, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1433, + "end": 1436, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1439, + "end": 1441, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 1443, + "end": 1467, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1450, + "end": 1467, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1450, + "end": 1458, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 1475, + "end": 1478, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1485, + "end": 1491, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1498, + "end": 1502, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1498, + "end": 1501, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 1527, + "end": 1885, + "ctxt": 0 + }, + "stmts": [ + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 1533, + "end": 1581, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1543, + "end": 1549, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 1550, + "end": 1581, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1560, + "end": 1575, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1560, + "end": 1566, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1566, + "end": 1574, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1568, + "end": 1574, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1568, + "end": 1574, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1587, + "end": 1615, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1591, + "end": 1614, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1591, + "end": 1594, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1594, + "end": 1614, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1596, + "end": 1614, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1596, + "end": 1602, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1605, + "end": 1614, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1620, + "end": 1646, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1624, + "end": 1645, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1624, + "end": 1630, + "ctxt": 0 + }, + "value": "window", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 1633, + "end": 1645, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1633, + "end": 1635, + "ctxt": 0 + }, + "properties": [] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1639, + "end": 1645, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1639, + "end": 1645, + "ctxt": 0 + }, + "value": "Window", + "optional": false + }, + "typeParams": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1651, + "end": 1674, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1651, + "end": 1673, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 1651, + "end": 1664, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1651, + "end": 1657, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1658, + "end": 1664, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 1667, + "end": 1673, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1680, + "end": 1840, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1686, + "end": 1839, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1686, + "end": 1830, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1688, + "end": 1728, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1689, + "end": 1727, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1689, + "end": 1725, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1690, + "end": 1724, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1696, + "end": 1724, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1698, + "end": 1722, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1705, + "end": 1722, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1705, + "end": 1713, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "ObjectPattern", + "span": { + "start": 1738, + "end": 1828, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 1740, + "end": 1780, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1741, + "end": 1779, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1741, + "end": 1777, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1742, + "end": 1776, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1748, + "end": 1776, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1750, + "end": 1774, + "ctxt": 0 + }, + "argument": { + "type": "TsConstAssertion", + "span": { + "start": 1757, + "end": 1774, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1757, + "end": 1765, + "ctxt": 0 + }, + "value": "window", + "raw": "'window'" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + }, + "value": { + "type": "AssignmentPattern", + "span": { + "start": 1782, + "end": 1826, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 1782, + "end": 1785, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1788, + "end": 1826, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 1788, + "end": 1824, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1789, + "end": 1823, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1795, + "end": 1823, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1797, + "end": 1806, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1797, + "end": 1805, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1797, + "end": 1800, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1803, + "end": 1805, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 1807, + "end": 1821, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 1814, + "end": 1820, + "ctxt": 0 + }, + "value": "window", + "optional": false + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + }, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1833, + "end": 1839, + "ctxt": 0 + }, + "value": "window", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1846, + "end": 1850, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1846, + "end": 1849, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.ts b/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.ts new file mode 100644 index 00000000000..38c5f7af607 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowBindingElement.ts @@ -0,0 +1,90 @@ +// @strictNullChecks: true +// @allowUnreachableCode: false +{ + const data = { param: 'value' }; + + const { + param = (() => { throw new Error('param is not defined') })(), + } = data; + + console.log(param); // should not trigger 'Unreachable code detected.' +} + + +{ + const data = { param: 'value' }; + + let foo: string | undefined = ""; + const { + param = (() => { throw new Error('param is not defined') })(), + } = data; + + foo; // should be string +} + +{ + const data = { param: 'value' }; + + let foo: string | undefined = ""; + const { + param = (() => { foo = undefined })(), + } = data; + + foo; // should be string | undefined +} + +{ + const data = { param: 'value' }; + + let foo: string | undefined = ""; + const { + param = (() => { return "" + 1 })(), + } = data; + + foo; // should be string +} + +{ + interface Window { + window: Window; + } + + let foo: string | undefined; + let window = {} as Window; + window.window = window; + + const { [(() => { foo = ""; return 'window' as const })()]: + { [(() => { return 'window' as const })()]: bar } } = window; + + foo; // should be string +} + +{ + interface Window { + window: Window; + } + + let foo: string | undefined; + let window = {} as Window; + window.window = window; + + const { [(() => { return 'window' as const })()]: + { [(() => { foo = ""; return 'window' as const })()]: bar } } = window; + + foo; // should be string +} + +{ + interface Window { + window: Window; + } + + let foo: string | undefined; + let window = {} as Window; + window.window = window; + + const { [(() => { return 'window' as const })()]: + { [(() => { return 'window' as const })()]: bar = (() => { foo = ""; return window; })() } } = window; + + foo; // should be string | undefined +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.json b/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.json index e36570f5d0d..a7333cd5cc9 100644 --- a/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.json +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.json @@ -2,7 +2,7 @@ "type": "Module", "span": { "start": 19, - "end": 4633, + "end": 4856, "ctxt": 0 }, "body": [ @@ -9594,6 +9594,572 @@ "kind": "void" } } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4657, + "end": 4758, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4662, + "end": 4668, + "ctxt": 0 + }, + "value": "Column", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4668, + "end": 4671, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4669, + "end": 4670, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4669, + "end": 4670, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 4674, + "end": 4758, + "ctxt": 0 + }, + "types": [ + { + "type": "TsParenthesizedType", + "span": { + "start": 4674, + "end": 4736, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4675, + "end": 4735, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeOperator", + "span": { + "start": 4675, + "end": 4682, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4681, + "end": 4682, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4681, + "end": 4682, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "extendsType": { + "type": "TsKeywordType", + "span": { + "start": 4691, + "end": 4696, + "ctxt": 0 + }, + "kind": "never" + }, + "trueType": { + "type": "TsTypeLiteral", + "span": { + "start": 4699, + "end": 4723, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 4701, + "end": 4721, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 4701, + "end": 4703, + "ctxt": 0 + }, + "value": "id", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4704, + "end": 4721, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 4706, + "end": 4721, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4706, + "end": 4712, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4715, + "end": 4721, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + }, + "typeParams": null + } + ] + }, + "falseType": { + "type": "TsTypeLiteral", + "span": { + "start": 4726, + "end": 4735, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 4728, + "end": 4733, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 4728, + "end": 4730, + "ctxt": 0 + }, + "value": "id", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4730, + "end": 4733, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4732, + "end": 4733, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4732, + "end": 4733, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 4739, + "end": 4758, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 4741, + "end": 4756, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 4741, + "end": 4746, + "ctxt": 0 + }, + "value": "title", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4747, + "end": 4755, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 4749, + "end": 4755, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 4769, + "end": 4786, + "ctxt": 0 + }, + "value": "getColumnProperty", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 4790, + "end": 4807, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4790, + "end": 4807, + "ctxt": 0 + }, + "value": "column", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4796, + "end": 4807, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4798, + "end": 4807, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4798, + "end": 4804, + "ctxt": 0 + }, + "value": "Column", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4804, + "end": 4807, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 4805, + "end": 4806, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4805, + "end": 4806, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 4809, + "end": 4829, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4809, + "end": 4829, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4812, + "end": 4829, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 4814, + "end": 4829, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4820, + "end": 4829, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4820, + "end": 4826, + "ctxt": 0 + }, + "value": "Column", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4826, + "end": 4829, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 4827, + "end": 4828, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4827, + "end": 4828, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4760, + "end": 4856, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4831, + "end": 4856, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4835, + "end": 4854, + "ctxt": 0 + }, + "argument": { + "type": "MemberExpression", + "span": { + "start": 4842, + "end": 4853, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 4842, + "end": 4848, + "ctxt": 0 + }, + "value": "column", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 4848, + "end": 4853, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 4849, + "end": 4852, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4786, + "end": 4789, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4787, + "end": 4788, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4787, + "end": 4788, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.ts b/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.ts index eb49367f123..c2fbabe9fb9 100644 --- a/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.ts +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowGenericTypes.ts @@ -211,3 +211,11 @@ function update(control : T | undefined, k control[key] = value; } } + +// Repro from #50465 + +type Column = (keyof T extends never ? { id?: number | string } : { id: T }) & { title?: string; } + +function getColumnProperty(column: Column, key: keyof Column) { + return column[key]; +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.json b/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.json new file mode 100644 index 00000000000..1483702461c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.json @@ -0,0 +1,4360 @@ +{ + "type": "Script", + "span": { + "start": 52, + "end": 2384, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 52, + "end": 70, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 56, + "end": 69, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 56, + "end": 60, + "ctxt": 0 + }, + "value": "cond", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 60, + "end": 69, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 62, + "end": 69, + "ctxt": 0 + }, + "kind": "boolean" + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 87, + "end": 90, + "ctxt": 0 + }, + "value": "len", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 91, + "end": 100, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 91, + "end": 100, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 92, + "end": 100, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 94, + "end": 100, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 72, + "end": 126, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 102, + "end": 126, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 108, + "end": 124, + "ctxt": 0 + }, + "argument": { + "type": "MemberExpression", + "span": { + "start": 115, + "end": 123, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 115, + "end": 116, + "ctxt": 0 + }, + "value": "s", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 117, + "end": 123, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 143, + "end": 145, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 128, + "end": 270, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 148, + "end": 270, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 154, + "end": 187, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 158, + "end": 186, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 158, + "end": 159, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 159, + "end": 186, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 161, + "end": 186, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 161, + "end": 167, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 170, + "end": 176, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 179, + "end": 186, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 192, + "end": 199, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 192, + "end": 198, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 192, + "end": 193, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 196, + "end": 198, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 204, + "end": 261, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 211, + "end": 215, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 217, + "end": 261, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 227, + "end": 244, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 227, + "end": 243, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 227, + "end": 228, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "AwaitExpression", + "span": { + "start": 231, + "end": 243, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 237, + "end": 243, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 237, + "end": 240, + "ctxt": 0 + }, + "value": "len", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 241, + "end": 242, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 253, + "end": 255, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 253, + "end": 254, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 266, + "end": 268, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 266, + "end": 267, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 287, + "end": 289, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 272, + "end": 414, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 292, + "end": 414, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 298, + "end": 331, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 302, + "end": 330, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 302, + "end": 303, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 303, + "end": 330, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 305, + "end": 330, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 305, + "end": 311, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 314, + "end": 320, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 323, + "end": 330, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 336, + "end": 343, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 336, + "end": 342, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 336, + "end": 337, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 340, + "end": 342, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 348, + "end": 405, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 355, + "end": 359, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 361, + "end": 405, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 371, + "end": 373, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 371, + "end": 372, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 382, + "end": 399, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 382, + "end": 398, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 382, + "end": 383, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "AwaitExpression", + "span": { + "start": 386, + "end": 398, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 392, + "end": 398, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 392, + "end": 395, + "ctxt": 0 + }, + "value": "len", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 396, + "end": 397, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 410, + "end": 412, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 410, + "end": 411, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 433, + "end": 436, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 437, + "end": 446, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 437, + "end": 446, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 438, + "end": 446, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 440, + "end": 446, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 416, + "end": 465, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 447, + "end": 464, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 449, + "end": 464, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 449, + "end": 456, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 456, + "end": 464, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 457, + "end": 463, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 483, + "end": 486, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 487, + "end": 496, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 487, + "end": 496, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 488, + "end": 496, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 490, + "end": 496, + "ctxt": 0 + }, + "kind": "number" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 466, + "end": 515, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 497, + "end": 514, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 499, + "end": 514, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 499, + "end": 506, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 506, + "end": 514, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 507, + "end": 513, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 532, + "end": 534, + "ctxt": 0 + }, + "value": "g1", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 517, + "end": 659, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 537, + "end": 659, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 543, + "end": 576, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 547, + "end": 575, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 547, + "end": 548, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 548, + "end": 575, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 550, + "end": 575, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 550, + "end": 556, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 559, + "end": 565, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 568, + "end": 575, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 581, + "end": 588, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 581, + "end": 587, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 581, + "end": 582, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 585, + "end": 587, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 593, + "end": 650, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 600, + "end": 604, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 606, + "end": 650, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 616, + "end": 633, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 616, + "end": 632, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 616, + "end": 617, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "AwaitExpression", + "span": { + "start": 620, + "end": 632, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 626, + "end": 632, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 626, + "end": 629, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 630, + "end": 631, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 642, + "end": 644, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 642, + "end": 643, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 655, + "end": 657, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 655, + "end": 656, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 676, + "end": 678, + "ctxt": 0 + }, + "value": "g2", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 661, + "end": 803, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 681, + "end": 803, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 687, + "end": 720, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 691, + "end": 719, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 691, + "end": 692, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 692, + "end": 719, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 694, + "end": 719, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 694, + "end": 700, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 703, + "end": 709, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 712, + "end": 719, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 725, + "end": 732, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 725, + "end": 731, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 725, + "end": 726, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 729, + "end": 731, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 737, + "end": 794, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 744, + "end": 748, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 750, + "end": 794, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 760, + "end": 762, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 760, + "end": 761, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 771, + "end": 788, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 771, + "end": 787, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 771, + "end": 772, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "AwaitExpression", + "span": { + "start": 775, + "end": 787, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 781, + "end": 787, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 781, + "end": 784, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 785, + "end": 786, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 799, + "end": 801, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 799, + "end": 800, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 820, + "end": 828, + "ctxt": 0 + }, + "value": "asNumber", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 829, + "end": 847, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 829, + "end": 847, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 830, + "end": 847, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 832, + "end": 847, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 832, + "end": 838, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 841, + "end": 847, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 805, + "end": 884, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 866, + "end": 884, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 872, + "end": 882, + "ctxt": 0 + }, + "argument": { + "type": "UnaryExpression", + "span": { + "start": 879, + "end": 881, + "ctxt": 0 + }, + "operator": "+", + "argument": { + "type": "Identifier", + "span": { + "start": 880, + "end": 881, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 848, + "end": 865, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 850, + "end": 865, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 850, + "end": 857, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 857, + "end": 865, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 858, + "end": 864, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 901, + "end": 903, + "ctxt": 0 + }, + "value": "h1", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 886, + "end": 1016, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 906, + "end": 1016, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 912, + "end": 945, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 916, + "end": 944, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 916, + "end": 917, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 917, + "end": 944, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 919, + "end": 944, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 919, + "end": 925, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 928, + "end": 934, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 937, + "end": 944, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 950, + "end": 958, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 950, + "end": 957, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 950, + "end": 951, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 954, + "end": 957, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 963, + "end": 1014, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 970, + "end": 974, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 976, + "end": 1014, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 986, + "end": 997, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 986, + "end": 996, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 986, + "end": 987, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 990, + "end": 996, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "UnaryExpression", + "span": { + "start": 990, + "end": 992, + "ctxt": 0 + }, + "operator": "+", + "argument": { + "type": "Identifier", + "span": { + "start": 991, + "end": 992, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 995, + "end": 996, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1006, + "end": 1008, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1006, + "end": 1007, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1033, + "end": 1035, + "ctxt": 0 + }, + "value": "h2", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 1018, + "end": 1163, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1038, + "end": 1163, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1044, + "end": 1077, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1048, + "end": 1076, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1048, + "end": 1049, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1049, + "end": 1076, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1051, + "end": 1076, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1051, + "end": 1057, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1060, + "end": 1066, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1069, + "end": 1076, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1082, + "end": 1090, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1082, + "end": 1089, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1082, + "end": 1083, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1086, + "end": 1089, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 1095, + "end": 1161, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 1102, + "end": 1106, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1108, + "end": 1161, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1118, + "end": 1144, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1118, + "end": 1143, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1118, + "end": 1119, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1122, + "end": 1143, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "AwaitExpression", + "span": { + "start": 1122, + "end": 1139, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 1128, + "end": 1139, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1128, + "end": 1136, + "ctxt": 0 + }, + "value": "asNumber", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1137, + "end": 1138, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 1142, + "end": 1143, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1153, + "end": 1155, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1153, + "end": 1154, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1180, + "end": 1182, + "ctxt": 0 + }, + "value": "h3", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 1165, + "end": 1329, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1185, + "end": 1329, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1191, + "end": 1224, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1195, + "end": 1223, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1195, + "end": 1196, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1196, + "end": 1223, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1198, + "end": 1223, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1198, + "end": 1204, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1207, + "end": 1213, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1216, + "end": 1223, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1229, + "end": 1237, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1229, + "end": 1236, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1229, + "end": 1230, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1233, + "end": 1236, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 1242, + "end": 1327, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 1249, + "end": 1253, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1255, + "end": 1327, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1265, + "end": 1291, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1269, + "end": 1290, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1269, + "end": 1270, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "AwaitExpression", + "span": { + "start": 1273, + "end": 1290, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 1279, + "end": 1290, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1279, + "end": 1287, + "ctxt": 0 + }, + "value": "asNumber", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1288, + "end": 1289, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1300, + "end": 1310, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1300, + "end": 1309, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1300, + "end": 1301, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1304, + "end": 1309, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 1304, + "end": 1305, + "ctxt": 0 + }, + "value": "y", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 1308, + "end": 1309, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1319, + "end": 1321, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1319, + "end": 1320, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1346, + "end": 1348, + "ctxt": 0 + }, + "value": "h4", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 1331, + "end": 1506, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1351, + "end": 1506, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1357, + "end": 1390, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1361, + "end": 1389, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1361, + "end": 1362, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1362, + "end": 1389, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1364, + "end": 1389, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1364, + "end": 1370, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1373, + "end": 1379, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1382, + "end": 1389, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1395, + "end": 1403, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1395, + "end": 1402, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1395, + "end": 1396, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1399, + "end": 1402, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + } + }, + { + "type": "WhileStatement", + "span": { + "start": 1408, + "end": 1504, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 1415, + "end": 1419, + "ctxt": 0 + }, + "value": "cond", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1421, + "end": 1504, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1431, + "end": 1433, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1431, + "end": 1432, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1442, + "end": 1468, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1446, + "end": 1467, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1446, + "end": 1447, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "AwaitExpression", + "span": { + "start": 1450, + "end": 1467, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 1456, + "end": 1467, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1456, + "end": 1464, + "ctxt": 0 + }, + "value": "asNumber", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1465, + "end": 1466, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1477, + "end": 1487, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1477, + "end": 1486, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1477, + "end": 1478, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1481, + "end": 1486, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 1481, + "end": 1482, + "ctxt": 0 + }, + "value": "y", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 1485, + "end": 1486, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1496, + "end": 1498, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1496, + "end": 1497, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1540, + "end": 1550, + "ctxt": 0 + }, + "value": "get_things", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1551, + "end": 1572, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1551, + "end": 1572, + "ctxt": 0 + }, + "value": "_", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1552, + "end": 1572, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1554, + "end": 1572, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1554, + "end": 1560, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1563, + "end": 1572, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1525, + "end": 1593, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1574, + "end": 1593, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1580, + "end": 1591, + "ctxt": 0 + }, + "argument": { + "type": "ArrayExpression", + "span": { + "start": 1587, + "end": 1590, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 1588, + "end": 1589, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1610, + "end": 1616, + "ctxt": 0 + }, + "value": "foobar", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 1595, + "end": 1789, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1619, + "end": 1789, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1625, + "end": 1668, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1629, + "end": 1667, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1629, + "end": 1635, + "ctxt": 0 + }, + "value": "before", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1635, + "end": 1655, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1637, + "end": 1655, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1637, + "end": 1643, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1646, + "end": 1655, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 1658, + "end": 1667, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ForStatement", + "span": { + "start": 1673, + "end": 1787, + "ctxt": 0 + }, + "init": { + "type": "VariableDeclaration", + "span": { + "start": 1678, + "end": 1687, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1682, + "end": 1687, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1682, + "end": 1683, + "ctxt": 0 + }, + "value": "i", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 1686, + "end": 1687, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1689, + "end": 1694, + "ctxt": 0 + }, + "operator": "<", + "left": { + "type": "Identifier", + "span": { + "start": 1689, + "end": 1690, + "ctxt": 0 + }, + "value": "i", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 1693, + "end": 1694, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "update": { + "type": "UpdateExpression", + "span": { + "start": 1696, + "end": 1699, + "ctxt": 0 + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "span": { + "start": 1696, + "end": 1697, + "ctxt": 0 + }, + "value": "i", + "optional": false + } + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1701, + "end": 1787, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1711, + "end": 1752, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1717, + "end": 1751, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1717, + "end": 1724, + "ctxt": 0 + }, + "value": "results", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "AwaitExpression", + "span": { + "start": 1727, + "end": 1751, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 1733, + "end": 1751, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1733, + "end": 1743, + "ctxt": 0 + }, + "value": "get_things", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1744, + "end": 1750, + "ctxt": 0 + }, + "value": "before", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1761, + "end": 1781, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1761, + "end": 1780, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1761, + "end": 1767, + "ctxt": 0 + }, + "value": "before", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1770, + "end": 1780, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1770, + "end": 1777, + "ctxt": 0 + }, + "value": "results", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 1777, + "end": 1780, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 1778, + "end": 1779, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1848, + "end": 1852, + "ctxt": 0 + }, + "value": "foox", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1853, + "end": 1874, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1853, + "end": 1874, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1854, + "end": 1874, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1856, + "end": 1874, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1856, + "end": 1862, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1865, + "end": 1874, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1831, + "end": 1892, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 1875, + "end": 1892, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1877, + "end": 1892, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1877, + "end": 1884, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1884, + "end": 1892, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1885, + "end": 1891, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1894, + "end": 2022, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1894, + "end": 2022, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1906, + "end": 2022, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1910, + "end": 1950, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1914, + "end": 1949, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1914, + "end": 1917, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1917, + "end": 1937, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 1919, + "end": 1937, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 1919, + "end": 1925, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 1928, + "end": 1937, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 1940, + "end": 1949, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "DoWhileStatement", + "span": { + "start": 1953, + "end": 2020, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 2016, + "end": 2019, + "ctxt": 0 + }, + "value": "bar", + "optional": false + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1956, + "end": 2008, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1962, + "end": 1990, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1968, + "end": 1989, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1968, + "end": 1971, + "ctxt": 0 + }, + "value": "baz", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "AwaitExpression", + "span": { + "start": 1974, + "end": 1989, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 1980, + "end": 1989, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1980, + "end": 1984, + "ctxt": 0 + }, + "value": "foox", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1985, + "end": 1988, + "ctxt": 0 + }, + "value": "bar", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1995, + "end": 2004, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1995, + "end": 2004, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1995, + "end": 1998, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2001, + "end": 2004, + "ctxt": 0 + }, + "value": "baz", + "optional": false + } + } + } + ] + } + } + ] + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2081, + "end": 2088, + "ctxt": 0 + }, + "value": "myQuery", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2089, + "end": 2126, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2089, + "end": 2126, + "ctxt": 0 + }, + "value": "input", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2094, + "end": 2126, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 2096, + "end": 2126, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2098, + "end": 2124, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2098, + "end": 2104, + "ctxt": 0 + }, + "value": "lastId", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2104, + "end": 2124, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 2106, + "end": 2124, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2106, + "end": 2112, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 2115, + "end": 2124, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2064, + "end": 2161, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 2127, + "end": 2160, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2129, + "end": 2160, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2129, + "end": 2136, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2136, + "end": 2160, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2137, + "end": 2159, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2139, + "end": 2157, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2139, + "end": 2147, + "ctxt": 0 + }, + "value": "entities", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2147, + "end": 2157, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 2149, + "end": 2157, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 2149, + "end": 2155, + "ctxt": 0 + }, + "kind": "number" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2178, + "end": 2184, + "ctxt": 0 + }, + "value": "myFunc", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 2163, + "end": 2384, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2202, + "end": 2384, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 2206, + "end": 2249, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 2210, + "end": 2248, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2210, + "end": 2216, + "ctxt": 0 + }, + "value": "lastId", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2216, + "end": 2236, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 2218, + "end": 2236, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2218, + "end": 2224, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 2227, + "end": 2236, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 2239, + "end": 2248, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "WhileStatement", + "span": { + "start": 2253, + "end": 2381, + "ctxt": 0 + }, + "test": { + "type": "BooleanLiteral", + "span": { + "start": 2260, + "end": 2264, + "ctxt": 0 + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2266, + "end": 2381, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 2272, + "end": 2332, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 2278, + "end": 2331, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 2278, + "end": 2290, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 2280, + "end": 2288, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 2280, + "end": 2288, + "ctxt": 0 + }, + "value": "entities", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "AwaitExpression", + "span": { + "start": 2293, + "end": 2331, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 2299, + "end": 2331, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2299, + "end": 2306, + "ctxt": 0 + }, + "value": "myQuery", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 2307, + "end": 2330, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 2317, + "end": 2323, + "ctxt": 0 + }, + "value": "lastId", + "optional": false + } + ] + } + } + ], + "typeArguments": null + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2338, + "end": 2377, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2338, + "end": 2376, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2338, + "end": 2344, + "ctxt": 0 + }, + "value": "lastId", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 2347, + "end": 2376, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2347, + "end": 2355, + "ctxt": 0 + }, + "value": "entities", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 2355, + "end": 2376, + "ctxt": 0 + }, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 2356, + "end": 2375, + "ctxt": 0 + }, + "operator": "-", + "left": { + "type": "MemberExpression", + "span": { + "start": 2356, + "end": 2371, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2356, + "end": 2364, + "ctxt": 0 + }, + "value": "entities", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2365, + "end": 2371, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 2374, + "end": 2375, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + } + } + } + ] + } + } + ] + }, + "generator": false, + "async": true, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 2186, + "end": 2201, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2188, + "end": 2201, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2188, + "end": 2195, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2195, + "end": 2201, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2196, + "end": 2200, + "ctxt": 0 + }, + "kind": "void" + } + ] + } + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.ts b/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.ts new file mode 100644 index 00000000000..9ed052be032 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowIterationErrorsAsync.ts @@ -0,0 +1,137 @@ +// @strict: true +// @noEmit: true +// @lib: esnext + +let cond: boolean; + +async function len(s: string) { + return s.length; +} + +async function f1() { + let x: string | number | boolean; + x = ""; + while (cond) { + x = await len(x); + x; + } + x; +} + +async function f2() { + let x: string | number | boolean; + x = ""; + while (cond) { + x; + x = await len(x); + } + x; +} + +declare function foo(x: string): Promise; +declare function foo(x: number): Promise; + +async function g1() { + let x: string | number | boolean; + x = ""; + while (cond) { + x = await foo(x); + x; + } + x; +} + +async function g2() { + let x: string | number | boolean; + x = ""; + while (cond) { + x; + x = await foo(x); + } + x; +} + +async function asNumber(x: string | number): Promise { + return +x; +} + +async function h1() { + let x: string | number | boolean; + x = "0"; + while (cond) { + x = +x + 1; + x; + } +} + +async function h2() { + let x: string | number | boolean; + x = "0"; + while (cond) { + x = await asNumber(x) + 1; + x; + } +} + +async function h3() { + let x: string | number | boolean; + x = "0"; + while (cond) { + let y = await asNumber(x); + x = y + 1; + x; + } +} + +async function h4() { + let x: string | number | boolean; + x = "0"; + while (cond) { + x; + let y = await asNumber(x); + x = y + 1; + x; + } +} + +// repro #51115 + +async function get_things(_: number | undefined) { + return [0]; +} + +async function foobar() { + let before: number | undefined = undefined; + for (let i = 0; i < 2; i++) { + const results = await get_things(before); + before = results[0]; + } +} + +// repro #43047#issuecomment-821453073 + +declare function foox(x: string | undefined): Promise + +async () => { + let bar: string | undefined = undefined; + do { + const baz = await foox(bar); + bar = baz + } while (bar) +} + +// repro #43047#issuecomment-874221939 + +declare function myQuery(input: { lastId: number | undefined }): Promise<{ entities: number[] }>; + +async function myFunc(): Promise { + let lastId: number | undefined = undefined; + + while (true) { + const { entities } = await myQuery({ + lastId, + }); + + lastId = entities[entities.length - 1]; + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.json b/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.json index d7ece2cfec3..a04c9324afc 100644 --- a/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.json +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 88, - "end": 10238, + "end": 10493, "ctxt": 0 }, "body": [ @@ -22249,6 +22249,502 @@ } ] } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10263, + "end": 10331, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10268, + "end": 10273, + "ctxt": 0 + }, + "value": "Test5", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 10276, + "end": 10330, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 10280, + "end": 10328, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 10280, + "end": 10284, + "ctxt": 0 + }, + "value": "main", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 10285, + "end": 10327, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 10287, + "end": 10327, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 10293, + "end": 10323, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 10293, + "end": 10299, + "ctxt": 0 + }, + "value": "childs", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 10299, + "end": 10322, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 10301, + "end": 10322, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10301, + "end": 10307, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 10307, + "end": 10322, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 10308, + "end": 10314, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 10316, + "end": 10321, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10316, + "end": 10321, + "ctxt": 0 + }, + "value": "Test5", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + "typeParams": null + } + ] + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 10342, + "end": 10345, + "ctxt": 0 + }, + "value": "f50", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 10346, + "end": 10356, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 10346, + "end": 10356, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 10349, + "end": 10356, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 10351, + "end": 10356, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10351, + "end": 10356, + "ctxt": 0 + }, + "value": "Test5", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 10333, + "end": 10493, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 10358, + "end": 10493, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ForInStatement", + "span": { + "start": 10363, + "end": 10475, + "ctxt": 0 + }, + "left": { + "type": "VariableDeclaration", + "span": { + "start": 10368, + "end": 10377, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 10374, + "end": 10377, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 10374, + "end": 10377, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": null + }, + "init": null, + "definite": false + } + ] + }, + "right": { + "type": "OptionalChainingExpression", + "span": { + "start": 10381, + "end": 10397, + "ctxt": 0 + }, + "questionDotToken": { + "start": 10389, + "end": 10390, + "ctxt": 0 + }, + "base": { + "type": "MemberExpression", + "span": { + "start": 10381, + "end": 10397, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 10381, + "end": 10389, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 10381, + "end": 10384, + "ctxt": 0 + }, + "value": "obj", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 10385, + "end": 10389, + "ctxt": 0 + }, + "value": "main", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 10391, + "end": 10397, + "ctxt": 0 + }, + "value": "childs", + "optional": false + } + } + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 10399, + "end": 10475, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 10407, + "end": 10470, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 10411, + "end": 10439, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "MemberExpression", + "span": { + "start": 10411, + "end": 10431, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 10411, + "end": 10426, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 10411, + "end": 10419, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 10411, + "end": 10414, + "ctxt": 0 + }, + "value": "obj", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 10415, + "end": 10419, + "ctxt": 0 + }, + "value": "main", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 10420, + "end": 10426, + "ctxt": 0 + }, + "value": "childs", + "optional": false + } + }, + "property": { + "type": "Computed", + "span": { + "start": 10426, + "end": 10431, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 10427, + "end": 10430, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 10436, + "end": 10439, + "ctxt": 0 + }, + "value": "obj", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 10441, + "end": 10470, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 10451, + "end": 10462, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 10458, + "end": 10461, + "ctxt": 0 + }, + "value": "obj", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 10479, + "end": 10491, + "ctxt": 0 + }, + "argument": { + "type": "NullLiteral", + "span": { + "start": 10486, + "end": 10490, + "ctxt": 0 + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.ts b/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.ts index 21c4b325aa0..6aa36192690 100644 --- a/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.ts +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowOptionalChain.ts @@ -590,3 +590,21 @@ while (arr[i]?.tag === "left") { console.log("I should ALSO be reachable"); } } + + +// Repro from #51941 + +type Test5 = { + main?: { + childs: Record; + }; +}; + +function f50(obj: Test5) { + for (const key in obj.main?.childs) { + if (obj.main.childs[key] === obj) { + return obj; + } + } + return null; +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.json b/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.json new file mode 100644 index 00000000000..96773ae8426 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.json @@ -0,0 +1,991 @@ +{ + "type": "Script", + "span": { + "start": 60, + "end": 622, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 69, + "end": 71, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 75, + "end": 138, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 75, + "end": 138, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 75, + "end": 92, + "ctxt": 0 + }, + "value": "required", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 83, + "end": 92, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 85, + "end": 92, + "ctxt": 0 + }, + "kind": "unknown" + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 95, + "end": 138, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 95, + "end": 136, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 96, + "end": 135, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 102, + "end": 135, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 108, + "end": 131, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 114, + "end": 130, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 118, + "end": 123, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 124, + "end": 129, + "ctxt": 0 + }, + "value": "bad", + "raw": "\"bad\"" + } + } + ], + "typeArguments": null + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + }, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 60, + "end": 216, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 141, + "end": 216, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 145, + "end": 163, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 145, + "end": 162, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 145, + "end": 156, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 145, + "end": 152, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 153, + "end": 156, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 157, + "end": 161, + "ctxt": 0 + }, + "value": "ok", + "raw": "\"ok\"" + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 227, + "end": 229, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 233, + "end": 263, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 233, + "end": 263, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 234, + "end": 263, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 236, + "end": 263, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 236, + "end": 242, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 245, + "end": 251, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 254, + "end": 263, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 267, + "end": 313, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 267, + "end": 313, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 267, + "end": 284, + "ctxt": 0 + }, + "value": "required", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 275, + "end": 284, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 277, + "end": 284, + "ctxt": 0 + }, + "kind": "unknown" + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 287, + "end": 313, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 287, + "end": 311, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 288, + "end": 310, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 294, + "end": 310, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 300, + "end": 306, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 300, + "end": 305, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 300, + "end": 301, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 304, + "end": 305, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + }, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 218, + "end": 365, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 316, + "end": 365, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 320, + "end": 322, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 320, + "end": 321, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 376, + "end": 378, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 382, + "end": 416, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 382, + "end": 416, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 382, + "end": 412, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 383, + "end": 412, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 385, + "end": 412, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 385, + "end": 391, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 394, + "end": 400, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 403, + "end": 412, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 415, + "end": 416, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 420, + "end": 467, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 420, + "end": 467, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 420, + "end": 437, + "ctxt": 0 + }, + "value": "required", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 428, + "end": 437, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 430, + "end": 437, + "ctxt": 0 + }, + "kind": "unknown" + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 440, + "end": 467, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 440, + "end": 465, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 441, + "end": 464, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 447, + "end": 464, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 453, + "end": 460, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 453, + "end": 459, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 453, + "end": 454, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 457, + "end": 459, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + }, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 367, + "end": 507, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 470, + "end": 507, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 474, + "end": 476, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 474, + "end": 475, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 518, + "end": 520, + "ctxt": 0 + }, + "value": "f4", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 524, + "end": 558, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 524, + "end": 558, + "ctxt": 0 + }, + "left": { + "type": "Identifier", + "span": { + "start": 524, + "end": 554, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 525, + "end": 554, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 527, + "end": 554, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 527, + "end": 533, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 536, + "end": 542, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 545, + "end": 554, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 557, + "end": 558, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 562, + "end": 591, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 562, + "end": 591, + "ctxt": 0 + }, + "left": { + "type": "ObjectPattern", + "span": { + "start": 562, + "end": 579, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Computed", + "span": { + "start": 564, + "end": 574, + "ctxt": 0 + }, + "expression": { + "type": "ParenthesisExpression", + "span": { + "start": 565, + "end": 573, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 566, + "end": 572, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 566, + "end": 567, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 570, + "end": 572, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + } + }, + "value": { + "type": "Identifier", + "span": { + "start": 576, + "end": 577, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "TsAsExpression", + "span": { + "start": 582, + "end": 591, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 582, + "end": 584, + "ctxt": 0 + }, + "properties": [] + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 588, + "end": 591, + "ctxt": 0 + }, + "kind": "any" + } + }, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 509, + "end": 622, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 594, + "end": 622, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 598, + "end": 600, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 598, + "end": 599, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.ts b/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.ts new file mode 100644 index 00000000000..bf4a44f7b7d --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/controlFlowParameter.ts @@ -0,0 +1,34 @@ +// @strictNullChecks: true +// @allowUnreachableCode: false +function f1( + required: unknown = (() => { + throw new Error("bad"); + })() +) { + console.log("ok"); // should not trigger 'Unreachable code detected.' +} + +function f2( + a: number | string | undefined, + required: unknown = (() => { + a = 1; + })() +) { + a; // should be number | string | undefined +} + +function f3( + a: number | string | undefined = 1, + required: unknown = (() => { + a = ""; + })() +) { + a; // should be number | string +} + +function f4( + a: number | string | undefined = 1, + { [(a = "")]: b } = {} as any +) { + a; // should be string +} diff --git a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences1.json b/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences1.json deleted file mode 100644 index 479111bcd8a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences1.json +++ /dev/null @@ -1,392 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 150, - "end": 448, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 150, - "end": 178, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 165, - "end": 177, - "ctxt": 0 - }, - "value": "classnames", - "raw": "\"classnames\"" - }, - "body": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 241, - "end": 274, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "cx", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "value": "classnames", - "raw": "'classnames'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 275, - "end": 306, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 282, - "end": 292, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 298, - "end": 305, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 308, - "end": 324, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 332, - "end": 448, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 336, - "end": 447, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 336, - "end": 337, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 340, - "end": 447, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 341, - "end": 347, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 340, - "end": 365, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 349, - "end": 352, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 352, - "end": 363, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 365, - "end": 378, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 378, - "end": 429, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 378, - "end": 429, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 384, - "end": 426, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 384, - "end": 393, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 394, - "end": 426, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 395, - "end": 425, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 395, - "end": 397, - "ctxt": 0 - }, - "value": "cx", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 398, - "end": 406, - "ctxt": 0 - }, - "value": "class1", - "raw": "'class1'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 408, - "end": 424, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 410, - "end": 416, - "ctxt": 0 - }, - "value": "class2", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 418, - "end": 422, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 429, - "end": 438, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 438, - "end": 447, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 440, - "end": 446, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences2.json b/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences2.json deleted file mode 100644 index bedf16b9d0d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences2.json +++ /dev/null @@ -1,474 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 150, - "end": 472, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 150, - "end": 178, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 165, - "end": 177, - "ctxt": 0 - }, - "value": "classnames", - "raw": "\"classnames\"" - }, - "body": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 241, - "end": 274, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "cx", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "value": "classnames", - "raw": "'classnames'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 275, - "end": 306, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 282, - "end": 292, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 298, - "end": 305, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 308, - "end": 355, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 312, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 324, - "end": 355, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 326, - "end": 355, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 328, - "end": 349, - "ctxt": 0 - }, - "value": "attributeName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 341, - "end": 349, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 343, - "end": 349, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 350, - "end": 354, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - "readonly": false, - "static": false, - "span": { - "start": 327, - "end": 354, - "ctxt": 0 - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 472, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 471, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 361, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 364, - "end": 471, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 371, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 364, - "end": 389, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 376, - "end": 387, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 389, - "end": 402, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 402, - "end": 453, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 403, - "end": 407, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 402, - "end": 453, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 408, - "end": 450, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 408, - "end": 417, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 418, - "end": 450, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 419, - "end": 449, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 419, - "end": 421, - "ctxt": 0 - }, - "value": "cx", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 422, - "end": 430, - "ctxt": 0 - }, - "value": "class1", - "raw": "'class1'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 432, - "end": 448, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 434, - "end": 440, - "ctxt": 0 - }, - "value": "class2", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 442, - "end": 446, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 453, - "end": 462, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 462, - "end": 471, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 464, - "end": 470, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences3.json b/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences3.json deleted file mode 100644 index 31f7aa8324e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences3.json +++ /dev/null @@ -1,392 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 174, - "end": 465, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 174, - "end": 202, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 189, - "end": 201, - "ctxt": 0 - }, - "value": "classnames", - "raw": "\"classnames\"" - }, - "body": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 265, - "end": 298, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 272, - "end": 279, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 277, - "end": 279, - "ctxt": 0 - }, - "value": "cx", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 285, - "end": 297, - "ctxt": 0 - }, - "value": "classnames", - "raw": "'classnames'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 299, - "end": 330, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 306, - "end": 316, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 311, - "end": 316, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 322, - "end": 329, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 332, - "end": 348, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 336, - "end": 347, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 336, - "end": 347, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 349, - "end": 465, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 353, - "end": 464, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 357, - "end": 464, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 364, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 357, - "end": 382, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 366, - "end": 369, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 369, - "end": 380, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 382, - "end": 395, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 395, - "end": 446, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 396, - "end": 400, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 395, - "end": 446, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 401, - "end": 443, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 401, - "end": 410, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 411, - "end": 443, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 412, - "end": 442, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 412, - "end": 414, - "ctxt": 0 - }, - "value": "cx", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 415, - "end": 423, - "ctxt": 0 - }, - "value": "class1", - "raw": "'class1'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 425, - "end": 441, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 427, - "end": 433, - "ctxt": 0 - }, - "value": "class2", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 435, - "end": 439, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 446, - "end": 455, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 455, - "end": 464, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 457, - "end": 463, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences4.json b/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences4.json deleted file mode 100644 index 60feb209f85..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/correctlyMarkAliasAsReferences4.json +++ /dev/null @@ -1,404 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 150, - "end": 435, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 150, - "end": 178, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 165, - "end": 177, - "ctxt": 0 - }, - "value": "classnames", - "raw": "\"classnames\"" - }, - "body": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 241, - "end": 274, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "cx", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "value": "classnames", - "raw": "'classnames'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 275, - "end": 306, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 282, - "end": 292, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 298, - "end": 305, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 308, - "end": 355, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 312, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 324, - "end": 355, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 326, - "end": 355, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 328, - "end": 349, - "ctxt": 0 - }, - "value": "attributeName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 341, - "end": 349, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 343, - "end": 349, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 350, - "end": 354, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - }, - "readonly": false, - "static": false, - "span": { - "start": 327, - "end": 354, - "ctxt": 0 - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 356, - "end": 435, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 360, - "end": 434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 360, - "end": 361, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 364, - "end": 434, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 371, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 364, - "end": 434, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 376, - "end": 387, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 389, - "end": 431, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 389, - "end": 398, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 399, - "end": 431, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 400, - "end": 430, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 400, - "end": 402, - "ctxt": 0 - }, - "value": "cx", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 403, - "end": 411, - "ctxt": 0 - }, - "value": "class1", - "raw": "'class1'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 413, - "end": 429, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 415, - "end": 421, - "ctxt": 0 - }, - "value": "class2", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 423, - "end": 427, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.json b/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.json new file mode 100644 index 00000000000..2a8d5d5d62f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.json @@ -0,0 +1,185 @@ +{ + "type": "Module", + "span": { + "start": 92, + "end": 246, + "ctxt": 0 + }, + "body": [ + { + "type": "ImportDeclaration", + "span": { + "start": 92, + "end": 123, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 99, + "end": 103, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 99, + "end": 103, + "ctxt": 0 + }, + "value": "data", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 109, + "end": 122, + "ctxt": 0 + }, + "value": "./data.json", + "raw": "\"./data.json\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 124, + "end": 145, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 128, + "end": 144, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 128, + "end": 129, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 129, + "end": 137, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 131, + "end": 137, + "ctxt": 0 + }, + "kind": "string" + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 140, + "end": 144, + "ctxt": 0 + }, + "value": "data", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "BlockStatement", + "span": { + "start": 170, + "end": 172, + "ctxt": 0 + }, + "stmts": [] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 202, + "end": 226, + "ctxt": 0 + }, + "kind": "var", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 214, + "end": 225, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 214, + "end": 217, + "ctxt": 0 + }, + "value": "val", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 217, + "end": 225, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 219, + "end": 225, + "ctxt": 0 + }, + "kind": "string" + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 227, + "end": 246, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 242, + "end": 245, + "ctxt": 0 + }, + "value": "val", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.ts b/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.ts new file mode 100644 index 00000000000..a36c21d8a99 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/declarationFileForJsonImport.ts @@ -0,0 +1,10 @@ +// @allowArbitraryExtensions: true +// @resolveJsonModule: true,false +// @filename: main.ts +import data from "./data.json"; +let x: string = data; +// @filename: data.json +{} +// @filename: data.d.json.ts +declare var val: string; +export default val; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.json b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.json deleted file mode 100644 index ba831c14eca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 85, - "end": 242, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 85, - "end": 115, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 89, - "end": 114, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 98, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 98, - "end": 114, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 100, - "end": 114, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 100, - "end": 114, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 128, - "end": 155, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 143, - "end": 155, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 117, - "end": 127, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 118, - "end": 127, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 176, - "end": 206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 180, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 205, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 205, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 191, - "end": 205, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 219, - "end": 242, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 234, - "end": 242, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 208, - "end": 218, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 209, - "end": 218, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.ts b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.ts deleted file mode 100644 index 4a4abd59d43..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedAmd.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @target: ES6 -// @experimentalDecorators: true -// @module: amd -// @filename: a.ts -var decorator: ClassDecorator; - -@decorator -export default class Foo {} - -// @filename: b.ts -var decorator: ClassDecorator; - -@decorator -export default class {} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.json b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.json deleted file mode 100644 index 272892fa2a5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 90, - "end": 247, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 90, - "end": 120, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 103, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 119, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 105, - "end": 119, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 105, - "end": 119, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 133, - "end": 160, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 154, - "end": 157, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 148, - "end": 160, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 122, - "end": 132, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 123, - "end": 132, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 181, - "end": 211, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 185, - "end": 210, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 185, - "end": 194, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 196, - "end": 210, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 196, - "end": 210, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 224, - "end": 247, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 239, - "end": 247, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 213, - "end": 223, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 214, - "end": 223, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.ts b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.ts deleted file mode 100644 index ca5555759ca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedCommonjs.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @target: ES6 -// @experimentalDecorators: true -// @module: commonjs -// @filename: a.ts -var decorator: ClassDecorator; - -@decorator -export default class Foo {} - -// @filename: b.ts -var decorator: ClassDecorator; - -@decorator -export default class {} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.json b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.json deleted file mode 100644 index 0967e0226d2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 88, - "end": 245, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 88, - "end": 118, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 92, - "end": 117, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 92, - "end": 101, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 101, - "end": 117, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 103, - "end": 117, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 103, - "end": 117, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 131, - "end": 158, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 146, - "end": 158, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 120, - "end": 130, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 121, - "end": 130, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 179, - "end": 209, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 183, - "end": 208, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 192, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 192, - "end": 208, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 194, - "end": 208, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 194, - "end": 208, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 222, - "end": 245, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 211, - "end": 221, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 212, - "end": 221, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.ts b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.ts deleted file mode 100644 index de4287619d5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedSystem.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @target: ES6 -// @experimentalDecorators: true -// @module: system -// @filename: a.ts -var decorator: ClassDecorator; - -@decorator -export default class Foo {} - -// @filename: b.ts -var decorator: ClassDecorator; - -@decorator -export default class {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.json b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.json deleted file mode 100644 index ba831c14eca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 85, - "end": 242, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 85, - "end": 115, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 89, - "end": 114, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 98, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 98, - "end": 114, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 100, - "end": 114, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 100, - "end": 114, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 128, - "end": 155, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 143, - "end": 155, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 117, - "end": 127, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 118, - "end": 127, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 176, - "end": 206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 180, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 205, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 205, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 191, - "end": 205, - "ctxt": 0 - }, - "value": "ClassDecorator", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 219, - "end": 242, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 234, - "end": 242, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 208, - "end": 218, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 209, - "end": 218, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.ts b/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.ts deleted file mode 100644 index 3c8cb8a802c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratedDefaultExportsGetExportedUmd.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @target: ES6 -// @experimentalDecorators: true -// @module: umd -// @filename: a.ts -var decorator: ClassDecorator; - -@decorator -export default class Foo {} - -// @filename: b.ts -var decorator: ClassDecorator; - -@decorator -export default class {} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.json b/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.json deleted file mode 100644 index 020e3b1f92b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.json +++ /dev/null @@ -1,472 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 34, - "end": 167, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 34, - "end": 85, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 49, - "end": 85, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 55, - "end": 68, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 55, - "end": 64, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 64, - "end": 67, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 66, - "end": 67, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 66, - "end": 67, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 73, - "end": 83, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 73, - "end": 74, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 74, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 76, - "end": 83, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 95, - "end": 98, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 102, - "end": 109, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 102, - "end": 109, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 109, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 105, - "end": 109, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 106, - "end": 109, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 86, - "end": 114, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 111, - "end": 114, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 98, - "end": 101, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 127, - "end": 128, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 116, - "end": 167, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 116, - "end": 120, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 117, - "end": 120, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 135, - "end": 147, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 135, - "end": 141, - "ctxt": 0 - }, - "value": "_brand", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 141, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 152, - "end": 165, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 159, - "end": 160, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 152, - "end": 165, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 163, - "end": 165, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.ts b/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.ts deleted file mode 100644 index 9289746ca99..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorCallGeneric.ts +++ /dev/null @@ -1,12 +0,0 @@ -// @experimentalDecorators: true -interface I { - prototype: T, - m: () => T -} -function dec(c: I) { } - -@dec -class C { - _brand: any; - static m() {} -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.json deleted file mode 100644 index 5ea86171a18..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 49, - "end": 123, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 100, - "end": 101, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 89, - "end": 105, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 107, - "end": 123, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 111, - "end": 122, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 115, - "end": 122, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 119, - "end": 120, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.ts deleted file mode 100644 index 5530dad4855..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass1.es6.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -class C { -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.json deleted file mode 100644 index 2f4f5463558..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 130, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 94, - "end": 112, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 101, - "end": 112, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 114, - "end": 130, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 118, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.ts deleted file mode 100644 index a524f411de4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass2.es6.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export class C { -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.json deleted file mode 100644 index c7931fd9a06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 138, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 94, - "end": 120, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "span": { - "start": 109, - "end": 120, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 122, - "end": 138, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 126, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 130, - "end": 137, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.ts deleted file mode 100644 index 9d2d06ba7ab..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass3.es6.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export default class C { -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.json deleted file mode 100644 index 14e81d9b9e1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.json +++ /dev/null @@ -1,185 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 118, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 94, - "end": 118, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 109, - "end": 118, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.ts deleted file mode 100644 index fb33b9dbecc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass4.es6.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export default class { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.json deleted file mode 100644 index 5d7bdd2d361..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.json +++ /dev/null @@ -1,361 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 49, - "end": 172, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 100, - "end": 101, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 89, - "end": 154, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 108, - "end": 134, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 108, - "end": 134, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 119, - "end": 134, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 121, - "end": 132, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 139, - "end": 152, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 172, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 171, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 164, - "end": 171, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.ts deleted file mode 100644 index 0c657e55166..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass5.es6.ts +++ /dev/null @@ -1,11 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -class C { - static x() { return C.y; } - static y = 1; -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.json deleted file mode 100644 index bfa73dc3a3d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.json +++ /dev/null @@ -1,369 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 179, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 94, - "end": 161, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 101, - "end": 161, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 115, - "end": 141, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 123, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 115, - "end": 141, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 126, - "end": 141, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 128, - "end": 139, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 146, - "end": 159, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 153, - "end": 154, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 163, - "end": 179, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 167, - "end": 178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 171, - "end": 178, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.ts deleted file mode 100644 index c393820887f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass6.es6.ts +++ /dev/null @@ -1,11 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export class C { - static x() { return C.y; } - static y = 1; -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.json deleted file mode 100644 index 4c423311e04..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.json +++ /dev/null @@ -1,368 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 187, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 94, - "end": 169, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "span": { - "start": 109, - "end": 169, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 123, - "end": 149, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 123, - "end": 149, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 134, - "end": 149, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 136, - "end": 147, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 143, - "end": 144, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 145, - "end": 146, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 154, - "end": 167, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 161, - "end": 162, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 171, - "end": 187, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 175, - "end": 186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 179, - "end": 186, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 183, - "end": 184, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.ts deleted file mode 100644 index 72f914b4b7a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass7.es6.ts +++ /dev/null @@ -1,11 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export default class C { - static x() { return C.y; } - static y = 1; -} - -let c = new C(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.json deleted file mode 100644 index b95315aeef1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 49, - "end": 136, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 49, - "end": 87, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 70, - "end": 71, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 94, - "end": 136, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 109, - "end": 136, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 121, - "end": 134, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.ts deleted file mode 100644 index 65c6d6cd616..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClass8.es6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target:es6 -// @experimentaldecorators: true -declare function dec(target: T): T; - -@dec -export default class { - static y = 1; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.json deleted file mode 100644 index 00f415cfc1e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 72, - "end": 262, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 96, - "end": 107, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 96, - "end": 107, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 102, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 109, - "end": 128, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 109, - "end": 128, - "ctxt": 0 - }, - "value": "propertyKey", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 128, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 130, - "end": 168, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 130, - "end": 168, - "ctxt": 0 - }, - "value": "descriptor", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 168, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 142, - "end": 168, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 142, - "end": 165, - "ctxt": 0 - }, - "value": "TypedPropertyDescriptor", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 165, - "end": 168, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 72, - "end": 198, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 92, - "end": 95, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 93, - "end": 94, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 93, - "end": 94, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 171, - "end": 197, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 171, - "end": 194, - "ctxt": 0 - }, - "value": "TypedPropertyDescriptor", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 200, - "end": 262, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 215, - "end": 262, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 227, - "end": 260, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 236, - "end": 244, - "ctxt": 0 - }, - "value": "accessor", - "optional": false - }, - "function": { - "params": [], - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 228, - "end": 231, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "span": { - "start": 227, - "end": 260, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 247, - "end": 260, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 256, - "end": 257, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.ts deleted file mode 100644 index 774a28665fe..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassAccessor1.es6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: ES2015 -// @module: ES2015 -// @experimentaldecorators: true -declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; - -export default class { - @dec get accessor() { return 1; } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.json deleted file mode 100644 index 72938b40ef5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.json +++ /dev/null @@ -1,360 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 72, - "end": 245, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 96, - "end": 107, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 96, - "end": 107, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 102, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 109, - "end": 128, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 109, - "end": 128, - "ctxt": 0 - }, - "value": "propertyKey", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 128, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 130, - "end": 168, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 130, - "end": 168, - "ctxt": 0 - }, - "value": "descriptor", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 168, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 142, - "end": 168, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 142, - "end": 165, - "ctxt": 0 - }, - "value": "TypedPropertyDescriptor", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 165, - "end": 168, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 72, - "end": 198, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 92, - "end": 95, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 93, - "end": 94, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 93, - "end": 94, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 171, - "end": 197, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 171, - "end": 194, - "ctxt": 0 - }, - "value": "TypedPropertyDescriptor", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 200, - "end": 245, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 215, - "end": 245, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 227, - "end": 243, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 228, - "end": 231, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "span": { - "start": 227, - "end": 243, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 241, - "end": 243, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.ts deleted file mode 100644 index 2e63e27086c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethod1.es6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: ES2015 -// @module: ES2015 -// @experimentaldecorators: true -declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; - -export default class { - @dec method() {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.json deleted file mode 100644 index 8c9823adeab..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 72, - "end": 225, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 93, - "end": 107, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 93, - "end": 107, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 109, - "end": 137, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 109, - "end": 137, - "ctxt": 0 - }, - "value": "propertyKey", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 137, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 122, - "end": 137, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 131, - "end": 137, - "ctxt": 0 - }, - "kind": "symbol" - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 139, - "end": 161, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 139, - "end": 161, - "ctxt": 0 - }, - "value": "parameterIndex", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 72, - "end": 169, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 162, - "end": 168, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 164, - "end": 168, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 171, - "end": 225, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 186, - "end": 225, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 198, - "end": 223, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 205, - "end": 219, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 205, - "end": 209, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "pat": { - "type": "Identifier", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 198, - "end": 223, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 221, - "end": 223, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.ts deleted file mode 100644 index 344f49c89f9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassMethodParameter1.es6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: ES2015 -// @module: ES2015 -// @experimentaldecorators: true -declare function dec(target: Object, propertyKey: string | symbol, parameterIndex: number): void; - -export default class { - method(@dec p: number) {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.json b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.json deleted file mode 100644 index 6f341c4d69e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.json +++ /dev/null @@ -1,199 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 72, - "end": 174, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 93, - "end": 104, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 93, - "end": 104, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 106, - "end": 125, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 106, - "end": 125, - "ctxt": 0 - }, - "value": "propertyKey", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 72, - "end": 133, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 126, - "end": 132, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 128, - "end": 132, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 135, - "end": 174, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 150, - "end": 174, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 162, - "end": 172, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 167, - "end": 171, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 162, - "end": 166, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 163, - "end": 166, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.ts b/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.ts deleted file mode 100644 index 4f54960d2bc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decoratorOnClassProperty1.es6.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @target: ES2015 -// @module: ES2015 -// @experimentaldecorators: true -declare function dec(target: any, propertyKey: string): void; - -export default class { - @dec prop; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.json deleted file mode 100644 index 833c5f294ca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.json +++ /dev/null @@ -1,2960 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 28, - "end": 1520, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 28, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 36, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 43, - "end": 70, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 47, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 47, - "end": 51, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 53, - "end": 58, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 61, - "end": 69, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 62, - "end": 64, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 66, - "end": 68, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 72, - "end": 89, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 76, - "end": 89, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 89, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 81, - "end": 89, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 84, - "end": 89, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 87, - "end": 89, - "ctxt": 0 - }, - "members": [] - } - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 90, - "end": 125, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 94, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 98, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 101, - "end": 124, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 103, - "end": 104, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 106, - "end": 108, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 113, - "end": 122, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 126, - "end": 174, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 146, - "end": 174, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 152, - "end": 158, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 175, - "end": 268, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 189, - "end": 203, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 197, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 199, - "end": 202, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 208, - "end": 266, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 215, - "end": 218, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 208, - "end": 266, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 226, - "end": 266, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 240, - "end": 241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 240, - "end": 241, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 251, - "end": 260, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 258, - "end": 259, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 220, - "end": 225, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 222, - "end": 225, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 269, - "end": 304, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 278, - "end": 304, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 284, - "end": 302, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 291, - "end": 302, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 295, - "end": 296, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 305, - "end": 324, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 309, - "end": 323, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 309, - "end": 313, - "ctxt": 0 - }, - "value": "objA", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 316, - "end": 323, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 342, - "end": 371, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 346, - "end": 370, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 346, - "end": 361, - "ctxt": 0 - }, - "value": "ResultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 372, - "end": 398, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 376, - "end": 397, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 376, - "end": 391, - "ctxt": 0 - }, - "value": "ResultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 396, - "end": 397, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 399, - "end": 425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 403, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 403, - "end": 418, - "ctxt": 0 - }, - "value": "ResultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 423, - "end": 424, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 426, - "end": 454, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 453, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 445, - "ctxt": 0 - }, - "value": "ResultIsNumber4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 448, - "end": 453, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 450, - "end": 453, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 455, - "end": 484, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 459, - "end": 483, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 459, - "end": 474, - "ctxt": 0 - }, - "value": "ResultIsNumber5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 477, - "end": 483, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 479, - "end": 483, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 486, - "end": 515, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 490, - "end": 514, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 490, - "end": 505, - "ctxt": 0 - }, - "value": "ResultIsNumber6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 508, - "end": 512, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 516, - "end": 542, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 520, - "end": 541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 520, - "end": 535, - "ctxt": 0 - }, - "value": "ResultIsNumber7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 538, - "end": 541, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 543, - "end": 569, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 547, - "end": 568, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 547, - "end": 562, - "ctxt": 0 - }, - "value": "ResultIsNumber8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 565, - "end": 568, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 565, - "end": 566, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 570, - "end": 598, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 574, - "end": 597, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 574, - "end": 589, - "ctxt": 0 - }, - "value": "ResultIsNumber9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 592, - "end": 597, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 592, - "end": 595, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 599, - "end": 629, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 603, - "end": 628, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 603, - "end": 619, - "ctxt": 0 - }, - "value": "ResultIsNumber10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 622, - "end": 628, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 622, - "end": 626, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 651, - "end": 679, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 655, - "end": 678, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 655, - "end": 671, - "ctxt": 0 - }, - "value": "ResultIsNumber11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 674, - "end": 678, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 676, - "end": 678, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 680, - "end": 710, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 684, - "end": 709, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 684, - "end": 700, - "ctxt": 0 - }, - "value": "ResultIsNumber12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 703, - "end": 709, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "NullLiteral", - "span": { - "start": 705, - "end": 709, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 711, - "end": 746, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 715, - "end": 745, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 715, - "end": 731, - "ctxt": 0 - }, - "value": "ResultIsNumber13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 734, - "end": 745, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 736, - "end": 745, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 748, - "end": 778, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 752, - "end": 777, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 752, - "end": 768, - "ctxt": 0 - }, - "value": "ResultIsNumber14", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 771, - "end": 777, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "NullLiteral", - "span": { - "start": 771, - "end": 775, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 779, - "end": 807, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 783, - "end": 806, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 783, - "end": 799, - "ctxt": 0 - }, - "value": "ResultIsNumber15", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 802, - "end": 806, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 802, - "end": 804, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 808, - "end": 843, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 812, - "end": 842, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 812, - "end": 828, - "ctxt": 0 - }, - "value": "ResultIsNumber16", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 831, - "end": 842, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 831, - "end": 840, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 869, - "end": 900, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 873, - "end": 899, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 873, - "end": 889, - "ctxt": 0 - }, - "value": "ResultIsNumber17", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 892, - "end": 899, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "CallExpression", - "span": { - "start": 894, - "end": 899, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 894, - "end": 897, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 901, - "end": 934, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 905, - "end": 933, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 905, - "end": 921, - "ctxt": 0 - }, - "value": "ResultIsNumber18", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 924, - "end": 933, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "CallExpression", - "span": { - "start": 926, - "end": 933, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 926, - "end": 931, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 926, - "end": 927, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 928, - "end": 931, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 935, - "end": 979, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 939, - "end": 978, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 939, - "end": 955, - "ctxt": 0 - }, - "value": "ResultIsNumber19", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 958, - "end": 978, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 960, - "end": 978, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 961, - "end": 977, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 961, - "end": 965, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 968, - "end": 977, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 980, - "end": 1019, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 984, - "end": 1018, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 984, - "end": 1000, - "ctxt": 0 - }, - "value": "ResultIsNumber20", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1003, - "end": 1018, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1005, - "end": 1018, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1006, - "end": 1017, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1006, - "end": 1010, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1013, - "end": 1017, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1020, - "end": 1069, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1024, - "end": 1068, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1024, - "end": 1040, - "ctxt": 0 - }, - "value": "ResultIsNumber21", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1043, - "end": 1068, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1045, - "end": 1068, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1046, - "end": 1067, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1046, - "end": 1055, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1058, - "end": 1067, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1070, - "end": 1102, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1074, - "end": 1101, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1074, - "end": 1090, - "ctxt": 0 - }, - "value": "ResultIsNumber22", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1093, - "end": 1101, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1095, - "end": 1101, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1095, - "end": 1099, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1101, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1103, - "end": 1135, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1107, - "end": 1134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1107, - "end": 1123, - "ctxt": 0 - }, - "value": "ResultIsNumber23", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1126, - "end": 1134, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1128, - "end": 1134, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1128, - "end": 1132, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1133, - "end": 1134, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1137, - "end": 1168, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1141, - "end": 1167, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1141, - "end": 1157, - "ctxt": 0 - }, - "value": "ResultIsNumber24", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1160, - "end": 1167, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "CallExpression", - "span": { - "start": 1160, - "end": 1165, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1160, - "end": 1163, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1169, - "end": 1202, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1173, - "end": 1201, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1173, - "end": 1189, - "ctxt": 0 - }, - "value": "ResultIsNumber25", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1192, - "end": 1201, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "CallExpression", - "span": { - "start": 1192, - "end": 1199, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1192, - "end": 1197, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1192, - "end": 1193, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1194, - "end": 1197, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1203, - "end": 1247, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1207, - "end": 1246, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1207, - "end": 1223, - "ctxt": 0 - }, - "value": "ResultIsNumber26", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1226, - "end": 1246, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1226, - "end": 1244, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1227, - "end": 1243, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1227, - "end": 1231, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1234, - "end": 1243, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1248, - "end": 1287, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1252, - "end": 1286, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1252, - "end": 1268, - "ctxt": 0 - }, - "value": "ResultIsNumber27", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1271, - "end": 1286, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1271, - "end": 1284, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1272, - "end": 1283, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1272, - "end": 1276, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1279, - "end": 1283, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1288, - "end": 1337, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1292, - "end": 1336, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1292, - "end": 1308, - "ctxt": 0 - }, - "value": "ResultIsNumber28", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1311, - "end": 1336, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1311, - "end": 1334, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1312, - "end": 1333, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1312, - "end": 1321, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1324, - "end": 1333, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1338, - "end": 1370, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1342, - "end": 1369, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1342, - "end": 1358, - "ctxt": 0 - }, - "value": "ResultIsNumber29", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1361, - "end": 1369, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1361, - "end": 1367, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1361, - "end": 1365, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1366, - "end": 1367, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1371, - "end": 1403, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1375, - "end": 1402, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1375, - "end": 1391, - "ctxt": 0 - }, - "value": "ResultIsNumber30", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1394, - "end": 1402, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1394, - "end": 1400, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1394, - "end": 1398, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1399, - "end": 1400, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1434, - "end": 1441, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1434, - "end": 1440, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 1436, - "end": 1440, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1443, - "end": 1450, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1443, - "end": 1449, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1443, - "end": 1447, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1452, - "end": 1461, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1452, - "end": 1460, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1454, - "end": 1460, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1454, - "end": 1458, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1462, - "end": 1471, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1462, - "end": 1470, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1464, - "end": 1470, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1464, - "end": 1468, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1472, - "end": 1481, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1472, - "end": 1480, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1474, - "end": 1480, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1474, - "end": 1478, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1482, - "end": 1494, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1482, - "end": 1493, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1484, - "end": 1493, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1484, - "end": 1491, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1484, - "end": 1488, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1488, - "end": 1491, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1489, - "end": 1490, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1495, - "end": 1507, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1495, - "end": 1506, - "ctxt": 0 - }, - "operator": "--", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1497, - "end": 1506, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1497, - "end": 1504, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1497, - "end": 1501, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1501, - "end": 1504, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1502, - "end": 1503, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1508, - "end": 1520, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1508, - "end": 1519, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1510, - "end": 1519, - "ctxt": 0 - }, - "operator": "--", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1510, - "end": 1517, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1514, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1514, - "end": 1517, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1515, - "end": 1516, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.ts deleted file mode 100644 index d5dd62de442..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/decrementOperatorWithAnyOtherTypeInvalidOperations.ts +++ /dev/null @@ -1,72 +0,0 @@ -// -- operator on any type -var ANY1: any; -var ANY2: any[] = ["", ""]; - -var obj: () => {} -var obj1 = { x: "", y: () => { } }; -function foo(): any { - var a; - return a; -} -class A { - public a: any; - static foo(): any { - var a; - return a; - } -} -module M { - export var n: any; -} -var objA = new A(); - -// any type var -var ResultIsNumber1 = --ANY2; -var ResultIsNumber2 = --A; -var ResultIsNumber3 = --M; -var ResultIsNumber4 = --obj; -var ResultIsNumber5 = --obj1; - -var ResultIsNumber6 = ANY2--; -var ResultIsNumber7 = A--; -var ResultIsNumber8 = M--; -var ResultIsNumber9 = obj--; -var ResultIsNumber10 = obj1--; - -// any type literal -var ResultIsNumber11 = --{}; -var ResultIsNumber12 = --null; -var ResultIsNumber13 = --undefined; - -var ResultIsNumber14 = null--; -var ResultIsNumber15 = {}--; -var ResultIsNumber16 = undefined--; - -// any type expressions -var ResultIsNumber17 = --foo(); -var ResultIsNumber18 = --A.foo(); -var ResultIsNumber19 = --(null + undefined); -var ResultIsNumber20 = --(null + null); -var ResultIsNumber21 = --(undefined + undefined); -var ResultIsNumber22 = --obj1.x; -var ResultIsNumber23 = --obj1.y; - -var ResultIsNumber24 = foo()--; -var ResultIsNumber25 = A.foo()--; -var ResultIsNumber26 = (null + undefined)--; -var ResultIsNumber27 = (null + null)--; -var ResultIsNumber28 = (undefined + undefined)--; -var ResultIsNumber29 = obj1.x--; -var ResultIsNumber30 = obj1.y--; - -// miss assignment operators ---ANY2; - -ANY2--; - ---ANY1--; ---ANY1++; -++ANY1--; ---ANY2[0]--; ---ANY2[0]++; -++ANY2[0]--; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.json deleted file mode 100644 index 9aa086b48dc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 26, - "end": 291, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 97, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 88, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 82, - "ctxt": 0 - }, - "value": "BOOLEAN1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 85, - "end": 88, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 137, - "end": 160, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 141, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 141, - "end": 149, - "ctxt": 0 - }, - "value": "BOOLEAN2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 152, - "end": 158, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "Invalid", - "span": { - "start": 158, - "end": 158, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 196, - "end": 205, - "ctxt": 0 - }, - "value": "testADelx", - "optional": false - }, - "declare": false, - "span": { - "start": 190, - "end": 291, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 212, - "end": 289, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 223, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 224, - "end": 242, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 234, - "end": 242, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 240, - "end": 242, - "ctxt": 0 - }, - "members": [] - } - } - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 244, - "end": 289, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 254, - "end": 263, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 254, - "end": 262, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.ts deleted file mode 100644 index 20831d7cf02..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/deleteOperatorInvalidOperations.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Unary operator delete -var ANY; - -// operand before delete operator -var BOOLEAN1 = ANY delete ; //expect error - -// miss an operand -var BOOLEAN2 = delete ; - -// delete global variable s -class testADelx { - constructor(public s: () => {}) { - delete s; //expect error - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.json b/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.json index 8613add1af4..0e6743be5fb 100644 --- a/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.json +++ b/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 81, - "end": 7451, + "end": 8381, "ctxt": 0 }, "body": [ @@ -1218,19 +1218,779 @@ "typeParameters": null, "returnType": null }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 808, + "end": 811, + "ctxt": 0 + }, + "value": "f13", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 830, + "end": 850, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "ObjectPattern", + "span": { + "start": 830, + "end": 850, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 832, + "end": 836, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 832, + "end": 836, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "value": null + }, + { + "type": "AssignmentPatternProperty", + "span": { + "start": 838, + "end": 845, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 838, + "end": 845, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 847, + "end": 850, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 849, + "end": 850, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 849, + "end": 850, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 799, + "end": 973, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 852, + "end": 973, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 858, + "end": 910, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 862, + "end": 874, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 862, + "end": 866, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 871, + "end": 874, + "ctxt": 0 + }, + "value": "A", + "raw": "'A'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 876, + "end": 910, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 886, + "end": 904, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 886, + "end": 903, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 886, + "end": 901, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 886, + "end": 893, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 894, + "end": 901, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 915, + "end": 971, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 919, + "end": 931, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 919, + "end": 923, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 928, + "end": 931, + "ctxt": 0 + }, + "value": "B", + "raw": "'B'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 933, + "end": 971, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 943, + "end": 965, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 943, + "end": 964, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 943, + "end": 962, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 943, + "end": 950, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 951, + "end": 962, + "ctxt": 0 + }, + "value": "toUpperCase", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 811, + "end": 829, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 812, + "end": 828, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 812, + "end": 813, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 822, + "end": 828, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 822, + "end": 828, + "ctxt": 0 + }, + "value": "Action", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 984, + "end": 987, + "ctxt": 0 + }, + "value": "f14", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1006, + "end": 1010, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1006, + "end": 1010, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1007, + "end": 1010, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1009, + "end": 1010, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1009, + "end": 1010, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 975, + "end": 1166, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1012, + "end": 1166, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1018, + "end": 1046, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1024, + "end": 1045, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1024, + "end": 1041, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1026, + "end": 1030, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1026, + "end": 1030, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "value": null + }, + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1032, + "end": 1039, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1032, + "end": 1039, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1044, + "end": 1045, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "IfStatement", + "span": { + "start": 1051, + "end": 1103, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1055, + "end": 1067, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 1055, + "end": 1059, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1064, + "end": 1067, + "ctxt": 0 + }, + "value": "A", + "raw": "'A'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1069, + "end": 1103, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1079, + "end": 1097, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1079, + "end": 1096, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1079, + "end": 1094, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1079, + "end": 1086, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1087, + "end": 1094, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 1108, + "end": 1164, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1112, + "end": 1124, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 1112, + "end": 1116, + "ctxt": 0 + }, + "value": "kind", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1121, + "end": 1124, + "ctxt": 0 + }, + "value": "B", + "raw": "'B'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1126, + "end": 1164, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1136, + "end": 1158, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1136, + "end": 1157, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1136, + "end": 1155, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1136, + "end": 1143, + "ctxt": 0 + }, + "value": "payload", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1144, + "end": 1155, + "ctxt": 0 + }, + "value": "toUpperCase", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 987, + "end": 1005, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 988, + "end": 1004, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 988, + "end": 989, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 998, + "end": 1004, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 998, + "end": 1004, + "ctxt": 0 + }, + "value": "Action", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "returnType": null + }, { "type": "TsTypeAliasDeclaration", "span": { - "start": 783, - "end": 896, + "start": 1168, + "end": 1281, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 788, - "end": 795, + "start": 1173, + "end": 1180, "ctxt": 0 }, "value": "Action2", @@ -1240,32 +2000,32 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 802, - "end": 895, + "start": 1187, + "end": 1280, "ctxt": 0 }, "types": [ { "type": "TsTypeLiteral", "span": { - "start": 804, - "end": 846, + "start": 1189, + "end": 1231, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 806, - "end": 816, + "start": 1191, + "end": 1201, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 806, - "end": 810, + "start": 1191, + "end": 1195, "ctxt": 0 }, "value": "kind", @@ -1278,22 +2038,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 810, - "end": 815, + "start": 1195, + "end": 1200, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 812, - "end": 815, + "start": 1197, + "end": 1200, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 812, - "end": 815, + "start": 1197, + "end": 1200, "ctxt": 0 }, "value": "A", @@ -1306,16 +2066,16 @@ { "type": "TsPropertySignature", "span": { - "start": 817, - "end": 844, + "start": 1202, + "end": 1229, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 817, - "end": 824, + "start": 1202, + "end": 1209, "ctxt": 0 }, "value": "payload", @@ -1328,23 +2088,23 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 824, - "end": 844, + "start": 1209, + "end": 1229, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 826, - "end": 844, + "start": 1211, + "end": 1229, "ctxt": 0 }, "types": [ { "type": "TsKeywordType", "span": { - "start": 826, - "end": 832, + "start": 1211, + "end": 1217, "ctxt": 0 }, "kind": "number" @@ -1352,8 +2112,8 @@ { "type": "TsKeywordType", "span": { - "start": 835, - "end": 844, + "start": 1220, + "end": 1229, "ctxt": 0 }, "kind": "undefined" @@ -1368,24 +2128,24 @@ { "type": "TsTypeLiteral", "span": { - "start": 853, - "end": 895, + "start": 1238, + "end": 1280, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 855, - "end": 865, + "start": 1240, + "end": 1250, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 855, - "end": 859, + "start": 1240, + "end": 1244, "ctxt": 0 }, "value": "kind", @@ -1398,22 +2158,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 859, - "end": 864, + "start": 1244, + "end": 1249, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 861, - "end": 864, + "start": 1246, + "end": 1249, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 861, - "end": 864, + "start": 1246, + "end": 1249, "ctxt": 0 }, "value": "B", @@ -1426,16 +2186,16 @@ { "type": "TsPropertySignature", "span": { - "start": 866, - "end": 893, + "start": 1251, + "end": 1278, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 866, - "end": 873, + "start": 1251, + "end": 1258, "ctxt": 0 }, "value": "payload", @@ -1448,23 +2208,23 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 873, - "end": 893, + "start": 1258, + "end": 1278, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 875, - "end": 893, + "start": 1260, + "end": 1278, "ctxt": 0 }, "types": [ { "type": "TsKeywordType", "span": { - "start": 875, - "end": 881, + "start": 1260, + "end": 1266, "ctxt": 0 }, "kind": "string" @@ -1472,8 +2232,8 @@ { "type": "TsKeywordType", "span": { - "start": 884, - "end": 893, + "start": 1269, + "end": 1278, "ctxt": 0 }, "kind": "undefined" @@ -1493,8 +2253,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 907, - "end": 910, + "start": 1292, + "end": 1295, "ctxt": 0 }, "value": "f20", @@ -1505,31 +2265,31 @@ { "type": "Parameter", "span": { - "start": 911, - "end": 937, + "start": 1296, + "end": 1322, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 911, - "end": 937, + "start": 1296, + "end": 1322, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 913, - "end": 917, + "start": 1298, + "end": 1302, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 913, - "end": 917, + "start": 1298, + "end": 1302, "ctxt": 0 }, "value": "kind", @@ -1540,15 +2300,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 919, - "end": 926, + "start": 1304, + "end": 1311, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 919, - "end": 926, + "start": 1304, + "end": 1311, "ctxt": 0 }, "value": "payload", @@ -1561,22 +2321,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 928, - "end": 937, + "start": 1313, + "end": 1322, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 930, - "end": 937, + "start": 1315, + "end": 1322, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 930, - "end": 937, + "start": 1315, + "end": 1322, "ctxt": 0 }, "value": "Action2", @@ -1590,30 +2350,30 @@ ], "decorators": [], "span": { - "start": 898, - "end": 1109, + "start": 1283, + "end": 1494, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 939, - "end": 1109, + "start": 1324, + "end": 1494, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 945, - "end": 1107, + "start": 1330, + "end": 1492, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 949, - "end": 956, + "start": 1334, + "end": 1341, "ctxt": 0 }, "value": "payload", @@ -1622,31 +2382,31 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 958, - "end": 1107, + "start": 1343, + "end": 1492, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 968, - "end": 1028, + "start": 1353, + "end": 1413, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 972, - "end": 984, + "start": 1357, + "end": 1369, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 972, - "end": 976, + "start": 1357, + "end": 1361, "ctxt": 0 }, "value": "kind", @@ -1655,8 +2415,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 981, - "end": 984, + "start": 1366, + "end": 1369, "ctxt": 0 }, "value": "A", @@ -1666,37 +2426,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 986, - "end": 1028, + "start": 1371, + "end": 1413, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1000, - "end": 1018, + "start": 1385, + "end": 1403, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1000, - "end": 1017, + "start": 1385, + "end": 1402, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1000, - "end": 1015, + "start": 1385, + "end": 1400, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1000, - "end": 1007, + "start": 1385, + "end": 1392, "ctxt": 0 }, "value": "payload", @@ -1705,8 +2465,8 @@ "property": { "type": "Identifier", "span": { - "start": 1008, - "end": 1015, + "start": 1393, + "end": 1400, "ctxt": 0 }, "value": "toFixed", @@ -1724,23 +2484,23 @@ { "type": "IfStatement", "span": { - "start": 1037, - "end": 1101, + "start": 1422, + "end": 1486, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 1041, - "end": 1053, + "start": 1426, + "end": 1438, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 1041, - "end": 1045, + "start": 1426, + "end": 1430, "ctxt": 0 }, "value": "kind", @@ -1749,8 +2509,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 1050, - "end": 1053, + "start": 1435, + "end": 1438, "ctxt": 0 }, "value": "B", @@ -1760,37 +2520,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1055, - "end": 1101, + "start": 1440, + "end": 1486, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1069, - "end": 1091, + "start": 1454, + "end": 1476, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1069, - "end": 1090, + "start": 1454, + "end": 1475, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1069, - "end": 1088, + "start": 1454, + "end": 1473, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1069, - "end": 1076, + "start": 1454, + "end": 1461, "ctxt": 0 }, "value": "payload", @@ -1799,8 +2559,8 @@ "property": { "type": "Identifier", "span": { - "start": 1077, - "end": 1088, + "start": 1462, + "end": 1473, "ctxt": 0 }, "value": "toUpperCase", @@ -1831,8 +2591,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 1120, - "end": 1123, + "start": 1505, + "end": 1508, "ctxt": 0 }, "value": "f21", @@ -1843,16 +2603,16 @@ { "type": "Parameter", "span": { - "start": 1124, - "end": 1139, + "start": 1509, + "end": 1524, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 1124, - "end": 1139, + "start": 1509, + "end": 1524, "ctxt": 0 }, "value": "action", @@ -1860,22 +2620,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1130, - "end": 1139, + "start": 1515, + "end": 1524, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 1132, - "end": 1139, + "start": 1517, + "end": 1524, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 1132, - "end": 1139, + "start": 1517, + "end": 1524, "ctxt": 0 }, "value": "Action2", @@ -1889,23 +2649,23 @@ ], "decorators": [], "span": { - "start": 1111, - "end": 1349, + "start": 1496, + "end": 1734, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 1141, - "end": 1349, + "start": 1526, + "end": 1734, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 1147, - "end": 1180, + "start": 1532, + "end": 1565, "ctxt": 0 }, "kind": "const", @@ -1914,30 +2674,30 @@ { "type": "VariableDeclarator", "span": { - "start": 1153, - "end": 1179, + "start": 1538, + "end": 1564, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 1153, - "end": 1170, + "start": 1538, + "end": 1555, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1155, - "end": 1159, + "start": 1540, + "end": 1544, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1155, - "end": 1159, + "start": 1540, + "end": 1544, "ctxt": 0 }, "value": "kind", @@ -1948,15 +2708,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1161, - "end": 1168, + "start": 1546, + "end": 1553, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1161, - "end": 1168, + "start": 1546, + "end": 1553, "ctxt": 0 }, "value": "payload", @@ -1971,8 +2731,8 @@ "init": { "type": "Identifier", "span": { - "start": 1173, - "end": 1179, + "start": 1558, + "end": 1564, "ctxt": 0 }, "value": "action", @@ -1985,15 +2745,15 @@ { "type": "IfStatement", "span": { - "start": 1185, - "end": 1347, + "start": 1570, + "end": 1732, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 1189, - "end": 1196, + "start": 1574, + "end": 1581, "ctxt": 0 }, "value": "payload", @@ -2002,31 +2762,31 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1198, - "end": 1347, + "start": 1583, + "end": 1732, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 1208, - "end": 1268, + "start": 1593, + "end": 1653, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 1212, - "end": 1224, + "start": 1597, + "end": 1609, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 1212, - "end": 1216, + "start": 1597, + "end": 1601, "ctxt": 0 }, "value": "kind", @@ -2035,8 +2795,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 1221, - "end": 1224, + "start": 1606, + "end": 1609, "ctxt": 0 }, "value": "A", @@ -2046,37 +2806,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1226, - "end": 1268, + "start": 1611, + "end": 1653, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1240, - "end": 1258, + "start": 1625, + "end": 1643, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1240, - "end": 1257, + "start": 1625, + "end": 1642, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1240, - "end": 1255, + "start": 1625, + "end": 1640, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1240, - "end": 1247, + "start": 1625, + "end": 1632, "ctxt": 0 }, "value": "payload", @@ -2085,8 +2845,8 @@ "property": { "type": "Identifier", "span": { - "start": 1248, - "end": 1255, + "start": 1633, + "end": 1640, "ctxt": 0 }, "value": "toFixed", @@ -2104,23 +2864,23 @@ { "type": "IfStatement", "span": { - "start": 1277, - "end": 1341, + "start": 1662, + "end": 1726, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 1281, - "end": 1293, + "start": 1666, + "end": 1678, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 1281, - "end": 1285, + "start": 1666, + "end": 1670, "ctxt": 0 }, "value": "kind", @@ -2129,8 +2889,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 1290, - "end": 1293, + "start": 1675, + "end": 1678, "ctxt": 0 }, "value": "B", @@ -2140,37 +2900,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1295, - "end": 1341, + "start": 1680, + "end": 1726, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1309, - "end": 1331, + "start": 1694, + "end": 1716, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1309, - "end": 1330, + "start": 1694, + "end": 1715, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1309, - "end": 1328, + "start": 1694, + "end": 1713, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1309, - "end": 1316, + "start": 1694, + "end": 1701, "ctxt": 0 }, "value": "payload", @@ -2179,8 +2939,8 @@ "property": { "type": "Identifier", "span": { - "start": 1317, - "end": 1328, + "start": 1702, + "end": 1713, "ctxt": 0 }, "value": "toUpperCase", @@ -2211,8 +2971,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 1360, - "end": 1363, + "start": 1745, + "end": 1748, "ctxt": 0 }, "value": "f22", @@ -2223,16 +2983,16 @@ { "type": "Parameter", "span": { - "start": 1364, - "end": 1379, + "start": 1749, + "end": 1764, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 1364, - "end": 1379, + "start": 1749, + "end": 1764, "ctxt": 0 }, "value": "action", @@ -2240,22 +3000,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1370, - "end": 1379, + "start": 1755, + "end": 1764, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 1372, - "end": 1379, + "start": 1757, + "end": 1764, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 1372, - "end": 1379, + "start": 1757, + "end": 1764, "ctxt": 0 }, "value": "Action2", @@ -2269,37 +3029,37 @@ ], "decorators": [], "span": { - "start": 1351, - "end": 1600, + "start": 1736, + "end": 1985, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 1381, - "end": 1600, + "start": 1766, + "end": 1985, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 1387, - "end": 1598, + "start": 1772, + "end": 1983, "ctxt": 0 }, "test": { "type": "MemberExpression", "span": { - "start": 1391, - "end": 1405, + "start": 1776, + "end": 1790, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1391, - "end": 1397, + "start": 1776, + "end": 1782, "ctxt": 0 }, "value": "action", @@ -2308,8 +3068,8 @@ "property": { "type": "Identifier", "span": { - "start": 1398, - "end": 1405, + "start": 1783, + "end": 1790, "ctxt": 0 }, "value": "payload", @@ -2319,16 +3079,16 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1407, - "end": 1598, + "start": 1792, + "end": 1983, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 1417, - "end": 1450, + "start": 1802, + "end": 1835, "ctxt": 0 }, "kind": "const", @@ -2337,30 +3097,30 @@ { "type": "VariableDeclarator", "span": { - "start": 1423, - "end": 1449, + "start": 1808, + "end": 1834, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 1423, - "end": 1440, + "start": 1808, + "end": 1825, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1425, - "end": 1429, + "start": 1810, + "end": 1814, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1425, - "end": 1429, + "start": 1810, + "end": 1814, "ctxt": 0 }, "value": "kind", @@ -2371,15 +3131,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1431, - "end": 1438, + "start": 1816, + "end": 1823, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1431, - "end": 1438, + "start": 1816, + "end": 1823, "ctxt": 0 }, "value": "payload", @@ -2394,8 +3154,8 @@ "init": { "type": "Identifier", "span": { - "start": 1443, - "end": 1449, + "start": 1828, + "end": 1834, "ctxt": 0 }, "value": "action", @@ -2408,23 +3168,23 @@ { "type": "IfStatement", "span": { - "start": 1459, - "end": 1519, + "start": 1844, + "end": 1904, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 1463, - "end": 1475, + "start": 1848, + "end": 1860, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 1463, - "end": 1467, + "start": 1848, + "end": 1852, "ctxt": 0 }, "value": "kind", @@ -2433,8 +3193,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 1472, - "end": 1475, + "start": 1857, + "end": 1860, "ctxt": 0 }, "value": "A", @@ -2444,37 +3204,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1477, - "end": 1519, + "start": 1862, + "end": 1904, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1491, - "end": 1509, + "start": 1876, + "end": 1894, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1491, - "end": 1508, + "start": 1876, + "end": 1893, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1491, - "end": 1506, + "start": 1876, + "end": 1891, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1491, - "end": 1498, + "start": 1876, + "end": 1883, "ctxt": 0 }, "value": "payload", @@ -2483,8 +3243,8 @@ "property": { "type": "Identifier", "span": { - "start": 1499, - "end": 1506, + "start": 1884, + "end": 1891, "ctxt": 0 }, "value": "toFixed", @@ -2502,23 +3262,23 @@ { "type": "IfStatement", "span": { - "start": 1528, - "end": 1592, + "start": 1913, + "end": 1977, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 1532, - "end": 1544, + "start": 1917, + "end": 1929, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 1532, - "end": 1536, + "start": 1917, + "end": 1921, "ctxt": 0 }, "value": "kind", @@ -2527,8 +3287,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 1541, - "end": 1544, + "start": 1926, + "end": 1929, "ctxt": 0 }, "value": "B", @@ -2538,37 +3298,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1546, - "end": 1592, + "start": 1931, + "end": 1977, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 1560, - "end": 1582, + "start": 1945, + "end": 1967, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1560, - "end": 1581, + "start": 1945, + "end": 1966, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1560, - "end": 1579, + "start": 1945, + "end": 1964, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1560, - "end": 1567, + "start": 1945, + "end": 1952, "ctxt": 0 }, "value": "payload", @@ -2577,8 +3337,8 @@ "property": { "type": "Identifier", "span": { - "start": 1568, - "end": 1579, + "start": 1953, + "end": 1964, "ctxt": 0 }, "value": "toUpperCase", @@ -2609,8 +3369,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 1611, - "end": 1614, + "start": 1996, + "end": 1999, "ctxt": 0 }, "value": "f23", @@ -2621,31 +3381,31 @@ { "type": "Parameter", "span": { - "start": 1615, - "end": 1641, + "start": 2000, + "end": 2026, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 1615, - "end": 1641, + "start": 2000, + "end": 2026, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1617, - "end": 1621, + "start": 2002, + "end": 2006, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1617, - "end": 1621, + "start": 2002, + "end": 2006, "ctxt": 0 }, "value": "kind", @@ -2656,15 +3416,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1623, - "end": 1630, + "start": 2008, + "end": 2015, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1623, - "end": 1630, + "start": 2008, + "end": 2015, "ctxt": 0 }, "value": "payload", @@ -2677,22 +3437,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1632, - "end": 1641, + "start": 2017, + "end": 2026, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 1634, - "end": 1641, + "start": 2019, + "end": 2026, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 1634, - "end": 1641, + "start": 2019, + "end": 2026, "ctxt": 0 }, "value": "Action2", @@ -2706,30 +3466,30 @@ ], "decorators": [], "span": { - "start": 1602, - "end": 1925, + "start": 1987, + "end": 2310, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 1643, - "end": 1925, + "start": 2028, + "end": 2310, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 1649, - "end": 1923, + "start": 2034, + "end": 2308, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 1653, - "end": 1660, + "start": 2038, + "end": 2045, "ctxt": 0 }, "value": "payload", @@ -2738,23 +3498,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 1662, - "end": 1923, + "start": 2047, + "end": 2308, "ctxt": 0 }, "stmts": [ { "type": "SwitchStatement", "span": { - "start": 1672, - "end": 1917, + "start": 2057, + "end": 2302, "ctxt": 0 }, "discriminant": { "type": "Identifier", "span": { - "start": 1680, - "end": 1684, + "start": 2065, + "end": 2069, "ctxt": 0 }, "value": "kind", @@ -2764,15 +3524,15 @@ { "type": "SwitchCase", "span": { - "start": 1700, - "end": 1767, + "start": 2085, + "end": 2152, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 1705, - "end": 1708, + "start": 2090, + "end": 2093, "ctxt": 0 }, "value": "A", @@ -2782,29 +3542,29 @@ { "type": "ExpressionStatement", "span": { - "start": 1726, - "end": 1744, + "start": 2111, + "end": 2129, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1726, - "end": 1743, + "start": 2111, + "end": 2128, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1726, - "end": 1741, + "start": 2111, + "end": 2126, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1726, - "end": 1733, + "start": 2111, + "end": 2118, "ctxt": 0 }, "value": "payload", @@ -2813,8 +3573,8 @@ "property": { "type": "Identifier", "span": { - "start": 1734, - "end": 1741, + "start": 2119, + "end": 2126, "ctxt": 0 }, "value": "toFixed", @@ -2828,8 +3588,8 @@ { "type": "BreakStatement", "span": { - "start": 1761, - "end": 1767, + "start": 2146, + "end": 2152, "ctxt": 0 }, "label": null @@ -2839,15 +3599,15 @@ { "type": "SwitchCase", "span": { - "start": 1780, - "end": 1851, + "start": 2165, + "end": 2236, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 1785, - "end": 1788, + "start": 2170, + "end": 2173, "ctxt": 0 }, "value": "B", @@ -2857,29 +3617,29 @@ { "type": "ExpressionStatement", "span": { - "start": 1806, - "end": 1828, + "start": 2191, + "end": 2213, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 1806, - "end": 1827, + "start": 2191, + "end": 2212, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 1806, - "end": 1825, + "start": 2191, + "end": 2210, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 1806, - "end": 1813, + "start": 2191, + "end": 2198, "ctxt": 0 }, "value": "payload", @@ -2888,8 +3648,8 @@ "property": { "type": "Identifier", "span": { - "start": 1814, - "end": 1825, + "start": 2199, + "end": 2210, "ctxt": 0 }, "value": "toUpperCase", @@ -2903,8 +3663,8 @@ { "type": "BreakStatement", "span": { - "start": 1845, - "end": 1851, + "start": 2230, + "end": 2236, "ctxt": 0 }, "label": null @@ -2914,8 +3674,8 @@ { "type": "SwitchCase", "span": { - "start": 1864, - "end": 1897, + "start": 2249, + "end": 2282, "ctxt": 0 }, "test": null, @@ -2923,15 +3683,15 @@ { "type": "ExpressionStatement", "span": { - "start": 1889, - "end": 1897, + "start": 2274, + "end": 2282, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 1889, - "end": 1896, + "start": 2274, + "end": 2281, "ctxt": 0 }, "value": "payload", @@ -2956,16 +3716,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 1927, - "end": 2033, + "start": 2312, + "end": 2418, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 1932, - "end": 1935, + "start": 2317, + "end": 2320, "ctxt": 0 }, "value": "Foo", @@ -2975,32 +3735,32 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 1942, - "end": 2032, + "start": 2327, + "end": 2417, "ctxt": 0 }, "types": [ { "type": "TsTypeLiteral", "span": { - "start": 1944, - "end": 1968, + "start": 2329, + "end": 2353, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 1946, - "end": 1956, + "start": 2331, + "end": 2341, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 1946, - "end": 1950, + "start": 2331, + "end": 2335, "ctxt": 0 }, "value": "kind", @@ -3013,22 +3773,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1950, - "end": 1955, + "start": 2335, + "end": 2340, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 1952, - "end": 1955, + "start": 2337, + "end": 2340, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 1952, - "end": 1955, + "start": 2337, + "end": 2340, "ctxt": 0 }, "value": "A", @@ -3041,16 +3801,16 @@ { "type": "TsPropertySignature", "span": { - "start": 1957, - "end": 1966, + "start": 2342, + "end": 2351, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 1957, - "end": 1960, + "start": 2342, + "end": 2345, "ctxt": 0 }, "value": "isA", @@ -3063,22 +3823,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1960, - "end": 1966, + "start": 2345, + "end": 2351, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 1962, - "end": 1966, + "start": 2347, + "end": 2351, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 1962, - "end": 1966, + "start": 2347, + "end": 2351, "ctxt": 0 }, "value": true @@ -3092,24 +3852,24 @@ { "type": "TsTypeLiteral", "span": { - "start": 1975, - "end": 2000, + "start": 2360, + "end": 2385, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 1977, - "end": 1987, + "start": 2362, + "end": 2372, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 1977, - "end": 1981, + "start": 2362, + "end": 2366, "ctxt": 0 }, "value": "kind", @@ -3122,22 +3882,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1981, - "end": 1986, + "start": 2366, + "end": 2371, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 1983, - "end": 1986, + "start": 2368, + "end": 2371, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 1983, - "end": 1986, + "start": 2368, + "end": 2371, "ctxt": 0 }, "value": "B", @@ -3150,16 +3910,16 @@ { "type": "TsPropertySignature", "span": { - "start": 1988, - "end": 1998, + "start": 2373, + "end": 2383, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 1988, - "end": 1991, + "start": 2373, + "end": 2376, "ctxt": 0 }, "value": "isA", @@ -3172,22 +3932,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1991, - "end": 1998, + "start": 2376, + "end": 2383, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 1993, - "end": 1998, + "start": 2378, + "end": 2383, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 1993, - "end": 1998, + "start": 2378, + "end": 2383, "ctxt": 0 }, "value": false @@ -3201,24 +3961,24 @@ { "type": "TsTypeLiteral", "span": { - "start": 2007, - "end": 2032, + "start": 2392, + "end": 2417, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 2009, - "end": 2019, + "start": 2394, + "end": 2404, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2009, - "end": 2013, + "start": 2394, + "end": 2398, "ctxt": 0 }, "value": "kind", @@ -3231,22 +3991,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2013, - "end": 2018, + "start": 2398, + "end": 2403, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 2015, - "end": 2018, + "start": 2400, + "end": 2403, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 2015, - "end": 2018, + "start": 2400, + "end": 2403, "ctxt": 0 }, "value": "C", @@ -3259,16 +4019,16 @@ { "type": "TsPropertySignature", "span": { - "start": 2020, - "end": 2030, + "start": 2405, + "end": 2415, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2020, - "end": 2023, + "start": 2405, + "end": 2408, "ctxt": 0 }, "value": "isA", @@ -3281,22 +4041,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2023, - "end": 2030, + "start": 2408, + "end": 2415, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 2025, - "end": 2030, + "start": 2410, + "end": 2415, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 2025, - "end": 2030, + "start": 2410, + "end": 2415, "ctxt": 0 }, "value": false @@ -3315,8 +4075,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 2044, - "end": 2047, + "start": 2429, + "end": 2432, "ctxt": 0 }, "value": "f30", @@ -3327,31 +4087,31 @@ { "type": "Parameter", "span": { - "start": 2048, - "end": 2066, + "start": 2433, + "end": 2451, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 2048, - "end": 2066, + "start": 2433, + "end": 2451, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 2050, - "end": 2054, + "start": 2435, + "end": 2439, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2050, - "end": 2054, + "start": 2435, + "end": 2439, "ctxt": 0 }, "value": "kind", @@ -3362,15 +4122,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 2056, - "end": 2059, + "start": 2441, + "end": 2444, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2056, - "end": 2059, + "start": 2441, + "end": 2444, "ctxt": 0 }, "value": "isA", @@ -3383,22 +4143,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2061, - "end": 2066, + "start": 2446, + "end": 2451, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2063, - "end": 2066, + "start": 2448, + "end": 2451, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2063, - "end": 2066, + "start": 2448, + "end": 2451, "ctxt": 0 }, "value": "Foo", @@ -3412,38 +4172,38 @@ ], "decorators": [], "span": { - "start": 2035, - "end": 2320, + "start": 2420, + "end": 2705, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 2068, - "end": 2320, + "start": 2453, + "end": 2705, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 2074, - "end": 2122, + "start": 2459, + "end": 2507, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2078, - "end": 2090, + "start": 2463, + "end": 2475, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2078, - "end": 2082, + "start": 2463, + "end": 2467, "ctxt": 0 }, "value": "kind", @@ -3452,8 +4212,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2087, - "end": 2090, + "start": 2472, + "end": 2475, "ctxt": 0 }, "value": "A", @@ -3463,23 +4223,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2092, - "end": 2122, + "start": 2477, + "end": 2507, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2102, - "end": 2106, + "start": 2487, + "end": 2491, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 2102, - "end": 2105, + "start": 2487, + "end": 2490, "ctxt": 0 }, "value": "isA", @@ -3493,23 +4253,23 @@ { "type": "IfStatement", "span": { - "start": 2127, - "end": 2176, + "start": 2512, + "end": 2561, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2131, - "end": 2143, + "start": 2516, + "end": 2528, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2131, - "end": 2135, + "start": 2516, + "end": 2520, "ctxt": 0 }, "value": "kind", @@ -3518,8 +4278,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2140, - "end": 2143, + "start": 2525, + "end": 2528, "ctxt": 0 }, "value": "B", @@ -3529,23 +4289,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2145, - "end": 2176, + "start": 2530, + "end": 2561, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2155, - "end": 2159, + "start": 2540, + "end": 2544, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 2155, - "end": 2158, + "start": 2540, + "end": 2543, "ctxt": 0 }, "value": "isA", @@ -3559,23 +4319,23 @@ { "type": "IfStatement", "span": { - "start": 2181, - "end": 2230, + "start": 2566, + "end": 2615, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2185, - "end": 2197, + "start": 2570, + "end": 2582, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2185, - "end": 2189, + "start": 2570, + "end": 2574, "ctxt": 0 }, "value": "kind", @@ -3584,8 +4344,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2194, - "end": 2197, + "start": 2579, + "end": 2582, "ctxt": 0 }, "value": "C", @@ -3595,23 +4355,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2199, - "end": 2230, + "start": 2584, + "end": 2615, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2209, - "end": 2213, + "start": 2594, + "end": 2598, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 2209, - "end": 2212, + "start": 2594, + "end": 2597, "ctxt": 0 }, "value": "isA", @@ -3625,15 +4385,15 @@ { "type": "IfStatement", "span": { - "start": 2235, - "end": 2318, + "start": 2620, + "end": 2703, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 2239, - "end": 2242, + "start": 2624, + "end": 2627, "ctxt": 0 }, "value": "isA", @@ -3642,23 +4402,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2244, - "end": 2273, + "start": 2629, + "end": 2658, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2254, - "end": 2259, + "start": 2639, + "end": 2644, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 2254, - "end": 2258, + "start": 2639, + "end": 2643, "ctxt": 0 }, "value": "kind", @@ -3670,23 +4430,23 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 2283, - "end": 2318, + "start": 2668, + "end": 2703, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2293, - "end": 2298, + "start": 2678, + "end": 2683, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 2293, - "end": 2297, + "start": 2678, + "end": 2682, "ctxt": 0 }, "value": "kind", @@ -3706,16 +4466,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 2322, - "end": 2363, + "start": 2707, + "end": 2748, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 2327, - "end": 2331, + "start": 2712, + "end": 2716, "ctxt": 0 }, "value": "Args", @@ -3725,39 +4485,39 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 2334, - "end": 2363, + "start": 2719, + "end": 2748, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 2334, - "end": 2347, + "start": 2719, + "end": 2732, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 2335, - "end": 2338, + "start": 2720, + "end": 2723, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 2335, - "end": 2338, + "start": 2720, + "end": 2723, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 2335, - "end": 2338, + "start": 2720, + "end": 2723, "ctxt": 0 }, "value": "A", @@ -3768,16 +4528,16 @@ { "type": "TsTupleElement", "span": { - "start": 2340, - "end": 2346, + "start": 2725, + "end": 2731, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 2340, - "end": 2346, + "start": 2725, + "end": 2731, "ctxt": 0 }, "kind": "number" @@ -3788,31 +4548,31 @@ { "type": "TsTupleType", "span": { - "start": 2350, - "end": 2363, + "start": 2735, + "end": 2748, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 2351, - "end": 2354, + "start": 2736, + "end": 2739, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 2351, - "end": 2354, + "start": 2736, + "end": 2739, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 2351, - "end": 2354, + "start": 2736, + "end": 2739, "ctxt": 0 }, "value": "B", @@ -3823,16 +4583,16 @@ { "type": "TsTupleElement", "span": { - "start": 2356, - "end": 2362, + "start": 2741, + "end": 2747, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 2356, - "end": 2362, + "start": 2741, + "end": 2747, "ctxt": 0 }, "kind": "string" @@ -3848,8 +4608,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 2374, - "end": 2377, + "start": 2759, + "end": 2762, "ctxt": 0 }, "value": "f40", @@ -3860,36 +4620,36 @@ { "type": "Parameter", "span": { - "start": 2378, - "end": 2399, + "start": 2763, + "end": 2784, "ctxt": 0 }, "decorators": [], "pat": { "type": "RestElement", "span": { - "start": 2378, - "end": 2399, + "start": 2763, + "end": 2784, "ctxt": 0 }, "rest": { - "start": 2378, - "end": 2381, + "start": 2763, + "end": 2766, "ctxt": 0 }, "argument": { "type": "ArrayPattern", "span": { - "start": 2381, - "end": 2393, + "start": 2766, + "end": 2778, "ctxt": 0 }, "elements": [ { "type": "Identifier", "span": { - "start": 2382, - "end": 2386, + "start": 2767, + "end": 2771, "ctxt": 0 }, "value": "kind", @@ -3899,8 +4659,8 @@ { "type": "Identifier", "span": { - "start": 2388, - "end": 2392, + "start": 2773, + "end": 2777, "ctxt": 0 }, "value": "data", @@ -3914,22 +4674,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2393, - "end": 2399, + "start": 2778, + "end": 2784, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2395, - "end": 2399, + "start": 2780, + "end": 2784, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2395, - "end": 2399, + "start": 2780, + "end": 2784, "ctxt": 0 }, "value": "Args", @@ -3943,38 +4703,38 @@ ], "decorators": [], "span": { - "start": 2365, - "end": 2516, + "start": 2750, + "end": 2901, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 2401, - "end": 2516, + "start": 2786, + "end": 2901, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 2407, - "end": 2456, + "start": 2792, + "end": 2841, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2411, - "end": 2423, + "start": 2796, + "end": 2808, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2411, - "end": 2415, + "start": 2796, + "end": 2800, "ctxt": 0 }, "value": "kind", @@ -3983,8 +4743,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2420, - "end": 2423, + "start": 2805, + "end": 2808, "ctxt": 0 }, "value": "A", @@ -3994,37 +4754,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2425, - "end": 2456, + "start": 2810, + "end": 2841, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2435, - "end": 2450, + "start": 2820, + "end": 2835, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 2435, - "end": 2449, + "start": 2820, + "end": 2834, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 2435, - "end": 2447, + "start": 2820, + "end": 2832, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 2435, - "end": 2439, + "start": 2820, + "end": 2824, "ctxt": 0 }, "value": "data", @@ -4033,8 +4793,8 @@ "property": { "type": "Identifier", "span": { - "start": 2440, - "end": 2447, + "start": 2825, + "end": 2832, "ctxt": 0 }, "value": "toFixed", @@ -4052,23 +4812,23 @@ { "type": "IfStatement", "span": { - "start": 2461, - "end": 2514, + "start": 2846, + "end": 2899, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2465, - "end": 2477, + "start": 2850, + "end": 2862, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2465, - "end": 2469, + "start": 2850, + "end": 2854, "ctxt": 0 }, "value": "kind", @@ -4077,8 +4837,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2474, - "end": 2477, + "start": 2859, + "end": 2862, "ctxt": 0 }, "value": "B", @@ -4088,37 +4848,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2479, - "end": 2514, + "start": 2864, + "end": 2899, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2489, - "end": 2508, + "start": 2874, + "end": 2893, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 2489, - "end": 2507, + "start": 2874, + "end": 2892, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 2489, - "end": 2505, + "start": 2874, + "end": 2890, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 2489, - "end": 2493, + "start": 2874, + "end": 2878, "ctxt": 0 }, "value": "data", @@ -4127,8 +4887,8 @@ "property": { "type": "Identifier", "span": { - "start": 2494, - "end": 2505, + "start": 2879, + "end": 2890, "ctxt": 0 }, "value": "toUpperCase", @@ -4153,15 +4913,15 @@ { "type": "TsInterfaceDeclaration", "span": { - "start": 2540, - "end": 2581, + "start": 2925, + "end": 2966, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 2550, - "end": 2551, + "start": 2935, + "end": 2936, "ctxt": 0 }, "value": "A", @@ -4171,23 +4931,23 @@ "typeParams": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2551, - "end": 2554, + "start": 2936, + "end": 2939, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2552, - "end": 2553, + "start": 2937, + "end": 2938, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2552, - "end": 2553, + "start": 2937, + "end": 2938, "ctxt": 0 }, "value": "T", @@ -4205,24 +4965,24 @@ "body": { "type": "TsInterfaceBody", "span": { - "start": 2555, - "end": 2581, + "start": 2940, + "end": 2966, "ctxt": 0 }, "body": [ { "type": "TsPropertySignature", "span": { - "start": 2557, - "end": 2570, + "start": 2942, + "end": 2955, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2557, - "end": 2564, + "start": 2942, + "end": 2949, "ctxt": 0 }, "value": "variant", @@ -4235,22 +4995,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2564, - "end": 2569, + "start": 2949, + "end": 2954, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 2566, - "end": 2569, + "start": 2951, + "end": 2954, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 2566, - "end": 2569, + "start": 2951, + "end": 2954, "ctxt": 0 }, "value": "a", @@ -4263,16 +5023,16 @@ { "type": "TsPropertySignature", "span": { - "start": 2571, - "end": 2579, + "start": 2956, + "end": 2964, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2571, - "end": 2576, + "start": 2956, + "end": 2961, "ctxt": 0 }, "value": "value", @@ -4285,22 +5045,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2576, - "end": 2579, + "start": 2961, + "end": 2964, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2578, - "end": 2579, + "start": 2963, + "end": 2964, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2578, - "end": 2579, + "start": 2963, + "end": 2964, "ctxt": 0 }, "value": "T", @@ -4317,15 +5077,15 @@ { "type": "TsInterfaceDeclaration", "span": { - "start": 2583, - "end": 2631, + "start": 2968, + "end": 3016, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 2593, - "end": 2594, + "start": 2978, + "end": 2979, "ctxt": 0 }, "value": "B", @@ -4335,23 +5095,23 @@ "typeParams": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2594, - "end": 2597, + "start": 2979, + "end": 2982, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2595, - "end": 2596, + "start": 2980, + "end": 2981, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2595, - "end": 2596, + "start": 2980, + "end": 2981, "ctxt": 0 }, "value": "T", @@ -4369,24 +5129,24 @@ "body": { "type": "TsInterfaceBody", "span": { - "start": 2598, - "end": 2631, + "start": 2983, + "end": 3016, "ctxt": 0 }, "body": [ { "type": "TsPropertySignature", "span": { - "start": 2600, - "end": 2613, + "start": 2985, + "end": 2998, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2600, - "end": 2607, + "start": 2985, + "end": 2992, "ctxt": 0 }, "value": "variant", @@ -4399,22 +5159,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2607, - "end": 2612, + "start": 2992, + "end": 2997, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 2609, - "end": 2612, + "start": 2994, + "end": 2997, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 2609, - "end": 2612, + "start": 2994, + "end": 2997, "ctxt": 0 }, "value": "b", @@ -4427,16 +5187,16 @@ { "type": "TsPropertySignature", "span": { - "start": 2614, - "end": 2629, + "start": 2999, + "end": 3014, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2614, - "end": 2619, + "start": 2999, + "end": 3004, "ctxt": 0 }, "value": "value", @@ -4449,22 +5209,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2619, - "end": 2629, + "start": 3004, + "end": 3014, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2621, - "end": 2629, + "start": 3006, + "end": 3014, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2621, - "end": 2626, + "start": 3006, + "end": 3011, "ctxt": 0 }, "value": "Array", @@ -4473,23 +5233,23 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2626, - "end": 2629, + "start": 3011, + "end": 3014, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2627, - "end": 2628, + "start": 3012, + "end": 3013, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2627, - "end": 2628, + "start": 3012, + "end": 3013, "ctxt": 0 }, "value": "T", @@ -4509,16 +5269,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 2633, - "end": 2658, + "start": 3018, + "end": 3043, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 2638, - "end": 2640, + "start": 3023, + "end": 3025, "ctxt": 0 }, "value": "AB", @@ -4527,23 +5287,23 @@ "typeParams": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2640, - "end": 2643, + "start": 3025, + "end": 3028, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2641, - "end": 2642, + "start": 3026, + "end": 3027, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2641, - "end": 2642, + "start": 3026, + "end": 3027, "ctxt": 0 }, "value": "T", @@ -4560,23 +5320,23 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 2646, - "end": 2657, + "start": 3031, + "end": 3042, "ctxt": 0 }, "types": [ { "type": "TsTypeReference", "span": { - "start": 2646, - "end": 2650, + "start": 3031, + "end": 3035, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2646, - "end": 2647, + "start": 3031, + "end": 3032, "ctxt": 0 }, "value": "A", @@ -4585,23 +5345,23 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2647, - "end": 2650, + "start": 3032, + "end": 3035, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2648, - "end": 2649, + "start": 3033, + "end": 3034, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2648, - "end": 2649, + "start": 3033, + "end": 3034, "ctxt": 0 }, "value": "T", @@ -4615,15 +5375,15 @@ { "type": "TsTypeReference", "span": { - "start": 2653, - "end": 2657, + "start": 3038, + "end": 3042, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2653, - "end": 2654, + "start": 3038, + "end": 3039, "ctxt": 0 }, "value": "B", @@ -4632,23 +5392,23 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2654, - "end": 2657, + "start": 3039, + "end": 3042, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2655, - "end": 2656, + "start": 3040, + "end": 3041, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2655, - "end": 2656, + "start": 3040, + "end": 3041, "ctxt": 0 }, "value": "T", @@ -4667,8 +5427,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 2677, - "end": 2687, + "start": 3062, + "end": 3072, "ctxt": 0 }, "value": "printValue", @@ -4679,16 +5439,16 @@ { "type": "Parameter", "span": { - "start": 2691, - "end": 2695, + "start": 3076, + "end": 3080, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 2691, - "end": 2695, + "start": 3076, + "end": 3080, "ctxt": 0 }, "value": "t", @@ -4696,22 +5456,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2692, - "end": 2695, + "start": 3077, + "end": 3080, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2694, - "end": 2695, + "start": 3079, + "end": 3080, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2694, - "end": 2695, + "start": 3079, + "end": 3080, "ctxt": 0 }, "value": "T", @@ -4725,8 +5485,8 @@ ], "decorators": [], "span": { - "start": 2660, - "end": 2703, + "start": 3045, + "end": 3088, "ctxt": 0 }, "body": null, @@ -4735,23 +5495,23 @@ "typeParameters": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2687, - "end": 2690, + "start": 3072, + "end": 3075, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2688, - "end": 2689, + "start": 3073, + "end": 3074, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2688, - "end": 2689, + "start": 3073, + "end": 3074, "ctxt": 0 }, "value": "T", @@ -4768,15 +5528,15 @@ "returnType": { "type": "TsTypeAnnotation", "span": { - "start": 2696, - "end": 2702, + "start": 3081, + "end": 3087, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 2698, - "end": 2702, + "start": 3083, + "end": 3087, "ctxt": 0 }, "kind": "void" @@ -4788,8 +5548,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 2722, - "end": 2736, + "start": 3107, + "end": 3121, "ctxt": 0 }, "value": "printValueList", @@ -4800,16 +5560,16 @@ { "type": "Parameter", "span": { - "start": 2740, - "end": 2751, + "start": 3125, + "end": 3136, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 2740, - "end": 2751, + "start": 3125, + "end": 3136, "ctxt": 0 }, "value": "t", @@ -4817,22 +5577,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2741, - "end": 2751, + "start": 3126, + "end": 3136, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2743, - "end": 2751, + "start": 3128, + "end": 3136, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2743, - "end": 2748, + "start": 3128, + "end": 3133, "ctxt": 0 }, "value": "Array", @@ -4841,23 +5601,23 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2748, - "end": 2751, + "start": 3133, + "end": 3136, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2749, - "end": 2750, + "start": 3134, + "end": 3135, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2749, - "end": 2750, + "start": 3134, + "end": 3135, "ctxt": 0 }, "value": "T", @@ -4874,8 +5634,8 @@ ], "decorators": [], "span": { - "start": 2705, - "end": 2759, + "start": 3090, + "end": 3144, "ctxt": 0 }, "body": null, @@ -4884,23 +5644,23 @@ "typeParameters": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2736, - "end": 2739, + "start": 3121, + "end": 3124, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2737, - "end": 2738, + "start": 3122, + "end": 3123, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2737, - "end": 2738, + "start": 3122, + "end": 3123, "ctxt": 0 }, "value": "T", @@ -4917,15 +5677,15 @@ "returnType": { "type": "TsTypeAnnotation", "span": { - "start": 2752, - "end": 2758, + "start": 3137, + "end": 3143, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 2754, - "end": 2758, + "start": 3139, + "end": 3143, "ctxt": 0 }, "kind": "void" @@ -4937,8 +5697,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 2770, - "end": 2780, + "start": 3155, + "end": 3165, "ctxt": 0 }, "value": "unrefined1", @@ -4949,16 +5709,16 @@ { "type": "Parameter", "span": { - "start": 2784, - "end": 2793, + "start": 3169, + "end": 3178, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 2784, - "end": 2793, + "start": 3169, + "end": 3178, "ctxt": 0 }, "value": "ab", @@ -4966,22 +5726,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 2786, - "end": 2793, + "start": 3171, + "end": 3178, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 2788, - "end": 2793, + "start": 3173, + "end": 3178, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2788, - "end": 2790, + "start": 3173, + "end": 3175, "ctxt": 0 }, "value": "AB", @@ -4990,23 +5750,23 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2790, - "end": 2793, + "start": 3175, + "end": 3178, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2791, - "end": 2792, + "start": 3176, + "end": 3177, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2791, - "end": 2792, + "start": 3176, + "end": 3177, "ctxt": 0 }, "value": "T", @@ -5023,23 +5783,23 @@ ], "decorators": [], "span": { - "start": 2761, - "end": 2953, + "start": 3146, + "end": 3338, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 2801, - "end": 2953, + "start": 3186, + "end": 3338, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 2807, - "end": 2837, + "start": 3192, + "end": 3222, "ctxt": 0 }, "kind": "const", @@ -5048,30 +5808,30 @@ { "type": "VariableDeclarator", "span": { - "start": 2813, - "end": 2836, + "start": 3198, + "end": 3221, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 2813, - "end": 2831, + "start": 3198, + "end": 3216, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 2815, - "end": 2822, + "start": 3200, + "end": 3207, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2815, - "end": 2822, + "start": 3200, + "end": 3207, "ctxt": 0 }, "value": "variant", @@ -5082,15 +5842,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 2824, - "end": 2829, + "start": 3209, + "end": 3214, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2824, - "end": 2829, + "start": 3209, + "end": 3214, "ctxt": 0 }, "value": "value", @@ -5105,8 +5865,8 @@ "init": { "type": "Identifier", "span": { - "start": 2834, - "end": 2836, + "start": 3219, + "end": 3221, "ctxt": 0 }, "value": "ab", @@ -5119,23 +5879,23 @@ { "type": "IfStatement", "span": { - "start": 2842, - "end": 2951, + "start": 3227, + "end": 3336, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 2846, - "end": 2861, + "start": 3231, + "end": 3246, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 2846, - "end": 2853, + "start": 3231, + "end": 3238, "ctxt": 0 }, "value": "variant", @@ -5144,8 +5904,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 2858, - "end": 2861, + "start": 3243, + "end": 3246, "ctxt": 0 }, "value": "a", @@ -5155,30 +5915,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 2863, - "end": 2900, + "start": 3248, + "end": 3285, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2873, - "end": 2894, + "start": 3258, + "end": 3279, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 2873, - "end": 2893, + "start": 3258, + "end": 3278, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 2873, - "end": 2883, + "start": 3258, + "end": 3268, "ctxt": 0 }, "value": "printValue", @@ -5190,8 +5950,8 @@ "expression": { "type": "Identifier", "span": { - "start": 2887, - "end": 2892, + "start": 3272, + "end": 3277, "ctxt": 0 }, "value": "value", @@ -5202,23 +5962,23 @@ "typeArguments": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2883, - "end": 2886, + "start": 3268, + "end": 3271, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2884, - "end": 2885, + "start": 3269, + "end": 3270, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2884, - "end": 2885, + "start": 3269, + "end": 3270, "ctxt": 0 }, "value": "T", @@ -5235,30 +5995,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 2910, - "end": 2951, + "start": 3295, + "end": 3336, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2920, - "end": 2945, + "start": 3305, + "end": 3330, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 2920, - "end": 2944, + "start": 3305, + "end": 3329, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 2920, - "end": 2934, + "start": 3305, + "end": 3319, "ctxt": 0 }, "value": "printValueList", @@ -5270,8 +6030,8 @@ "expression": { "type": "Identifier", "span": { - "start": 2938, - "end": 2943, + "start": 3323, + "end": 3328, "ctxt": 0 }, "value": "value", @@ -5282,23 +6042,23 @@ "typeArguments": { "type": "TsTypeParameterInstantiation", "span": { - "start": 2934, - "end": 2937, + "start": 3319, + "end": 3322, "ctxt": 0 }, "params": [ { "type": "TsTypeReference", "span": { - "start": 2935, - "end": 2936, + "start": 3320, + "end": 3321, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 2935, - "end": 2936, + "start": 3320, + "end": 3321, "ctxt": 0 }, "value": "T", @@ -5320,23 +6080,23 @@ "typeParameters": { "type": "TsTypeParameterDeclaration", "span": { - "start": 2780, - "end": 2783, + "start": 3165, + "end": 3168, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 2781, - "end": 2782, + "start": 3166, + "end": 3167, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 2781, - "end": 2782, + "start": 3166, + "end": 3167, "ctxt": 0 }, "value": "T", @@ -5353,15 +6113,15 @@ "returnType": { "type": "TsTypeAnnotation", "span": { - "start": 2794, - "end": 2800, + "start": 3179, + "end": 3185, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 2796, - "end": 2800, + "start": 3181, + "end": 3185, "ctxt": 0 }, "kind": "void" @@ -5371,16 +6131,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 2977, - "end": 3096, + "start": 3362, + "end": 3481, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 2982, - "end": 2989, + "start": 3367, + "end": 3374, "ctxt": 0 }, "value": "Action3", @@ -5390,32 +6150,32 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 2996, - "end": 3095, + "start": 3381, + "end": 3480, "ctxt": 0 }, "types": [ { "type": "TsTypeLiteral", "span": { - "start": 2998, - "end": 3040, + "start": 3383, + "end": 3425, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 2999, - "end": 3011, + "start": 3384, + "end": 3396, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 2999, - "end": 3003, + "start": 3384, + "end": 3388, "ctxt": 0 }, "value": "type", @@ -5428,22 +6188,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3003, - "end": 3010, + "start": 3388, + "end": 3395, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 3005, - "end": 3010, + "start": 3390, + "end": 3395, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3005, - "end": 3010, + "start": 3390, + "end": 3395, "ctxt": 0 }, "value": "add", @@ -5456,16 +6216,16 @@ { "type": "TsPropertySignature", "span": { - "start": 3012, - "end": 3038, + "start": 3397, + "end": 3423, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 3012, - "end": 3019, + "start": 3397, + "end": 3404, "ctxt": 0 }, "value": "payload", @@ -5478,31 +6238,31 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3019, - "end": 3038, + "start": 3404, + "end": 3423, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 3021, - "end": 3038, + "start": 3406, + "end": 3423, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 3023, - "end": 3036, + "start": 3408, + "end": 3421, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 3023, - "end": 3028, + "start": 3408, + "end": 3413, "ctxt": 0 }, "value": "toAdd", @@ -5515,15 +6275,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3028, - "end": 3036, + "start": 3413, + "end": 3421, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3030, - "end": 3036, + "start": 3415, + "end": 3421, "ctxt": 0 }, "kind": "number" @@ -5541,24 +6301,24 @@ { "type": "TsTypeLiteral", "span": { - "start": 3047, - "end": 3095, + "start": 3432, + "end": 3480, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 3048, - "end": 3063, + "start": 3433, + "end": 3448, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 3048, - "end": 3052, + "start": 3433, + "end": 3437, "ctxt": 0 }, "value": "type", @@ -5571,22 +6331,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3052, - "end": 3062, + "start": 3437, + "end": 3447, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 3054, - "end": 3062, + "start": 3439, + "end": 3447, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3054, - "end": 3062, + "start": 3439, + "end": 3447, "ctxt": 0 }, "value": "remove", @@ -5599,16 +6359,16 @@ { "type": "TsPropertySignature", "span": { - "start": 3064, - "end": 3093, + "start": 3449, + "end": 3478, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 3064, - "end": 3071, + "start": 3449, + "end": 3456, "ctxt": 0 }, "value": "payload", @@ -5621,31 +6381,31 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3071, - "end": 3093, + "start": 3456, + "end": 3478, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 3073, - "end": 3093, + "start": 3458, + "end": 3478, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 3075, - "end": 3091, + "start": 3460, + "end": 3476, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 3075, - "end": 3083, + "start": 3460, + "end": 3468, "ctxt": 0 }, "value": "toRemove", @@ -5658,15 +6418,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3083, - "end": 3091, + "start": 3468, + "end": 3476, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3085, - "end": 3091, + "start": 3470, + "end": 3476, "ctxt": 0 }, "kind": "number" @@ -5687,8 +6447,8 @@ { "type": "VariableDeclaration", "span": { - "start": 3098, - "end": 3326, + "start": 3483, + "end": 3711, "ctxt": 0 }, "kind": "const", @@ -5697,15 +6457,15 @@ { "type": "VariableDeclarator", "span": { - "start": 3104, - "end": 3326, + "start": 3489, + "end": 3711, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 3104, - "end": 3117, + "start": 3489, + "end": 3502, "ctxt": 0 }, "value": "reducerBroken", @@ -5715,16 +6475,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 3120, - "end": 3326, + "start": 3505, + "end": 3711, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 3121, - "end": 3134, + "start": 3506, + "end": 3519, "ctxt": 0 }, "value": "state", @@ -5732,15 +6492,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3126, - "end": 3134, + "start": 3511, + "end": 3519, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3128, - "end": 3134, + "start": 3513, + "end": 3519, "ctxt": 0 }, "kind": "number" @@ -5750,23 +6510,23 @@ { "type": "ObjectPattern", "span": { - "start": 3136, - "end": 3162, + "start": 3521, + "end": 3547, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 3138, - "end": 3142, + "start": 3523, + "end": 3527, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 3138, - "end": 3142, + "start": 3523, + "end": 3527, "ctxt": 0 }, "value": "type", @@ -5777,15 +6537,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 3144, - "end": 3151, + "start": 3529, + "end": 3536, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 3144, - "end": 3151, + "start": 3529, + "end": 3536, "ctxt": 0 }, "value": "payload", @@ -5798,22 +6558,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3153, - "end": 3162, + "start": 3538, + "end": 3547, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 3155, - "end": 3162, + "start": 3540, + "end": 3547, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 3155, - "end": 3162, + "start": 3540, + "end": 3547, "ctxt": 0 }, "value": "Action3", @@ -5827,23 +6587,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 3167, - "end": 3326, + "start": 3552, + "end": 3711, "ctxt": 0 }, "stmts": [ { "type": "SwitchStatement", "span": { - "start": 3173, - "end": 3324, + "start": 3558, + "end": 3709, "ctxt": 0 }, "discriminant": { "type": "Identifier", "span": { - "start": 3181, - "end": 3185, + "start": 3566, + "end": 3570, "ctxt": 0 }, "value": "type", @@ -5853,15 +6613,15 @@ { "type": "SwitchCase", "span": { - "start": 3197, - "end": 3250, + "start": 3582, + "end": 3635, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 3202, - "end": 3207, + "start": 3587, + "end": 3592, "ctxt": 0 }, "value": "add", @@ -5871,23 +6631,23 @@ { "type": "ReturnStatement", "span": { - "start": 3221, - "end": 3250, + "start": 3606, + "end": 3635, "ctxt": 0 }, "argument": { "type": "BinaryExpression", "span": { - "start": 3228, - "end": 3249, + "start": 3613, + "end": 3634, "ctxt": 0 }, "operator": "+", "left": { "type": "Identifier", "span": { - "start": 3228, - "end": 3233, + "start": 3613, + "end": 3618, "ctxt": 0 }, "value": "state", @@ -5896,15 +6656,15 @@ "right": { "type": "MemberExpression", "span": { - "start": 3236, - "end": 3249, + "start": 3621, + "end": 3634, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3236, - "end": 3243, + "start": 3621, + "end": 3628, "ctxt": 0 }, "value": "payload", @@ -5913,8 +6673,8 @@ "property": { "type": "Identifier", "span": { - "start": 3244, - "end": 3249, + "start": 3629, + "end": 3634, "ctxt": 0 }, "value": "toAdd", @@ -5928,15 +6688,15 @@ { "type": "SwitchCase", "span": { - "start": 3259, - "end": 3318, + "start": 3644, + "end": 3703, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 3264, - "end": 3272, + "start": 3649, + "end": 3657, "ctxt": 0 }, "value": "remove", @@ -5946,23 +6706,23 @@ { "type": "ReturnStatement", "span": { - "start": 3286, - "end": 3318, + "start": 3671, + "end": 3703, "ctxt": 0 }, "argument": { "type": "BinaryExpression", "span": { - "start": 3293, - "end": 3317, + "start": 3678, + "end": 3702, "ctxt": 0 }, "operator": "-", "left": { "type": "Identifier", "span": { - "start": 3293, - "end": 3298, + "start": 3678, + "end": 3683, "ctxt": 0 }, "value": "state", @@ -5971,15 +6731,15 @@ "right": { "type": "MemberExpression", "span": { - "start": 3301, - "end": 3317, + "start": 3686, + "end": 3702, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3301, - "end": 3308, + "start": 3686, + "end": 3693, "ctxt": 0 }, "value": "payload", @@ -5988,8 +6748,8 @@ "property": { "type": "Identifier", "span": { - "start": 3309, - "end": 3317, + "start": 3694, + "end": 3702, "ctxt": 0 }, "value": "toRemove", @@ -6016,8 +6776,8 @@ { "type": "VariableDeclaration", "span": { - "start": 3350, - "end": 3383, + "start": 3735, + "end": 3768, "ctxt": 0 }, "kind": "var", @@ -6026,15 +6786,15 @@ { "type": "VariableDeclarator", "span": { - "start": 3362, - "end": 3382, + "start": 3747, + "end": 3767, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 3362, - "end": 3364, + "start": 3747, + "end": 3749, "ctxt": 0 }, "value": "it", @@ -6042,22 +6802,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3364, - "end": 3382, + "start": 3749, + "end": 3767, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 3366, - "end": 3382, + "start": 3751, + "end": 3767, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 3366, - "end": 3374, + "start": 3751, + "end": 3759, "ctxt": 0 }, "value": "Iterator", @@ -6066,16 +6826,16 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 3374, - "end": 3382, + "start": 3759, + "end": 3767, "ctxt": 0 }, "params": [ { "type": "TsKeywordType", "span": { - "start": 3375, - "end": 3381, + "start": 3760, + "end": 3766, "ctxt": 0 }, "kind": "number" @@ -6093,8 +6853,8 @@ { "type": "VariableDeclaration", "span": { - "start": 3384, - "end": 3418, + "start": 3769, + "end": 3803, "ctxt": 0 }, "kind": "const", @@ -6103,30 +6863,30 @@ { "type": "VariableDeclarator", "span": { - "start": 3390, - "end": 3417, + "start": 3775, + "end": 3802, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 3390, - "end": 3405, + "start": 3775, + "end": 3790, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 3392, - "end": 3397, + "start": 3777, + "end": 3782, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 3392, - "end": 3397, + "start": 3777, + "end": 3782, "ctxt": 0 }, "value": "value", @@ -6137,15 +6897,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 3399, - "end": 3403, + "start": 3784, + "end": 3788, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 3399, - "end": 3403, + "start": 3784, + "end": 3788, "ctxt": 0 }, "value": "done", @@ -6160,22 +6920,22 @@ "init": { "type": "CallExpression", "span": { - "start": 3408, - "end": 3417, + "start": 3793, + "end": 3802, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3408, - "end": 3415, + "start": 3793, + "end": 3800, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3408, - "end": 3410, + "start": 3793, + "end": 3795, "ctxt": 0 }, "value": "it", @@ -6184,8 +6944,8 @@ "property": { "type": "Identifier", "span": { - "start": 3411, - "end": 3415, + "start": 3796, + "end": 3800, "ctxt": 0 }, "value": "next", @@ -6202,23 +6962,23 @@ { "type": "IfStatement", "span": { - "start": 3419, - "end": 3455, + "start": 3804, + "end": 3840, "ctxt": 0 }, "test": { "type": "UnaryExpression", "span": { - "start": 3423, - "end": 3428, + "start": 3808, + "end": 3813, "ctxt": 0 }, "operator": "!", "argument": { "type": "Identifier", "span": { - "start": 3424, - "end": 3428, + "start": 3809, + "end": 3813, "ctxt": 0 }, "value": "done", @@ -6228,23 +6988,23 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3430, - "end": 3455, + "start": 3815, + "end": 3840, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3436, - "end": 3442, + "start": 3821, + "end": 3827, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 3436, - "end": 3441, + "start": 3821, + "end": 3826, "ctxt": 0 }, "value": "value", @@ -6260,8 +7020,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 3496, - "end": 3499, + "start": 3881, + "end": 3884, "ctxt": 0 }, "value": "f50", @@ -6272,16 +7032,16 @@ { "type": "Parameter", "span": { - "start": 3500, - "end": 3527, + "start": 3885, + "end": 3912, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 3500, - "end": 3527, + "start": 3885, + "end": 3912, "ctxt": 0 }, "value": "cb", @@ -6289,35 +7049,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3502, - "end": 3527, + "start": 3887, + "end": 3912, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 3504, - "end": 3527, + "start": 3889, + "end": 3912, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 3505, - "end": 3518, + "start": 3890, + "end": 3903, "ctxt": 0 }, "rest": { - "start": 3505, - "end": 3508, + "start": 3890, + "end": 3893, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 3508, - "end": 3512, + "start": 3893, + "end": 3897, "ctxt": 0 }, "value": "args", @@ -6327,22 +7087,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3512, - "end": 3518, + "start": 3897, + "end": 3903, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 3514, - "end": 3518, + "start": 3899, + "end": 3903, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 3514, - "end": 3518, + "start": 3899, + "end": 3903, "ctxt": 0 }, "value": "Args", @@ -6357,15 +7117,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3520, - "end": 3527, + "start": 3905, + "end": 3912, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3523, - "end": 3527, + "start": 3908, + "end": 3912, "ctxt": 0 }, "kind": "void" @@ -6378,8 +7138,8 @@ ], "decorators": [], "span": { - "start": 3479, - "end": 3534, + "start": 3864, + "end": 3919, "ctxt": 0 }, "body": null, @@ -6389,15 +7149,15 @@ "returnType": { "type": "TsTypeAnnotation", "span": { - "start": 3528, - "end": 3534, + "start": 3913, + "end": 3919, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3530, - "end": 3534, + "start": 3915, + "end": 3919, "ctxt": 0 }, "kind": "void" @@ -6407,22 +7167,22 @@ { "type": "ExpressionStatement", "span": { - "start": 3536, - "end": 3673, + "start": 3921, + "end": 4058, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3536, - "end": 3672, + "start": 3921, + "end": 4057, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 3536, - "end": 3539, + "start": 3921, + "end": 3924, "ctxt": 0 }, "value": "f50", @@ -6434,16 +7194,16 @@ "expression": { "type": "ArrowFunctionExpression", "span": { - "start": 3540, - "end": 3671, + "start": 3925, + "end": 4056, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 3541, - "end": 3545, + "start": 3926, + "end": 3930, "ctxt": 0 }, "value": "kind", @@ -6453,8 +7213,8 @@ { "type": "Identifier", "span": { - "start": 3547, - "end": 3551, + "start": 3932, + "end": 3936, "ctxt": 0 }, "value": "data", @@ -6465,31 +7225,31 @@ "body": { "type": "BlockStatement", "span": { - "start": 3556, - "end": 3671, + "start": 3941, + "end": 4056, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 3562, - "end": 3611, + "start": 3947, + "end": 3996, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 3566, - "end": 3578, + "start": 3951, + "end": 3963, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 3566, - "end": 3570, + "start": 3951, + "end": 3955, "ctxt": 0 }, "value": "kind", @@ -6498,8 +7258,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 3575, - "end": 3578, + "start": 3960, + "end": 3963, "ctxt": 0 }, "value": "A", @@ -6509,37 +7269,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3580, - "end": 3611, + "start": 3965, + "end": 3996, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3590, - "end": 3605, + "start": 3975, + "end": 3990, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3590, - "end": 3604, + "start": 3975, + "end": 3989, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3590, - "end": 3602, + "start": 3975, + "end": 3987, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3590, - "end": 3594, + "start": 3975, + "end": 3979, "ctxt": 0 }, "value": "data", @@ -6548,8 +7308,8 @@ "property": { "type": "Identifier", "span": { - "start": 3595, - "end": 3602, + "start": 3980, + "end": 3987, "ctxt": 0 }, "value": "toFixed", @@ -6567,23 +7327,23 @@ { "type": "IfStatement", "span": { - "start": 3616, - "end": 3669, + "start": 4001, + "end": 4054, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 3620, - "end": 3632, + "start": 4005, + "end": 4017, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 3620, - "end": 3624, + "start": 4005, + "end": 4009, "ctxt": 0 }, "value": "kind", @@ -6592,8 +7352,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 3629, - "end": 3632, + "start": 4014, + "end": 4017, "ctxt": 0 }, "value": "B", @@ -6603,37 +7363,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3634, - "end": 3669, + "start": 4019, + "end": 4054, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3644, - "end": 3663, + "start": 4029, + "end": 4048, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3644, - "end": 3662, + "start": 4029, + "end": 4047, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3644, - "end": 3660, + "start": 4029, + "end": 4045, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3644, - "end": 3648, + "start": 4029, + "end": 4033, "ctxt": 0 }, "value": "data", @@ -6642,8 +7402,8 @@ "property": { "type": "Identifier", "span": { - "start": 3649, - "end": 3660, + "start": 4034, + "end": 4045, "ctxt": 0 }, "value": "toUpperCase", @@ -6673,8 +7433,8 @@ { "type": "VariableDeclaration", "span": { - "start": 3675, - "end": 3878, + "start": 4060, + "end": 4263, "ctxt": 0 }, "kind": "const", @@ -6683,15 +7443,15 @@ { "type": "VariableDeclarator", "span": { - "start": 3681, - "end": 3877, + "start": 4066, + "end": 4262, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 3681, - "end": 3684, + "start": 4066, + "end": 4069, "ctxt": 0 }, "value": "f51", @@ -6699,35 +7459,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3684, - "end": 3734, + "start": 4069, + "end": 4119, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 3686, - "end": 3734, + "start": 4071, + "end": 4119, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 3687, - "end": 3725, + "start": 4072, + "end": 4110, "ctxt": 0 }, "rest": { - "start": 3687, - "end": 3690, + "start": 4072, + "end": 4075, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 3690, - "end": 3694, + "start": 4075, + "end": 4079, "ctxt": 0 }, "value": "args", @@ -6737,46 +7497,46 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3694, - "end": 3725, + "start": 4079, + "end": 4110, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 3696, - "end": 3725, + "start": 4081, + "end": 4110, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 3696, - "end": 3709, + "start": 4081, + "end": 4094, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 3697, - "end": 3700, + "start": 4082, + "end": 4085, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 3697, - "end": 3700, + "start": 4082, + "end": 4085, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3697, - "end": 3700, + "start": 4082, + "end": 4085, "ctxt": 0 }, "value": "A", @@ -6787,16 +7547,16 @@ { "type": "TsTupleElement", "span": { - "start": 3702, - "end": 3708, + "start": 4087, + "end": 4093, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 3702, - "end": 3708, + "start": 4087, + "end": 4093, "ctxt": 0 }, "kind": "number" @@ -6807,31 +7567,31 @@ { "type": "TsTupleType", "span": { - "start": 3712, - "end": 3725, + "start": 4097, + "end": 4110, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 3713, - "end": 3716, + "start": 4098, + "end": 4101, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 3713, - "end": 3716, + "start": 4098, + "end": 4101, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3713, - "end": 3716, + "start": 4098, + "end": 4101, "ctxt": 0 }, "value": "B", @@ -6842,16 +7602,16 @@ { "type": "TsTupleElement", "span": { - "start": 3718, - "end": 3724, + "start": 4103, + "end": 4109, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 3718, - "end": 3724, + "start": 4103, + "end": 4109, "ctxt": 0 }, "kind": "string" @@ -6868,15 +7628,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3727, - "end": 3734, + "start": 4112, + "end": 4119, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3730, - "end": 3734, + "start": 4115, + "end": 4119, "ctxt": 0 }, "kind": "void" @@ -6888,16 +7648,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 3737, - "end": 3877, + "start": 4122, + "end": 4262, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 3738, - "end": 3742, + "start": 4123, + "end": 4127, "ctxt": 0 }, "value": "kind", @@ -6907,8 +7667,8 @@ { "type": "Identifier", "span": { - "start": 3744, - "end": 3751, + "start": 4129, + "end": 4136, "ctxt": 0 }, "value": "payload", @@ -6919,31 +7679,31 @@ "body": { "type": "BlockStatement", "span": { - "start": 3756, - "end": 3877, + "start": 4141, + "end": 4262, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 3762, - "end": 3814, + "start": 4147, + "end": 4199, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 3766, - "end": 3778, + "start": 4151, + "end": 4163, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 3766, - "end": 3770, + "start": 4151, + "end": 4155, "ctxt": 0 }, "value": "kind", @@ -6952,8 +7712,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 3775, - "end": 3778, + "start": 4160, + "end": 4163, "ctxt": 0 }, "value": "A", @@ -6963,37 +7723,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3780, - "end": 3814, + "start": 4165, + "end": 4199, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3790, - "end": 3808, + "start": 4175, + "end": 4193, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3790, - "end": 3807, + "start": 4175, + "end": 4192, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3790, - "end": 3805, + "start": 4175, + "end": 4190, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3790, - "end": 3797, + "start": 4175, + "end": 4182, "ctxt": 0 }, "value": "payload", @@ -7002,8 +7762,8 @@ "property": { "type": "Identifier", "span": { - "start": 3798, - "end": 3805, + "start": 4183, + "end": 4190, "ctxt": 0 }, "value": "toFixed", @@ -7021,23 +7781,23 @@ { "type": "IfStatement", "span": { - "start": 3819, - "end": 3875, + "start": 4204, + "end": 4260, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 3823, - "end": 3835, + "start": 4208, + "end": 4220, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 3823, - "end": 3827, + "start": 4208, + "end": 4212, "ctxt": 0 }, "value": "kind", @@ -7046,8 +7806,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 3832, - "end": 3835, + "start": 4217, + "end": 4220, "ctxt": 0 }, "value": "B", @@ -7057,37 +7817,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3837, - "end": 3875, + "start": 4222, + "end": 4260, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3847, - "end": 3869, + "start": 4232, + "end": 4254, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3847, - "end": 3868, + "start": 4232, + "end": 4253, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3847, - "end": 3866, + "start": 4232, + "end": 4251, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3847, - "end": 3854, + "start": 4232, + "end": 4239, "ctxt": 0 }, "value": "payload", @@ -7096,8 +7856,8 @@ "property": { "type": "Identifier", "span": { - "start": 3855, - "end": 3866, + "start": 4240, + "end": 4251, "ctxt": 0 }, "value": "toUpperCase", @@ -7126,8 +7886,8 @@ { "type": "VariableDeclaration", "span": { - "start": 3880, - "end": 4063, + "start": 4265, + "end": 4448, "ctxt": 0 }, "kind": "const", @@ -7136,15 +7896,15 @@ { "type": "VariableDeclarator", "span": { - "start": 3886, - "end": 4062, + "start": 4271, + "end": 4447, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 3886, - "end": 3889, + "start": 4271, + "end": 4274, "ctxt": 0 }, "value": "f52", @@ -7152,35 +7912,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3889, - "end": 3931, + "start": 4274, + "end": 4316, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 3891, - "end": 3931, + "start": 4276, + "end": 4316, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 3892, - "end": 3922, + "start": 4277, + "end": 4307, "ctxt": 0 }, "rest": { - "start": 3892, - "end": 3895, + "start": 4277, + "end": 4280, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 3895, - "end": 3899, + "start": 4280, + "end": 4284, "ctxt": 0 }, "value": "args", @@ -7190,46 +7950,46 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3899, - "end": 3922, + "start": 4284, + "end": 4307, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 3901, - "end": 3922, + "start": 4286, + "end": 4307, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 3901, - "end": 3914, + "start": 4286, + "end": 4299, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 3902, - "end": 3905, + "start": 4287, + "end": 4290, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 3902, - "end": 3905, + "start": 4287, + "end": 4290, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3902, - "end": 3905, + "start": 4287, + "end": 4290, "ctxt": 0 }, "value": "A", @@ -7240,16 +8000,16 @@ { "type": "TsTupleElement", "span": { - "start": 3907, - "end": 3913, + "start": 4292, + "end": 4298, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 3907, - "end": 3913, + "start": 4292, + "end": 4298, "ctxt": 0 }, "kind": "number" @@ -7260,31 +8020,31 @@ { "type": "TsTupleType", "span": { - "start": 3917, - "end": 3922, + "start": 4302, + "end": 4307, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 3918, - "end": 3921, + "start": 4303, + "end": 4306, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 3918, - "end": 3921, + "start": 4303, + "end": 4306, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 3918, - "end": 3921, + "start": 4303, + "end": 4306, "ctxt": 0 }, "value": "B", @@ -7303,15 +8063,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 3924, - "end": 3931, + "start": 4309, + "end": 4316, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 3927, - "end": 3931, + "start": 4312, + "end": 4316, "ctxt": 0 }, "kind": "void" @@ -7323,16 +8083,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 3934, - "end": 4062, + "start": 4319, + "end": 4447, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 3935, - "end": 3939, + "start": 4320, + "end": 4324, "ctxt": 0 }, "value": "kind", @@ -7342,8 +8102,8 @@ { "type": "Identifier", "span": { - "start": 3941, - "end": 3948, + "start": 4326, + "end": 4333, "ctxt": 0 }, "value": "payload", @@ -7354,31 +8114,31 @@ "body": { "type": "BlockStatement", "span": { - "start": 3954, - "end": 4062, + "start": 4339, + "end": 4447, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 3960, - "end": 4060, + "start": 4345, + "end": 4445, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 3964, - "end": 3976, + "start": 4349, + "end": 4361, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 3964, - "end": 3968, + "start": 4349, + "end": 4353, "ctxt": 0 }, "value": "kind", @@ -7387,8 +8147,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 3973, - "end": 3976, + "start": 4358, + "end": 4361, "ctxt": 0 }, "value": "A", @@ -7398,37 +8158,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 3978, - "end": 4012, + "start": 4363, + "end": 4397, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 3988, - "end": 4006, + "start": 4373, + "end": 4391, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 3988, - "end": 4005, + "start": 4373, + "end": 4390, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 3988, - "end": 4003, + "start": 4373, + "end": 4388, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 3988, - "end": 3995, + "start": 4373, + "end": 4380, "ctxt": 0 }, "value": "payload", @@ -7437,8 +8197,8 @@ "property": { "type": "Identifier", "span": { - "start": 3996, - "end": 4003, + "start": 4381, + "end": 4388, "ctxt": 0 }, "value": "toFixed", @@ -7454,23 +8214,23 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 4022, - "end": 4060, + "start": 4407, + "end": 4445, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 4032, - "end": 4040, + "start": 4417, + "end": 4425, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 4032, - "end": 4039, + "start": 4417, + "end": 4424, "ctxt": 0 }, "value": "payload", @@ -7496,8 +8256,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 4082, - "end": 4090, + "start": 4467, + "end": 4475, "ctxt": 0 }, "value": "readFile", @@ -7508,16 +8268,16 @@ { "type": "Parameter", "span": { - "start": 4091, - "end": 4103, + "start": 4476, + "end": 4488, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 4091, - "end": 4103, + "start": 4476, + "end": 4488, "ctxt": 0 }, "value": "path", @@ -7525,15 +8285,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4095, - "end": 4103, + "start": 4480, + "end": 4488, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4097, - "end": 4103, + "start": 4482, + "end": 4488, "ctxt": 0 }, "kind": "string" @@ -7544,16 +8304,16 @@ { "type": "Parameter", "span": { - "start": 4105, - "end": 4194, + "start": 4490, + "end": 4579, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 4105, - "end": 4194, + "start": 4490, + "end": 4579, "ctxt": 0 }, "value": "callback", @@ -7561,35 +8321,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4113, - "end": 4194, + "start": 4498, + "end": 4579, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 4115, - "end": 4194, + "start": 4500, + "end": 4579, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 4116, - "end": 4185, + "start": 4501, + "end": 4570, "ctxt": 0 }, "rest": { - "start": 4116, - "end": 4119, + "start": 4501, + "end": 4504, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 4119, - "end": 4123, + "start": 4504, + "end": 4508, "ctxt": 0 }, "value": "args", @@ -7599,38 +8359,38 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4123, - "end": 4185, + "start": 4508, + "end": 4570, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 4125, - "end": 4185, + "start": 4510, + "end": 4570, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 4125, - "end": 4153, + "start": 4510, + "end": 4538, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4126, - "end": 4135, + "start": 4511, + "end": 4520, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4126, - "end": 4129, + "start": 4511, + "end": 4514, "ctxt": 0 }, "value": "err", @@ -7640,8 +8400,8 @@ "ty": { "type": "TsKeywordType", "span": { - "start": 4131, - "end": 4135, + "start": 4516, + "end": 4520, "ctxt": 0 }, "kind": "null" @@ -7650,15 +8410,15 @@ { "type": "TsTupleElement", "span": { - "start": 4137, - "end": 4152, + "start": 4522, + "end": 4537, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4137, - "end": 4141, + "start": 4522, + "end": 4526, "ctxt": 0 }, "value": "data", @@ -7668,15 +8428,15 @@ "ty": { "type": "TsArrayType", "span": { - "start": 4143, - "end": 4152, + "start": 4528, + "end": 4537, "ctxt": 0 }, "elemType": { "type": "TsKeywordType", "span": { - "start": 4143, - "end": 4150, + "start": 4528, + "end": 4535, "ctxt": 0 }, "kind": "unknown" @@ -7688,23 +8448,23 @@ { "type": "TsTupleType", "span": { - "start": 4156, - "end": 4185, + "start": 4541, + "end": 4570, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4157, - "end": 4167, + "start": 4542, + "end": 4552, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4157, - "end": 4160, + "start": 4542, + "end": 4545, "ctxt": 0 }, "value": "err", @@ -7714,15 +8474,15 @@ "ty": { "type": "TsTypeReference", "span": { - "start": 4162, - "end": 4167, + "start": 4547, + "end": 4552, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 4162, - "end": 4167, + "start": 4547, + "end": 4552, "ctxt": 0 }, "value": "Error", @@ -7734,15 +8494,15 @@ { "type": "TsTupleElement", "span": { - "start": 4169, - "end": 4184, + "start": 4554, + "end": 4569, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4169, - "end": 4173, + "start": 4554, + "end": 4558, "ctxt": 0 }, "value": "data", @@ -7752,8 +8512,8 @@ "ty": { "type": "TsKeywordType", "span": { - "start": 4175, - "end": 4184, + "start": 4560, + "end": 4569, "ctxt": 0 }, "kind": "undefined" @@ -7770,15 +8530,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4187, - "end": 4194, + "start": 4572, + "end": 4579, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4190, - "end": 4194, + "start": 4575, + "end": 4579, "ctxt": 0 }, "kind": "void" @@ -7791,8 +8551,8 @@ ], "decorators": [], "span": { - "start": 4065, - "end": 4202, + "start": 4450, + "end": 4587, "ctxt": 0 }, "body": null, @@ -7802,15 +8562,15 @@ "returnType": { "type": "TsTypeAnnotation", "span": { - "start": 4195, - "end": 4201, + "start": 4580, + "end": 4586, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4197, - "end": 4201, + "start": 4582, + "end": 4586, "ctxt": 0 }, "kind": "void" @@ -7820,22 +8580,22 @@ { "type": "ExpressionStatement", "span": { - "start": 4204, - "end": 4331, + "start": 4589, + "end": 4716, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 4204, - "end": 4330, + "start": 4589, + "end": 4715, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 4204, - "end": 4212, + "start": 4589, + "end": 4597, "ctxt": 0 }, "value": "readFile", @@ -7847,8 +8607,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 4213, - "end": 4220, + "start": 4598, + "end": 4605, "ctxt": 0 }, "value": "hello", @@ -7860,16 +8620,16 @@ "expression": { "type": "ArrowFunctionExpression", "span": { - "start": 4222, - "end": 4329, + "start": 4607, + "end": 4714, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 4223, - "end": 4226, + "start": 4608, + "end": 4611, "ctxt": 0 }, "value": "err", @@ -7879,8 +8639,8 @@ { "type": "Identifier", "span": { - "start": 4228, - "end": 4232, + "start": 4613, + "end": 4617, "ctxt": 0 }, "value": "data", @@ -7891,31 +8651,31 @@ "body": { "type": "BlockStatement", "span": { - "start": 4237, - "end": 4329, + "start": 4622, + "end": 4714, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 4243, - "end": 4327, + "start": 4628, + "end": 4712, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 4247, - "end": 4259, + "start": 4632, + "end": 4644, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 4247, - "end": 4250, + "start": 4632, + "end": 4635, "ctxt": 0 }, "value": "err", @@ -7924,8 +8684,8 @@ "right": { "type": "NullLiteral", "span": { - "start": 4255, - "end": 4259, + "start": 4640, + "end": 4644, "ctxt": 0 } } @@ -7933,30 +8693,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 4261, - "end": 4289, + "start": 4646, + "end": 4674, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 4271, - "end": 4283, + "start": 4656, + "end": 4668, "ctxt": 0 }, "expression": { "type": "MemberExpression", "span": { - "start": 4271, - "end": 4282, + "start": 4656, + "end": 4667, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4271, - "end": 4275, + "start": 4656, + "end": 4660, "ctxt": 0 }, "value": "data", @@ -7965,8 +8725,8 @@ "property": { "type": "Identifier", "span": { - "start": 4276, - "end": 4282, + "start": 4661, + "end": 4667, "ctxt": 0 }, "value": "length", @@ -7979,30 +8739,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 4299, - "end": 4327, + "start": 4684, + "end": 4712, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 4309, - "end": 4321, + "start": 4694, + "end": 4706, "ctxt": 0 }, "expression": { "type": "MemberExpression", "span": { - "start": 4309, - "end": 4320, + "start": 4694, + "end": 4705, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4309, - "end": 4312, + "start": 4694, + "end": 4697, "ctxt": 0 }, "value": "err", @@ -8011,8 +8771,8 @@ "property": { "type": "Identifier", "span": { - "start": 4313, - "end": 4320, + "start": 4698, + "end": 4705, "ctxt": 0 }, "value": "message", @@ -8038,16 +8798,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 4333, - "end": 4438, + "start": 4718, + "end": 4823, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 4338, - "end": 4349, + "start": 4723, + "end": 4734, "ctxt": 0 }, "value": "ReducerArgs", @@ -8057,39 +8817,39 @@ "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 4352, - "end": 4437, + "start": 4737, + "end": 4822, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 4352, - "end": 4385, + "start": 4737, + "end": 4770, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4353, - "end": 4358, + "start": 4738, + "end": 4743, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 4353, - "end": 4358, + "start": 4738, + "end": 4743, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 4353, - "end": 4358, + "start": 4738, + "end": 4743, "ctxt": 0 }, "value": "add", @@ -8100,32 +8860,32 @@ { "type": "TsTupleElement", "span": { - "start": 4360, - "end": 4384, + "start": 4745, + "end": 4769, "ctxt": 0 }, "label": null, "ty": { "type": "TsTypeLiteral", "span": { - "start": 4360, - "end": 4384, + "start": 4745, + "end": 4769, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 4362, - "end": 4372, + "start": 4747, + "end": 4757, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 4362, - "end": 4363, + "start": 4747, + "end": 4748, "ctxt": 0 }, "value": "a", @@ -8138,15 +8898,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4363, - "end": 4371, + "start": 4748, + "end": 4756, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4365, - "end": 4371, + "start": 4750, + "end": 4756, "ctxt": 0 }, "kind": "number" @@ -8157,16 +8917,16 @@ { "type": "TsPropertySignature", "span": { - "start": 4373, - "end": 4382, + "start": 4758, + "end": 4767, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 4373, - "end": 4374, + "start": 4758, + "end": 4759, "ctxt": 0 }, "value": "b", @@ -8179,15 +8939,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4374, - "end": 4382, + "start": 4759, + "end": 4767, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4376, - "end": 4382, + "start": 4761, + "end": 4767, "ctxt": 0 }, "kind": "number" @@ -8203,31 +8963,31 @@ { "type": "TsTupleType", "span": { - "start": 4388, - "end": 4437, + "start": 4773, + "end": 4822, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4389, - "end": 4397, + "start": 4774, + "end": 4782, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 4389, - "end": 4397, + "start": 4774, + "end": 4782, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 4389, - "end": 4397, + "start": 4774, + "end": 4782, "ctxt": 0 }, "value": "concat", @@ -8238,32 +8998,32 @@ { "type": "TsTupleElement", "span": { - "start": 4399, - "end": 4436, + "start": 4784, + "end": 4821, "ctxt": 0 }, "label": null, "ty": { "type": "TsTypeLiteral", "span": { - "start": 4399, - "end": 4436, + "start": 4784, + "end": 4821, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 4401, - "end": 4417, + "start": 4786, + "end": 4802, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 4401, - "end": 4409, + "start": 4786, + "end": 4794, "ctxt": 0 }, "value": "firstArr", @@ -8276,22 +9036,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4409, - "end": 4416, + "start": 4794, + "end": 4801, "ctxt": 0 }, "typeAnnotation": { "type": "TsArrayType", "span": { - "start": 4411, - "end": 4416, + "start": 4796, + "end": 4801, "ctxt": 0 }, "elemType": { "type": "TsKeywordType", "span": { - "start": 4411, - "end": 4414, + "start": 4796, + "end": 4799, "ctxt": 0 }, "kind": "any" @@ -8303,16 +9063,16 @@ { "type": "TsPropertySignature", "span": { - "start": 4418, - "end": 4434, + "start": 4803, + "end": 4819, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 4418, - "end": 4427, + "start": 4803, + "end": 4812, "ctxt": 0 }, "value": "secondArr", @@ -8325,22 +9085,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4427, - "end": 4434, + "start": 4812, + "end": 4819, "ctxt": 0 }, "typeAnnotation": { "type": "TsArrayType", "span": { - "start": 4429, - "end": 4434, + "start": 4814, + "end": 4819, "ctxt": 0 }, "elemType": { "type": "TsKeywordType", "span": { - "start": 4429, - "end": 4432, + "start": 4814, + "end": 4817, "ctxt": 0 }, "kind": "any" @@ -8360,8 +9120,8 @@ { "type": "VariableDeclaration", "span": { - "start": 4440, - "end": 4715, + "start": 4825, + "end": 5100, "ctxt": 0 }, "kind": "const", @@ -8370,15 +9130,15 @@ { "type": "VariableDeclarator", "span": { - "start": 4446, - "end": 4715, + "start": 4831, + "end": 5100, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 4446, - "end": 4453, + "start": 4831, + "end": 4838, "ctxt": 0 }, "value": "reducer", @@ -8386,35 +9146,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4453, - "end": 4485, + "start": 4838, + "end": 4870, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 4455, - "end": 4485, + "start": 4840, + "end": 4870, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 4456, - "end": 4476, + "start": 4841, + "end": 4861, "ctxt": 0 }, "rest": { - "start": 4456, - "end": 4459, + "start": 4841, + "end": 4844, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 4459, - "end": 4463, + "start": 4844, + "end": 4848, "ctxt": 0 }, "value": "args", @@ -8424,22 +9184,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4463, - "end": 4476, + "start": 4848, + "end": 4861, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 4465, - "end": 4476, + "start": 4850, + "end": 4861, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 4465, - "end": 4476, + "start": 4850, + "end": 4861, "ctxt": 0 }, "value": "ReducerArgs", @@ -8454,15 +9214,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4478, - "end": 4485, + "start": 4863, + "end": 4870, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4481, - "end": 4485, + "start": 4866, + "end": 4870, "ctxt": 0 }, "kind": "void" @@ -8474,16 +9234,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 4488, - "end": 4715, + "start": 4873, + "end": 5100, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 4489, - "end": 4491, + "start": 4874, + "end": 4876, "ctxt": 0 }, "value": "op", @@ -8493,8 +9253,8 @@ { "type": "Identifier", "span": { - "start": 4493, - "end": 4497, + "start": 4878, + "end": 4882, "ctxt": 0 }, "value": "args", @@ -8505,23 +9265,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 4502, - "end": 4715, + "start": 4887, + "end": 5100, "ctxt": 0 }, "stmts": [ { "type": "SwitchStatement", "span": { - "start": 4508, - "end": 4713, + "start": 4893, + "end": 5098, "ctxt": 0 }, "discriminant": { "type": "Identifier", "span": { - "start": 4516, - "end": 4518, + "start": 4901, + "end": 4903, "ctxt": 0 }, "value": "op", @@ -8531,15 +9291,15 @@ { "type": "SwitchCase", "span": { - "start": 4530, - "end": 4602, + "start": 4915, + "end": 4987, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 4535, - "end": 4540, + "start": 4920, + "end": 4925, "ctxt": 0 }, "value": "add", @@ -8549,29 +9309,29 @@ { "type": "ExpressionStatement", "span": { - "start": 4554, - "end": 4583, + "start": 4939, + "end": 4968, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 4554, - "end": 4582, + "start": 4939, + "end": 4967, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 4554, - "end": 4565, + "start": 4939, + "end": 4950, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4554, - "end": 4561, + "start": 4939, + "end": 4946, "ctxt": 0 }, "value": "console", @@ -8580,8 +9340,8 @@ "property": { "type": "Identifier", "span": { - "start": 4562, - "end": 4565, + "start": 4947, + "end": 4950, "ctxt": 0 }, "value": "log", @@ -8594,23 +9354,23 @@ "expression": { "type": "BinaryExpression", "span": { - "start": 4566, - "end": 4581, + "start": 4951, + "end": 4966, "ctxt": 0 }, "operator": "+", "left": { "type": "MemberExpression", "span": { - "start": 4566, - "end": 4572, + "start": 4951, + "end": 4957, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4566, - "end": 4570, + "start": 4951, + "end": 4955, "ctxt": 0 }, "value": "args", @@ -8619,8 +9379,8 @@ "property": { "type": "Identifier", "span": { - "start": 4571, - "end": 4572, + "start": 4956, + "end": 4957, "ctxt": 0 }, "value": "a", @@ -8630,15 +9390,15 @@ "right": { "type": "MemberExpression", "span": { - "start": 4575, - "end": 4581, + "start": 4960, + "end": 4966, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4575, - "end": 4579, + "start": 4960, + "end": 4964, "ctxt": 0 }, "value": "args", @@ -8647,8 +9407,8 @@ "property": { "type": "Identifier", "span": { - "start": 4580, - "end": 4581, + "start": 4965, + "end": 4966, "ctxt": 0 }, "value": "b", @@ -8664,8 +9424,8 @@ { "type": "BreakStatement", "span": { - "start": 4596, - "end": 4602, + "start": 4981, + "end": 4987, "ctxt": 0 }, "label": null @@ -8675,15 +9435,15 @@ { "type": "SwitchCase", "span": { - "start": 4611, - "end": 4707, + "start": 4996, + "end": 5092, "ctxt": 0 }, "test": { "type": "StringLiteral", "span": { - "start": 4616, - "end": 4624, + "start": 5001, + "end": 5009, "ctxt": 0 }, "value": "concat", @@ -8693,29 +9453,29 @@ { "type": "ExpressionStatement", "span": { - "start": 4638, - "end": 4688, + "start": 5023, + "end": 5073, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 4638, - "end": 4687, + "start": 5023, + "end": 5072, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 4638, - "end": 4649, + "start": 5023, + "end": 5034, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4638, - "end": 4645, + "start": 5023, + "end": 5030, "ctxt": 0 }, "value": "console", @@ -8724,8 +9484,8 @@ "property": { "type": "Identifier", "span": { - "start": 4646, - "end": 4649, + "start": 5031, + "end": 5034, "ctxt": 0 }, "value": "log", @@ -8738,29 +9498,29 @@ "expression": { "type": "CallExpression", "span": { - "start": 4650, - "end": 4686, + "start": 5035, + "end": 5071, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 4650, - "end": 4670, + "start": 5035, + "end": 5055, "ctxt": 0 }, "object": { "type": "MemberExpression", "span": { - "start": 4650, - "end": 4663, + "start": 5035, + "end": 5048, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4650, - "end": 4654, + "start": 5035, + "end": 5039, "ctxt": 0 }, "value": "args", @@ -8769,8 +9529,8 @@ "property": { "type": "Identifier", "span": { - "start": 4655, - "end": 4663, + "start": 5040, + "end": 5048, "ctxt": 0 }, "value": "firstArr", @@ -8780,8 +9540,8 @@ "property": { "type": "Identifier", "span": { - "start": 4664, - "end": 4670, + "start": 5049, + "end": 5055, "ctxt": 0 }, "value": "concat", @@ -8794,15 +9554,15 @@ "expression": { "type": "MemberExpression", "span": { - "start": 4671, - "end": 4685, + "start": 5056, + "end": 5070, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 4671, - "end": 4675, + "start": 5056, + "end": 5060, "ctxt": 0 }, "value": "args", @@ -8811,8 +9571,8 @@ "property": { "type": "Identifier", "span": { - "start": 4676, - "end": 4685, + "start": 5061, + "end": 5070, "ctxt": 0 }, "value": "secondArr", @@ -8831,8 +9591,8 @@ { "type": "BreakStatement", "span": { - "start": 4701, - "end": 4707, + "start": 5086, + "end": 5092, "ctxt": 0 }, "label": null @@ -8855,22 +9615,22 @@ { "type": "ExpressionStatement", "span": { - "start": 4717, - "end": 4748, + "start": 5102, + "end": 5133, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 4717, - "end": 4747, + "start": 5102, + "end": 5132, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 4717, - "end": 4724, + "start": 5102, + "end": 5109, "ctxt": 0 }, "value": "reducer", @@ -8882,8 +9642,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 4725, - "end": 4730, + "start": 5110, + "end": 5115, "ctxt": 0 }, "value": "add", @@ -8895,8 +9655,8 @@ "expression": { "type": "ObjectExpression", "span": { - "start": 4732, - "end": 4746, + "start": 5117, + "end": 5131, "ctxt": 0 }, "properties": [ @@ -8905,8 +9665,8 @@ "key": { "type": "Identifier", "span": { - "start": 4734, - "end": 4735, + "start": 5119, + "end": 5120, "ctxt": 0 }, "value": "a", @@ -8915,8 +9675,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 4737, - "end": 4738, + "start": 5122, + "end": 5123, "ctxt": 0 }, "value": 1.0, @@ -8928,8 +9688,8 @@ "key": { "type": "Identifier", "span": { - "start": 4740, - "end": 4741, + "start": 5125, + "end": 5126, "ctxt": 0 }, "value": "b", @@ -8938,8 +9698,8 @@ "value": { "type": "NumericLiteral", "span": { - "start": 4743, - "end": 4744, + "start": 5128, + "end": 5129, "ctxt": 0 }, "value": 3.0, @@ -8956,22 +9716,22 @@ { "type": "ExpressionStatement", "span": { - "start": 4749, - "end": 4808, + "start": 5134, + "end": 5193, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 4749, - "end": 4807, + "start": 5134, + "end": 5192, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 4749, - "end": 4756, + "start": 5134, + "end": 5141, "ctxt": 0 }, "value": "reducer", @@ -8983,8 +9743,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 4757, - "end": 4765, + "start": 5142, + "end": 5150, "ctxt": 0 }, "value": "concat", @@ -8996,8 +9756,8 @@ "expression": { "type": "ObjectExpression", "span": { - "start": 4767, - "end": 4806, + "start": 5152, + "end": 5191, "ctxt": 0 }, "properties": [ @@ -9006,8 +9766,8 @@ "key": { "type": "Identifier", "span": { - "start": 4769, - "end": 4777, + "start": 5154, + "end": 5162, "ctxt": 0 }, "value": "firstArr", @@ -9016,8 +9776,8 @@ "value": { "type": "ArrayExpression", "span": { - "start": 4779, - "end": 4785, + "start": 5164, + "end": 5170, "ctxt": 0 }, "elements": [ @@ -9026,8 +9786,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 4780, - "end": 4781, + "start": 5165, + "end": 5166, "ctxt": 0 }, "value": 1.0, @@ -9039,8 +9799,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 4783, - "end": 4784, + "start": 5168, + "end": 5169, "ctxt": 0 }, "value": 2.0, @@ -9055,8 +9815,8 @@ "key": { "type": "Identifier", "span": { - "start": 4787, - "end": 4796, + "start": 5172, + "end": 5181, "ctxt": 0 }, "value": "secondArr", @@ -9065,8 +9825,8 @@ "value": { "type": "ArrayExpression", "span": { - "start": 4798, - "end": 4804, + "start": 5183, + "end": 5189, "ctxt": 0 }, "elements": [ @@ -9075,8 +9835,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 4799, - "end": 4800, + "start": 5184, + "end": 5185, "ctxt": 0 }, "value": 3.0, @@ -9088,8 +9848,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 4802, - "end": 4803, + "start": 5187, + "end": 5188, "ctxt": 0 }, "value": 4.0, @@ -9109,16 +9869,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 4900, - "end": 5037, + "start": 5285, + "end": 5422, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 4905, - "end": 4914, + "start": 5290, + "end": 5299, "ctxt": 0 }, "value": "FooMethod", @@ -9128,24 +9888,24 @@ "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 4917, - "end": 5037, + "start": 5302, + "end": 5422, "ctxt": 0 }, "members": [ { "type": "TsMethodSignature", "span": { - "start": 4921, - "end": 5035, + "start": 5306, + "end": 5420, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 4921, - "end": 4927, + "start": 5306, + "end": 5312, "ctxt": 0 }, "value": "method", @@ -9157,20 +9917,20 @@ { "type": "RestElement", "span": { - "start": 4928, - "end": 5024, + "start": 5313, + "end": 5409, "ctxt": 0 }, "rest": { - "start": 4928, - "end": 4931, + "start": 5313, + "end": 5316, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 4931, - "end": 4935, + "start": 5316, + "end": 5320, "ctxt": 0 }, "value": "args", @@ -9180,38 +9940,38 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4935, - "end": 5024, + "start": 5320, + "end": 5409, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 4941, - "end": 5024, + "start": 5326, + "end": 5409, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 4941, - "end": 4979, + "start": 5326, + "end": 5364, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4942, - "end": 4953, + "start": 5327, + "end": 5338, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4942, - "end": 4946, + "start": 5327, + "end": 5331, "ctxt": 0 }, "value": "type", @@ -9221,15 +9981,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 4948, - "end": 4953, + "start": 5333, + "end": 5338, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 4948, - "end": 4953, + "start": 5333, + "end": 5338, "ctxt": 0 }, "value": "str", @@ -9240,15 +10000,15 @@ { "type": "TsTupleElement", "span": { - "start": 4955, - "end": 4978, + "start": 5340, + "end": 5363, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4955, - "end": 4957, + "start": 5340, + "end": 5342, "ctxt": 0 }, "value": "cb", @@ -9258,16 +10018,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 4959, - "end": 4978, + "start": 5344, + "end": 5363, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 4960, - "end": 4969, + "start": 5345, + "end": 5354, "ctxt": 0 }, "value": "e", @@ -9275,15 +10035,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4961, - "end": 4969, + "start": 5346, + "end": 5354, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4963, - "end": 4969, + "start": 5348, + "end": 5354, "ctxt": 0 }, "kind": "string" @@ -9295,15 +10055,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 4971, - "end": 4978, + "start": 5356, + "end": 5363, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 4974, - "end": 4978, + "start": 5359, + "end": 5363, "ctxt": 0 }, "kind": "void" @@ -9316,23 +10076,23 @@ { "type": "TsTupleType", "span": { - "start": 4986, - "end": 5024, + "start": 5371, + "end": 5409, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 4987, - "end": 4998, + "start": 5372, + "end": 5383, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 4987, - "end": 4991, + "start": 5372, + "end": 5376, "ctxt": 0 }, "value": "type", @@ -9342,15 +10102,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 4993, - "end": 4998, + "start": 5378, + "end": 5383, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 4993, - "end": 4998, + "start": 5378, + "end": 5383, "ctxt": 0 }, "value": "num", @@ -9361,15 +10121,15 @@ { "type": "TsTupleElement", "span": { - "start": 5000, - "end": 5023, + "start": 5385, + "end": 5408, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5000, - "end": 5002, + "start": 5385, + "end": 5387, "ctxt": 0 }, "value": "cb", @@ -9379,16 +10139,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5004, - "end": 5023, + "start": 5389, + "end": 5408, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5005, - "end": 5014, + "start": 5390, + "end": 5399, "ctxt": 0 }, "value": "e", @@ -9396,15 +10156,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5006, - "end": 5014, + "start": 5391, + "end": 5399, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5008, - "end": 5014, + "start": 5393, + "end": 5399, "ctxt": 0 }, "kind": "number" @@ -9416,15 +10176,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5016, - "end": 5023, + "start": 5401, + "end": 5408, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5019, - "end": 5023, + "start": 5404, + "end": 5408, "ctxt": 0 }, "kind": "void" @@ -9442,15 +10202,15 @@ "typeAnn": { "type": "TsTypeAnnotation", "span": { - "start": 5028, - "end": 5034, + "start": 5413, + "end": 5419, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5030, - "end": 5034, + "start": 5415, + "end": 5419, "ctxt": 0 }, "kind": "void" @@ -9464,8 +10224,8 @@ { "type": "VariableDeclaration", "span": { - "start": 5039, - "end": 5164, + "start": 5424, + "end": 5549, "ctxt": 0 }, "kind": "let", @@ -9474,15 +10234,15 @@ { "type": "VariableDeclarator", "span": { - "start": 5043, - "end": 5163, + "start": 5428, + "end": 5548, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 5043, - "end": 5047, + "start": 5428, + "end": 5432, "ctxt": 0 }, "value": "fooM", @@ -9490,22 +10250,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5047, - "end": 5058, + "start": 5432, + "end": 5443, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5049, - "end": 5058, + "start": 5434, + "end": 5443, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5049, - "end": 5058, + "start": 5434, + "end": 5443, "ctxt": 0 }, "value": "FooMethod", @@ -9518,8 +10278,8 @@ "init": { "type": "ObjectExpression", "span": { - "start": 5061, - "end": 5163, + "start": 5446, + "end": 5548, "ctxt": 0 }, "properties": [ @@ -9528,8 +10288,8 @@ "key": { "type": "Identifier", "span": { - "start": 5065, - "end": 5071, + "start": 5450, + "end": 5456, "ctxt": 0 }, "value": "method", @@ -9539,16 +10299,16 @@ { "type": "Parameter", "span": { - "start": 5072, - "end": 5076, + "start": 5457, + "end": 5461, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5072, - "end": 5076, + "start": 5457, + "end": 5461, "ctxt": 0 }, "value": "type", @@ -9559,16 +10319,16 @@ { "type": "Parameter", "span": { - "start": 5078, - "end": 5080, + "start": 5463, + "end": 5465, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5078, - "end": 5080, + "start": 5463, + "end": 5465, "ctxt": 0 }, "value": "cb", @@ -9579,38 +10339,38 @@ ], "decorators": [], "span": { - "start": 5065, - "end": 5161, + "start": 5450, + "end": 5546, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 5082, - "end": 5161, + "start": 5467, + "end": 5546, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 5088, - "end": 5157, + "start": 5473, + "end": 5542, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 5092, - "end": 5105, + "start": 5477, + "end": 5490, "ctxt": 0 }, "operator": "==", "left": { "type": "Identifier", "span": { - "start": 5092, - "end": 5096, + "start": 5477, + "end": 5481, "ctxt": 0 }, "value": "type", @@ -9619,8 +10379,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 5100, - "end": 5105, + "start": 5485, + "end": 5490, "ctxt": 0 }, "value": "num", @@ -9630,30 +10390,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 5107, - "end": 5128, + "start": 5492, + "end": 5513, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5115, - "end": 5122, + "start": 5500, + "end": 5507, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5115, - "end": 5122, + "start": 5500, + "end": 5507, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5115, - "end": 5117, + "start": 5500, + "end": 5502, "ctxt": 0 }, "value": "cb", @@ -9665,8 +10425,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 5118, - "end": 5121, + "start": 5503, + "end": 5506, "ctxt": 0 }, "value": 123.0, @@ -9682,30 +10442,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 5134, - "end": 5157, + "start": 5519, + "end": 5542, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5142, - "end": 5151, + "start": 5527, + "end": 5536, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5142, - "end": 5151, + "start": 5527, + "end": 5536, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5142, - "end": 5144, + "start": 5527, + "end": 5529, "ctxt": 0 }, "value": "cb", @@ -9717,8 +10477,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 5145, - "end": 5150, + "start": 5530, + "end": 5535, "ctxt": 0 }, "value": "abc", @@ -9748,16 +10508,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 5166, - "end": 5316, + "start": 5551, + "end": 5701, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 5171, - "end": 5185, + "start": 5556, + "end": 5570, "ctxt": 0 }, "value": "FooAsyncMethod", @@ -9767,24 +10527,24 @@ "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 5188, - "end": 5316, + "start": 5573, + "end": 5701, "ctxt": 0 }, "members": [ { "type": "TsMethodSignature", "span": { - "start": 5192, - "end": 5314, + "start": 5577, + "end": 5699, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 5192, - "end": 5198, + "start": 5577, + "end": 5583, "ctxt": 0 }, "value": "method", @@ -9796,20 +10556,20 @@ { "type": "RestElement", "span": { - "start": 5199, - "end": 5295, + "start": 5584, + "end": 5680, "ctxt": 0 }, "rest": { - "start": 5199, - "end": 5202, + "start": 5584, + "end": 5587, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 5202, - "end": 5206, + "start": 5587, + "end": 5591, "ctxt": 0 }, "value": "args", @@ -9819,38 +10579,38 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5206, - "end": 5295, + "start": 5591, + "end": 5680, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 5212, - "end": 5295, + "start": 5597, + "end": 5680, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 5212, - "end": 5250, + "start": 5597, + "end": 5635, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5213, - "end": 5224, + "start": 5598, + "end": 5609, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5213, - "end": 5217, + "start": 5598, + "end": 5602, "ctxt": 0 }, "value": "type", @@ -9860,15 +10620,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5219, - "end": 5224, + "start": 5604, + "end": 5609, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5219, - "end": 5224, + "start": 5604, + "end": 5609, "ctxt": 0 }, "value": "str", @@ -9879,15 +10639,15 @@ { "type": "TsTupleElement", "span": { - "start": 5226, - "end": 5249, + "start": 5611, + "end": 5634, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5226, - "end": 5228, + "start": 5611, + "end": 5613, "ctxt": 0 }, "value": "cb", @@ -9897,16 +10657,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5230, - "end": 5249, + "start": 5615, + "end": 5634, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5231, - "end": 5240, + "start": 5616, + "end": 5625, "ctxt": 0 }, "value": "e", @@ -9914,15 +10674,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5232, - "end": 5240, + "start": 5617, + "end": 5625, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5234, - "end": 5240, + "start": 5619, + "end": 5625, "ctxt": 0 }, "kind": "string" @@ -9934,15 +10694,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5242, - "end": 5249, + "start": 5627, + "end": 5634, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5245, - "end": 5249, + "start": 5630, + "end": 5634, "ctxt": 0 }, "kind": "void" @@ -9955,23 +10715,23 @@ { "type": "TsTupleType", "span": { - "start": 5257, - "end": 5295, + "start": 5642, + "end": 5680, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5258, - "end": 5269, + "start": 5643, + "end": 5654, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5258, - "end": 5262, + "start": 5643, + "end": 5647, "ctxt": 0 }, "value": "type", @@ -9981,15 +10741,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5264, - "end": 5269, + "start": 5649, + "end": 5654, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5264, - "end": 5269, + "start": 5649, + "end": 5654, "ctxt": 0 }, "value": "num", @@ -10000,15 +10760,15 @@ { "type": "TsTupleElement", "span": { - "start": 5271, - "end": 5294, + "start": 5656, + "end": 5679, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5271, - "end": 5273, + "start": 5656, + "end": 5658, "ctxt": 0 }, "value": "cb", @@ -10018,16 +10778,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5275, - "end": 5294, + "start": 5660, + "end": 5679, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5276, - "end": 5285, + "start": 5661, + "end": 5670, "ctxt": 0 }, "value": "e", @@ -10035,15 +10795,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5277, - "end": 5285, + "start": 5662, + "end": 5670, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5279, - "end": 5285, + "start": 5664, + "end": 5670, "ctxt": 0 }, "kind": "number" @@ -10055,15 +10815,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5287, - "end": 5294, + "start": 5672, + "end": 5679, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5290, - "end": 5294, + "start": 5675, + "end": 5679, "ctxt": 0 }, "kind": "void" @@ -10081,22 +10841,22 @@ "typeAnn": { "type": "TsTypeAnnotation", "span": { - "start": 5299, - "end": 5313, + "start": 5684, + "end": 5698, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5301, - "end": 5313, + "start": 5686, + "end": 5698, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5301, - "end": 5308, + "start": 5686, + "end": 5693, "ctxt": 0 }, "value": "Promise", @@ -10105,16 +10865,16 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 5308, - "end": 5313, + "start": 5693, + "end": 5698, "ctxt": 0 }, "params": [ { "type": "TsKeywordType", "span": { - "start": 5309, - "end": 5312, + "start": 5694, + "end": 5697, "ctxt": 0 }, "kind": "any" @@ -10131,8 +10891,8 @@ { "type": "VariableDeclaration", "span": { - "start": 5318, - "end": 5459, + "start": 5703, + "end": 5844, "ctxt": 0 }, "kind": "let", @@ -10141,15 +10901,15 @@ { "type": "VariableDeclarator", "span": { - "start": 5322, - "end": 5458, + "start": 5707, + "end": 5843, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 5322, - "end": 5331, + "start": 5707, + "end": 5716, "ctxt": 0 }, "value": "fooAsyncM", @@ -10157,22 +10917,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5331, - "end": 5347, + "start": 5716, + "end": 5732, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5333, - "end": 5347, + "start": 5718, + "end": 5732, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5333, - "end": 5347, + "start": 5718, + "end": 5732, "ctxt": 0 }, "value": "FooAsyncMethod", @@ -10185,8 +10945,8 @@ "init": { "type": "ObjectExpression", "span": { - "start": 5350, - "end": 5458, + "start": 5735, + "end": 5843, "ctxt": 0 }, "properties": [ @@ -10195,8 +10955,8 @@ "key": { "type": "Identifier", "span": { - "start": 5360, - "end": 5366, + "start": 5745, + "end": 5751, "ctxt": 0 }, "value": "method", @@ -10206,16 +10966,16 @@ { "type": "Parameter", "span": { - "start": 5367, - "end": 5371, + "start": 5752, + "end": 5756, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5367, - "end": 5371, + "start": 5752, + "end": 5756, "ctxt": 0 }, "value": "type", @@ -10226,16 +10986,16 @@ { "type": "Parameter", "span": { - "start": 5373, - "end": 5375, + "start": 5758, + "end": 5760, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5373, - "end": 5375, + "start": 5758, + "end": 5760, "ctxt": 0 }, "value": "cb", @@ -10246,38 +11006,38 @@ ], "decorators": [], "span": { - "start": 5354, - "end": 5456, + "start": 5739, + "end": 5841, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 5377, - "end": 5456, + "start": 5762, + "end": 5841, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 5383, - "end": 5452, + "start": 5768, + "end": 5837, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 5387, - "end": 5400, + "start": 5772, + "end": 5785, "ctxt": 0 }, "operator": "==", "left": { "type": "Identifier", "span": { - "start": 5387, - "end": 5391, + "start": 5772, + "end": 5776, "ctxt": 0 }, "value": "type", @@ -10286,8 +11046,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 5395, - "end": 5400, + "start": 5780, + "end": 5785, "ctxt": 0 }, "value": "num", @@ -10297,30 +11057,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 5402, - "end": 5423, + "start": 5787, + "end": 5808, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5410, - "end": 5417, + "start": 5795, + "end": 5802, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5410, - "end": 5417, + "start": 5795, + "end": 5802, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5410, - "end": 5412, + "start": 5795, + "end": 5797, "ctxt": 0 }, "value": "cb", @@ -10332,8 +11092,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 5413, - "end": 5416, + "start": 5798, + "end": 5801, "ctxt": 0 }, "value": 123.0, @@ -10349,30 +11109,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 5429, - "end": 5452, + "start": 5814, + "end": 5837, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5437, - "end": 5446, + "start": 5822, + "end": 5831, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5437, - "end": 5446, + "start": 5822, + "end": 5831, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5437, - "end": 5439, + "start": 5822, + "end": 5824, "ctxt": 0 }, "value": "cb", @@ -10384,8 +11144,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 5440, - "end": 5445, + "start": 5825, + "end": 5830, "ctxt": 0 }, "value": "abc", @@ -10415,16 +11175,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 5461, - "end": 5621, + "start": 5846, + "end": 6006, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 5466, - "end": 5478, + "start": 5851, + "end": 5863, "ctxt": 0 }, "value": "FooGenMethod", @@ -10434,24 +11194,24 @@ "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 5481, - "end": 5621, + "start": 5866, + "end": 6006, "ctxt": 0 }, "members": [ { "type": "TsMethodSignature", "span": { - "start": 5485, - "end": 5619, + "start": 5870, + "end": 6004, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 5485, - "end": 5491, + "start": 5870, + "end": 5876, "ctxt": 0 }, "value": "method", @@ -10463,20 +11223,20 @@ { "type": "RestElement", "span": { - "start": 5492, - "end": 5588, + "start": 5877, + "end": 5973, "ctxt": 0 }, "rest": { - "start": 5492, - "end": 5495, + "start": 5877, + "end": 5880, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 5495, - "end": 5499, + "start": 5880, + "end": 5884, "ctxt": 0 }, "value": "args", @@ -10486,38 +11246,38 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5499, - "end": 5588, + "start": 5884, + "end": 5973, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 5505, - "end": 5588, + "start": 5890, + "end": 5973, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 5505, - "end": 5543, + "start": 5890, + "end": 5928, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5506, - "end": 5517, + "start": 5891, + "end": 5902, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5506, - "end": 5510, + "start": 5891, + "end": 5895, "ctxt": 0 }, "value": "type", @@ -10527,15 +11287,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5512, - "end": 5517, + "start": 5897, + "end": 5902, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5512, - "end": 5517, + "start": 5897, + "end": 5902, "ctxt": 0 }, "value": "str", @@ -10546,15 +11306,15 @@ { "type": "TsTupleElement", "span": { - "start": 5519, - "end": 5542, + "start": 5904, + "end": 5927, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5519, - "end": 5521, + "start": 5904, + "end": 5906, "ctxt": 0 }, "value": "cb", @@ -10564,16 +11324,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5523, - "end": 5542, + "start": 5908, + "end": 5927, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5524, - "end": 5533, + "start": 5909, + "end": 5918, "ctxt": 0 }, "value": "e", @@ -10581,15 +11341,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5525, - "end": 5533, + "start": 5910, + "end": 5918, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5527, - "end": 5533, + "start": 5912, + "end": 5918, "ctxt": 0 }, "kind": "string" @@ -10601,15 +11361,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5535, - "end": 5542, + "start": 5920, + "end": 5927, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5538, - "end": 5542, + "start": 5923, + "end": 5927, "ctxt": 0 }, "kind": "void" @@ -10622,23 +11382,23 @@ { "type": "TsTupleType", "span": { - "start": 5550, - "end": 5588, + "start": 5935, + "end": 5973, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5551, - "end": 5562, + "start": 5936, + "end": 5947, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5551, - "end": 5555, + "start": 5936, + "end": 5940, "ctxt": 0 }, "value": "type", @@ -10648,15 +11408,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5557, - "end": 5562, + "start": 5942, + "end": 5947, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5557, - "end": 5562, + "start": 5942, + "end": 5947, "ctxt": 0 }, "value": "num", @@ -10667,15 +11427,15 @@ { "type": "TsTupleElement", "span": { - "start": 5564, - "end": 5587, + "start": 5949, + "end": 5972, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5564, - "end": 5566, + "start": 5949, + "end": 5951, "ctxt": 0 }, "value": "cb", @@ -10685,16 +11445,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5568, - "end": 5587, + "start": 5953, + "end": 5972, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5569, - "end": 5578, + "start": 5954, + "end": 5963, "ctxt": 0 }, "value": "e", @@ -10702,15 +11462,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5570, - "end": 5578, + "start": 5955, + "end": 5963, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5572, - "end": 5578, + "start": 5957, + "end": 5963, "ctxt": 0 }, "kind": "number" @@ -10722,15 +11482,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5580, - "end": 5587, + "start": 5965, + "end": 5972, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5583, - "end": 5587, + "start": 5968, + "end": 5972, "ctxt": 0 }, "kind": "void" @@ -10748,22 +11508,22 @@ "typeAnn": { "type": "TsTypeAnnotation", "span": { - "start": 5592, - "end": 5618, + "start": 5977, + "end": 6003, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5594, - "end": 5618, + "start": 5979, + "end": 6003, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5594, - "end": 5603, + "start": 5979, + "end": 5988, "ctxt": 0 }, "value": "Generator", @@ -10772,16 +11532,16 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 5603, - "end": 5618, + "start": 5988, + "end": 6003, "ctxt": 0 }, "params": [ { "type": "TsKeywordType", "span": { - "start": 5604, - "end": 5607, + "start": 5989, + "end": 5992, "ctxt": 0 }, "kind": "any" @@ -10789,8 +11549,8 @@ { "type": "TsKeywordType", "span": { - "start": 5609, - "end": 5612, + "start": 5994, + "end": 5997, "ctxt": 0 }, "kind": "any" @@ -10798,8 +11558,8 @@ { "type": "TsKeywordType", "span": { - "start": 5614, - "end": 5617, + "start": 5999, + "end": 6002, "ctxt": 0 }, "kind": "any" @@ -10816,8 +11576,8 @@ { "type": "VariableDeclaration", "span": { - "start": 5623, - "end": 5755, + "start": 6008, + "end": 6140, "ctxt": 0 }, "kind": "let", @@ -10826,15 +11586,15 @@ { "type": "VariableDeclarator", "span": { - "start": 5627, - "end": 5754, + "start": 6012, + "end": 6139, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 5627, - "end": 5634, + "start": 6012, + "end": 6019, "ctxt": 0 }, "value": "fooGenM", @@ -10842,22 +11602,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5634, - "end": 5648, + "start": 6019, + "end": 6033, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5636, - "end": 5648, + "start": 6021, + "end": 6033, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5636, - "end": 5648, + "start": 6021, + "end": 6033, "ctxt": 0 }, "value": "FooGenMethod", @@ -10870,8 +11630,8 @@ "init": { "type": "ObjectExpression", "span": { - "start": 5651, - "end": 5754, + "start": 6036, + "end": 6139, "ctxt": 0 }, "properties": [ @@ -10880,8 +11640,8 @@ "key": { "type": "Identifier", "span": { - "start": 5656, - "end": 5662, + "start": 6041, + "end": 6047, "ctxt": 0 }, "value": "method", @@ -10891,16 +11651,16 @@ { "type": "Parameter", "span": { - "start": 5663, - "end": 5667, + "start": 6048, + "end": 6052, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5663, - "end": 5667, + "start": 6048, + "end": 6052, "ctxt": 0 }, "value": "type", @@ -10911,16 +11671,16 @@ { "type": "Parameter", "span": { - "start": 5669, - "end": 5671, + "start": 6054, + "end": 6056, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5669, - "end": 5671, + "start": 6054, + "end": 6056, "ctxt": 0 }, "value": "cb", @@ -10931,38 +11691,38 @@ ], "decorators": [], "span": { - "start": 5655, - "end": 5752, + "start": 6040, + "end": 6137, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 5673, - "end": 5752, + "start": 6058, + "end": 6137, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 5679, - "end": 5748, + "start": 6064, + "end": 6133, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 5683, - "end": 5696, + "start": 6068, + "end": 6081, "ctxt": 0 }, "operator": "==", "left": { "type": "Identifier", "span": { - "start": 5683, - "end": 5687, + "start": 6068, + "end": 6072, "ctxt": 0 }, "value": "type", @@ -10971,8 +11731,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 5691, - "end": 5696, + "start": 6076, + "end": 6081, "ctxt": 0 }, "value": "num", @@ -10982,30 +11742,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 5698, - "end": 5719, + "start": 6083, + "end": 6104, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5706, - "end": 5713, + "start": 6091, + "end": 6098, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5706, - "end": 5713, + "start": 6091, + "end": 6098, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5706, - "end": 5708, + "start": 6091, + "end": 6093, "ctxt": 0 }, "value": "cb", @@ -11017,8 +11777,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 5709, - "end": 5712, + "start": 6094, + "end": 6097, "ctxt": 0 }, "value": 123.0, @@ -11034,30 +11794,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 5725, - "end": 5748, + "start": 6110, + "end": 6133, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 5733, - "end": 5742, + "start": 6118, + "end": 6127, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 5733, - "end": 5742, + "start": 6118, + "end": 6127, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 5733, - "end": 5735, + "start": 6118, + "end": 6120, "ctxt": 0 }, "value": "cb", @@ -11069,8 +11829,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 5736, - "end": 5741, + "start": 6121, + "end": 6126, "ctxt": 0 }, "value": "abc", @@ -11100,16 +11860,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 5757, - "end": 5927, + "start": 6142, + "end": 6312, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 5762, - "end": 5779, + "start": 6147, + "end": 6164, "ctxt": 0 }, "value": "FooAsyncGenMethod", @@ -11119,24 +11879,24 @@ "typeAnnotation": { "type": "TsTypeLiteral", "span": { - "start": 5782, - "end": 5927, + "start": 6167, + "end": 6312, "ctxt": 0 }, "members": [ { "type": "TsMethodSignature", "span": { - "start": 5786, - "end": 5925, + "start": 6171, + "end": 6310, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 5786, - "end": 5792, + "start": 6171, + "end": 6177, "ctxt": 0 }, "value": "method", @@ -11148,20 +11908,20 @@ { "type": "RestElement", "span": { - "start": 5793, - "end": 5889, + "start": 6178, + "end": 6274, "ctxt": 0 }, "rest": { - "start": 5793, - "end": 5796, + "start": 6178, + "end": 6181, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 5796, - "end": 5800, + "start": 6181, + "end": 6185, "ctxt": 0 }, "value": "args", @@ -11171,38 +11931,38 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5800, - "end": 5889, + "start": 6185, + "end": 6274, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 5806, - "end": 5889, + "start": 6191, + "end": 6274, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 5806, - "end": 5844, + "start": 6191, + "end": 6229, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5807, - "end": 5818, + "start": 6192, + "end": 6203, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5807, - "end": 5811, + "start": 6192, + "end": 6196, "ctxt": 0 }, "value": "type", @@ -11212,15 +11972,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5813, - "end": 5818, + "start": 6198, + "end": 6203, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5813, - "end": 5818, + "start": 6198, + "end": 6203, "ctxt": 0 }, "value": "str", @@ -11231,15 +11991,15 @@ { "type": "TsTupleElement", "span": { - "start": 5820, - "end": 5843, + "start": 6205, + "end": 6228, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5820, - "end": 5822, + "start": 6205, + "end": 6207, "ctxt": 0 }, "value": "cb", @@ -11249,16 +12009,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5824, - "end": 5843, + "start": 6209, + "end": 6228, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5825, - "end": 5834, + "start": 6210, + "end": 6219, "ctxt": 0 }, "value": "e", @@ -11266,15 +12026,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5826, - "end": 5834, + "start": 6211, + "end": 6219, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5828, - "end": 5834, + "start": 6213, + "end": 6219, "ctxt": 0 }, "kind": "string" @@ -11286,15 +12046,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5836, - "end": 5843, + "start": 6221, + "end": 6228, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5839, - "end": 5843, + "start": 6224, + "end": 6228, "ctxt": 0 }, "kind": "void" @@ -11307,23 +12067,23 @@ { "type": "TsTupleType", "span": { - "start": 5851, - "end": 5889, + "start": 6236, + "end": 6274, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 5852, - "end": 5863, + "start": 6237, + "end": 6248, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5852, - "end": 5856, + "start": 6237, + "end": 6241, "ctxt": 0 }, "value": "type", @@ -11333,15 +12093,15 @@ "ty": { "type": "TsLiteralType", "span": { - "start": 5858, - "end": 5863, + "start": 6243, + "end": 6248, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 5858, - "end": 5863, + "start": 6243, + "end": 6248, "ctxt": 0 }, "value": "num", @@ -11352,15 +12112,15 @@ { "type": "TsTupleElement", "span": { - "start": 5865, - "end": 5888, + "start": 6250, + "end": 6273, "ctxt": 0 }, "label": { "type": "Identifier", "span": { - "start": 5865, - "end": 5867, + "start": 6250, + "end": 6252, "ctxt": 0 }, "value": "cb", @@ -11370,16 +12130,16 @@ "ty": { "type": "TsFunctionType", "span": { - "start": 5869, - "end": 5888, + "start": 6254, + "end": 6273, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 5870, - "end": 5879, + "start": 6255, + "end": 6264, "ctxt": 0 }, "value": "e", @@ -11387,15 +12147,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5871, - "end": 5879, + "start": 6256, + "end": 6264, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5873, - "end": 5879, + "start": 6258, + "end": 6264, "ctxt": 0 }, "kind": "number" @@ -11407,15 +12167,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5881, - "end": 5888, + "start": 6266, + "end": 6273, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 5884, - "end": 5888, + "start": 6269, + "end": 6273, "ctxt": 0 }, "kind": "void" @@ -11433,22 +12193,22 @@ "typeAnn": { "type": "TsTypeAnnotation", "span": { - "start": 5893, - "end": 5924, + "start": 6278, + "end": 6309, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5895, - "end": 5924, + "start": 6280, + "end": 6309, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5895, - "end": 5909, + "start": 6280, + "end": 6294, "ctxt": 0 }, "value": "AsyncGenerator", @@ -11457,16 +12217,16 @@ "typeParams": { "type": "TsTypeParameterInstantiation", "span": { - "start": 5909, - "end": 5924, + "start": 6294, + "end": 6309, "ctxt": 0 }, "params": [ { "type": "TsKeywordType", "span": { - "start": 5910, - "end": 5913, + "start": 6295, + "end": 6298, "ctxt": 0 }, "kind": "any" @@ -11474,8 +12234,8 @@ { "type": "TsKeywordType", "span": { - "start": 5915, - "end": 5918, + "start": 6300, + "end": 6303, "ctxt": 0 }, "kind": "any" @@ -11483,8 +12243,8 @@ { "type": "TsKeywordType", "span": { - "start": 5920, - "end": 5923, + "start": 6305, + "end": 6308, "ctxt": 0 }, "kind": "any" @@ -11501,8 +12261,8 @@ { "type": "VariableDeclaration", "span": { - "start": 5929, - "end": 6077, + "start": 6314, + "end": 6462, "ctxt": 0 }, "kind": "let", @@ -11511,15 +12271,15 @@ { "type": "VariableDeclarator", "span": { - "start": 5933, - "end": 6076, + "start": 6318, + "end": 6461, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 5933, - "end": 5945, + "start": 6318, + "end": 6330, "ctxt": 0 }, "value": "fooAsyncGenM", @@ -11527,22 +12287,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 5945, - "end": 5964, + "start": 6330, + "end": 6349, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 5947, - "end": 5964, + "start": 6332, + "end": 6349, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 5947, - "end": 5964, + "start": 6332, + "end": 6349, "ctxt": 0 }, "value": "FooAsyncGenMethod", @@ -11555,8 +12315,8 @@ "init": { "type": "ObjectExpression", "span": { - "start": 5967, - "end": 6076, + "start": 6352, + "end": 6461, "ctxt": 0 }, "properties": [ @@ -11565,8 +12325,8 @@ "key": { "type": "Identifier", "span": { - "start": 5978, - "end": 5984, + "start": 6363, + "end": 6369, "ctxt": 0 }, "value": "method", @@ -11576,16 +12336,16 @@ { "type": "Parameter", "span": { - "start": 5985, - "end": 5989, + "start": 6370, + "end": 6374, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5985, - "end": 5989, + "start": 6370, + "end": 6374, "ctxt": 0 }, "value": "type", @@ -11596,16 +12356,16 @@ { "type": "Parameter", "span": { - "start": 5991, - "end": 5993, + "start": 6376, + "end": 6378, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 5991, - "end": 5993, + "start": 6376, + "end": 6378, "ctxt": 0 }, "value": "cb", @@ -11616,38 +12376,38 @@ ], "decorators": [], "span": { - "start": 5971, - "end": 6074, + "start": 6356, + "end": 6459, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 5995, - "end": 6074, + "start": 6380, + "end": 6459, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 6001, - "end": 6070, + "start": 6386, + "end": 6455, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 6005, - "end": 6018, + "start": 6390, + "end": 6403, "ctxt": 0 }, "operator": "==", "left": { "type": "Identifier", "span": { - "start": 6005, - "end": 6009, + "start": 6390, + "end": 6394, "ctxt": 0 }, "value": "type", @@ -11656,8 +12416,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 6013, - "end": 6018, + "start": 6398, + "end": 6403, "ctxt": 0 }, "value": "num", @@ -11667,30 +12427,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 6020, - "end": 6041, + "start": 6405, + "end": 6426, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6028, - "end": 6035, + "start": 6413, + "end": 6420, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 6028, - "end": 6035, + "start": 6413, + "end": 6420, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 6028, - "end": 6030, + "start": 6413, + "end": 6415, "ctxt": 0 }, "value": "cb", @@ -11702,8 +12462,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 6031, - "end": 6034, + "start": 6416, + "end": 6419, "ctxt": 0 }, "value": 123.0, @@ -11719,30 +12479,30 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 6047, - "end": 6070, + "start": 6432, + "end": 6455, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6055, - "end": 6064, + "start": 6440, + "end": 6449, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 6055, - "end": 6064, + "start": 6440, + "end": 6449, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 6055, - "end": 6057, + "start": 6440, + "end": 6442, "ctxt": 0 }, "value": "cb", @@ -11754,8 +12514,8 @@ "expression": { "type": "StringLiteral", "span": { - "start": 6058, - "end": 6063, + "start": 6443, + "end": 6448, "ctxt": 0 }, "value": "abc", @@ -11785,16 +12545,16 @@ { "type": "TsTypeAliasDeclaration", "span": { - "start": 6101, - "end": 6175, + "start": 6486, + "end": 6560, "ctxt": 0 }, "declare": false, "id": { "type": "Identifier", "span": { - "start": 6106, - "end": 6110, + "start": 6491, + "end": 6495, "ctxt": 0 }, "value": "Func", @@ -11804,28 +12564,28 @@ "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 6113, - "end": 6174, + "start": 6498, + "end": 6559, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 6155, - "end": 6165, + "start": 6540, + "end": 6550, "ctxt": 0 }, "rest": { - "start": 6155, - "end": 6158, + "start": 6540, + "end": 6543, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 6158, - "end": 6162, + "start": 6543, + "end": 6547, "ctxt": 0 }, "value": "args", @@ -11835,22 +12595,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6162, - "end": 6165, + "start": 6547, + "end": 6550, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 6164, - "end": 6165, + "start": 6549, + "end": 6550, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 6164, - "end": 6165, + "start": 6549, + "end": 6550, "ctxt": 0 }, "value": "T", @@ -11864,23 +12624,23 @@ "typeParams": { "type": "TsTypeParameterDeclaration", "span": { - "start": 6113, - "end": 6154, + "start": 6498, + "end": 6539, "ctxt": 0 }, "parameters": [ { "type": "TsTypeParameter", "span": { - "start": 6114, - "end": 6153, + "start": 6499, + "end": 6538, "ctxt": 0 }, "name": { "type": "Identifier", "span": { - "start": 6114, - "end": 6115, + "start": 6499, + "end": 6500, "ctxt": 0 }, "value": "T", @@ -11892,39 +12652,39 @@ "constraint": { "type": "TsUnionType", "span": { - "start": 6124, - "end": 6153, + "start": 6509, + "end": 6538, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 6124, - "end": 6137, + "start": 6509, + "end": 6522, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 6125, - "end": 6128, + "start": 6510, + "end": 6513, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 6125, - "end": 6128, + "start": 6510, + "end": 6513, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 6125, - "end": 6128, + "start": 6510, + "end": 6513, "ctxt": 0 }, "value": "a", @@ -11935,16 +12695,16 @@ { "type": "TsTupleElement", "span": { - "start": 6130, - "end": 6136, + "start": 6515, + "end": 6521, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 6130, - "end": 6136, + "start": 6515, + "end": 6521, "ctxt": 0 }, "kind": "number" @@ -11955,31 +12715,31 @@ { "type": "TsTupleType", "span": { - "start": 6140, - "end": 6153, + "start": 6525, + "end": 6538, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 6141, - "end": 6144, + "start": 6526, + "end": 6529, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 6141, - "end": 6144, + "start": 6526, + "end": 6529, "ctxt": 0 }, "literal": { "type": "StringLiteral", "span": { - "start": 6141, - "end": 6144, + "start": 6526, + "end": 6529, "ctxt": 0 }, "value": "b", @@ -11990,16 +12750,16 @@ { "type": "TsTupleElement", "span": { - "start": 6146, - "end": 6152, + "start": 6531, + "end": 6537, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 6146, - "end": 6152, + "start": 6531, + "end": 6537, "ctxt": 0 }, "kind": "string" @@ -12016,15 +12776,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6167, - "end": 6174, + "start": 6552, + "end": 6559, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 6170, - "end": 6174, + "start": 6555, + "end": 6559, "ctxt": 0 }, "kind": "void" @@ -12035,8 +12795,8 @@ { "type": "VariableDeclaration", "span": { - "start": 6177, - "end": 6356, + "start": 6562, + "end": 6741, "ctxt": 0 }, "kind": "const", @@ -12045,15 +12805,15 @@ { "type": "VariableDeclarator", "span": { - "start": 6183, - "end": 6355, + "start": 6568, + "end": 6740, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 6183, - "end": 6186, + "start": 6568, + "end": 6571, "ctxt": 0 }, "value": "f60", @@ -12061,22 +12821,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6186, - "end": 6192, + "start": 6571, + "end": 6577, "ctxt": 0 }, "typeAnnotation": { "type": "TsTypeReference", "span": { - "start": 6188, - "end": 6192, + "start": 6573, + "end": 6577, "ctxt": 0 }, "typeName": { "type": "Identifier", "span": { - "start": 6188, - "end": 6192, + "start": 6573, + "end": 6577, "ctxt": 0 }, "value": "Func", @@ -12089,16 +12849,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 6195, - "end": 6355, + "start": 6580, + "end": 6740, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 6196, - "end": 6200, + "start": 6581, + "end": 6585, "ctxt": 0 }, "value": "kind", @@ -12108,8 +12868,8 @@ { "type": "Identifier", "span": { - "start": 6202, - "end": 6209, + "start": 6587, + "end": 6594, "ctxt": 0 }, "value": "payload", @@ -12120,31 +12880,31 @@ "body": { "type": "BlockStatement", "span": { - "start": 6214, - "end": 6355, + "start": 6599, + "end": 6740, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 6220, - "end": 6282, + "start": 6605, + "end": 6667, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 6224, - "end": 6236, + "start": 6609, + "end": 6621, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 6224, - "end": 6228, + "start": 6609, + "end": 6613, "ctxt": 0 }, "value": "kind", @@ -12153,8 +12913,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 6233, - "end": 6236, + "start": 6618, + "end": 6621, "ctxt": 0 }, "value": "a", @@ -12164,37 +12924,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 6238, - "end": 6282, + "start": 6623, + "end": 6667, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6248, - "end": 6266, + "start": 6633, + "end": 6651, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 6248, - "end": 6265, + "start": 6633, + "end": 6650, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 6248, - "end": 6263, + "start": 6633, + "end": 6648, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6248, - "end": 6255, + "start": 6633, + "end": 6640, "ctxt": 0 }, "value": "payload", @@ -12203,8 +12963,8 @@ "property": { "type": "Identifier", "span": { - "start": 6256, - "end": 6263, + "start": 6641, + "end": 6648, "ctxt": 0 }, "value": "toFixed", @@ -12222,23 +12982,23 @@ { "type": "IfStatement", "span": { - "start": 6287, - "end": 6353, + "start": 6672, + "end": 6738, "ctxt": 0 }, "test": { "type": "BinaryExpression", "span": { - "start": 6291, - "end": 6303, + "start": 6676, + "end": 6688, "ctxt": 0 }, "operator": "===", "left": { "type": "Identifier", "span": { - "start": 6291, - "end": 6295, + "start": 6676, + "end": 6680, "ctxt": 0 }, "value": "kind", @@ -12247,8 +13007,8 @@ "right": { "type": "StringLiteral", "span": { - "start": 6300, - "end": 6303, + "start": 6685, + "end": 6688, "ctxt": 0 }, "value": "b", @@ -12258,37 +13018,37 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 6305, - "end": 6353, + "start": 6690, + "end": 6738, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6315, - "end": 6337, + "start": 6700, + "end": 6722, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 6315, - "end": 6336, + "start": 6700, + "end": 6721, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 6315, - "end": 6334, + "start": 6700, + "end": 6719, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6315, - "end": 6322, + "start": 6700, + "end": 6707, "ctxt": 0 }, "value": "payload", @@ -12297,8 +13057,8 @@ "property": { "type": "Identifier", "span": { - "start": 6323, - "end": 6334, + "start": 6708, + "end": 6719, "ctxt": 0 }, "value": "toUpperCase", @@ -12329,8 +13089,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 6389, - "end": 6392, + "start": 6774, + "end": 6777, "ctxt": 0 }, "value": "foo", @@ -12341,31 +13101,31 @@ { "type": "Parameter", "span": { - "start": 6393, - "end": 6641, + "start": 6778, + "end": 7026, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 6393, - "end": 6641, + "start": 6778, + "end": 7026, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 6399, - "end": 6405, + "start": 6784, + "end": 6790, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6399, - "end": 6405, + "start": 6784, + "end": 6790, "ctxt": 0 }, "value": "value1", @@ -12376,15 +13136,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6411, - "end": 6431, + "start": 6796, + "end": 6816, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6411, - "end": 6416, + "start": 6796, + "end": 6801, "ctxt": 0 }, "value": "test1", @@ -12393,15 +13153,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6419, - "end": 6431, + "start": 6804, + "end": 6816, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6419, - "end": 6425, + "start": 6804, + "end": 6810, "ctxt": 0 }, "value": "value1", @@ -12410,8 +13170,8 @@ "property": { "type": "Identifier", "span": { - "start": 6426, - "end": 6431, + "start": 6811, + "end": 6816, "ctxt": 0 }, "value": "test1", @@ -12422,15 +13182,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6437, - "end": 6457, + "start": 6822, + "end": 6842, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6437, - "end": 6442, + "start": 6822, + "end": 6827, "ctxt": 0 }, "value": "test2", @@ -12439,15 +13199,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6445, - "end": 6457, + "start": 6830, + "end": 6842, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6445, - "end": 6451, + "start": 6830, + "end": 6836, "ctxt": 0 }, "value": "value1", @@ -12456,8 +13216,8 @@ "property": { "type": "Identifier", "span": { - "start": 6452, - "end": 6457, + "start": 6837, + "end": 6842, "ctxt": 0 }, "value": "test2", @@ -12468,15 +13228,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6463, - "end": 6483, + "start": 6848, + "end": 6868, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6463, - "end": 6468, + "start": 6848, + "end": 6853, "ctxt": 0 }, "value": "test3", @@ -12485,15 +13245,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6471, - "end": 6483, + "start": 6856, + "end": 6868, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6471, - "end": 6477, + "start": 6856, + "end": 6862, "ctxt": 0 }, "value": "value1", @@ -12502,8 +13262,8 @@ "property": { "type": "Identifier", "span": { - "start": 6478, - "end": 6483, + "start": 6863, + "end": 6868, "ctxt": 0 }, "value": "test3", @@ -12514,15 +13274,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6489, - "end": 6509, + "start": 6874, + "end": 6894, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6489, - "end": 6494, + "start": 6874, + "end": 6879, "ctxt": 0 }, "value": "test4", @@ -12531,15 +13291,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6497, - "end": 6509, + "start": 6882, + "end": 6894, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6497, - "end": 6503, + "start": 6882, + "end": 6888, "ctxt": 0 }, "value": "value1", @@ -12548,8 +13308,8 @@ "property": { "type": "Identifier", "span": { - "start": 6504, - "end": 6509, + "start": 6889, + "end": 6894, "ctxt": 0 }, "value": "test4", @@ -12560,15 +13320,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6515, - "end": 6535, + "start": 6900, + "end": 6920, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6515, - "end": 6520, + "start": 6900, + "end": 6905, "ctxt": 0 }, "value": "test5", @@ -12577,15 +13337,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6523, - "end": 6535, + "start": 6908, + "end": 6920, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6523, - "end": 6529, + "start": 6908, + "end": 6914, "ctxt": 0 }, "value": "value1", @@ -12594,8 +13354,8 @@ "property": { "type": "Identifier", "span": { - "start": 6530, - "end": 6535, + "start": 6915, + "end": 6920, "ctxt": 0 }, "value": "test5", @@ -12606,15 +13366,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6541, - "end": 6561, + "start": 6926, + "end": 6946, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6541, - "end": 6546, + "start": 6926, + "end": 6931, "ctxt": 0 }, "value": "test6", @@ -12623,15 +13383,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6549, - "end": 6561, + "start": 6934, + "end": 6946, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6549, - "end": 6555, + "start": 6934, + "end": 6940, "ctxt": 0 }, "value": "value1", @@ -12640,8 +13400,8 @@ "property": { "type": "Identifier", "span": { - "start": 6556, - "end": 6561, + "start": 6941, + "end": 6946, "ctxt": 0 }, "value": "test6", @@ -12652,15 +13412,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6567, - "end": 6587, + "start": 6952, + "end": 6972, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6567, - "end": 6572, + "start": 6952, + "end": 6957, "ctxt": 0 }, "value": "test7", @@ -12669,15 +13429,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6575, - "end": 6587, + "start": 6960, + "end": 6972, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6575, - "end": 6581, + "start": 6960, + "end": 6966, "ctxt": 0 }, "value": "value1", @@ -12686,8 +13446,8 @@ "property": { "type": "Identifier", "span": { - "start": 6582, - "end": 6587, + "start": 6967, + "end": 6972, "ctxt": 0 }, "value": "test7", @@ -12698,15 +13458,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6593, - "end": 6613, + "start": 6978, + "end": 6998, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6593, - "end": 6598, + "start": 6978, + "end": 6983, "ctxt": 0 }, "value": "test8", @@ -12715,15 +13475,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6601, - "end": 6613, + "start": 6986, + "end": 6998, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6601, - "end": 6607, + "start": 6986, + "end": 6992, "ctxt": 0 }, "value": "value1", @@ -12732,8 +13492,8 @@ "property": { "type": "Identifier", "span": { - "start": 6608, - "end": 6613, + "start": 6993, + "end": 6998, "ctxt": 0 }, "value": "test8", @@ -12744,15 +13504,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 6619, - "end": 6639, + "start": 7004, + "end": 7024, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 6619, - "end": 6624, + "start": 7004, + "end": 7009, "ctxt": 0 }, "value": "test9", @@ -12761,15 +13521,15 @@ "value": { "type": "MemberExpression", "span": { - "start": 6627, - "end": 6639, + "start": 7012, + "end": 7024, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 6627, - "end": 6633, + "start": 7012, + "end": 7018, "ctxt": 0 }, "value": "value1", @@ -12778,8 +13538,8 @@ "property": { "type": "Identifier", "span": { - "start": 6634, - "end": 6639, + "start": 7019, + "end": 7024, "ctxt": 0 }, "value": "test9", @@ -12795,15 +13555,15 @@ ], "decorators": [], "span": { - "start": 6380, - "end": 6645, + "start": 6765, + "end": 7030, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 6643, - "end": 6645, + "start": 7028, + "end": 7030, "ctxt": 0 }, "stmts": [] @@ -12818,8 +13578,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 6678, - "end": 6681, + "start": 7063, + "end": 7066, "ctxt": 0 }, "value": "fa1", @@ -12830,16 +13590,16 @@ { "type": "Parameter", "span": { - "start": 6682, - "end": 6717, + "start": 7067, + "end": 7102, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 6682, - "end": 6717, + "start": 7067, + "end": 7102, "ctxt": 0 }, "value": "x", @@ -12847,46 +13607,46 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6683, - "end": 6717, + "start": 7068, + "end": 7102, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 6685, - "end": 6717, + "start": 7070, + "end": 7102, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 6685, - "end": 6699, + "start": 7070, + "end": 7084, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 6686, - "end": 6690, + "start": 7071, + "end": 7075, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 6686, - "end": 6690, + "start": 7071, + "end": 7075, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 6686, - "end": 6690, + "start": 7071, + "end": 7075, "ctxt": 0 }, "value": true @@ -12896,16 +13656,16 @@ { "type": "TsTupleElement", "span": { - "start": 6692, - "end": 6698, + "start": 7077, + "end": 7083, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 6692, - "end": 6698, + "start": 7077, + "end": 7083, "ctxt": 0 }, "kind": "number" @@ -12916,31 +13676,31 @@ { "type": "TsTupleType", "span": { - "start": 6702, - "end": 6717, + "start": 7087, + "end": 7102, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 6703, - "end": 6708, + "start": 7088, + "end": 7093, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 6703, - "end": 6708, + "start": 7088, + "end": 7093, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 6703, - "end": 6708, + "start": 7088, + "end": 7093, "ctxt": 0 }, "value": false @@ -12950,16 +13710,16 @@ { "type": "TsTupleElement", "span": { - "start": 6710, - "end": 6716, + "start": 7095, + "end": 7101, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 6710, - "end": 6716, + "start": 7095, + "end": 7101, "ctxt": 0 }, "kind": "string" @@ -12975,23 +13735,23 @@ ], "decorators": [], "span": { - "start": 6669, - "end": 6916, + "start": 7054, + "end": 7301, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 6719, - "end": 6916, + "start": 7104, + "end": 7301, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 6725, - "end": 6750, + "start": 7110, + "end": 7135, "ctxt": 0 }, "kind": "const", @@ -13000,23 +13760,23 @@ { "type": "VariableDeclarator", "span": { - "start": 6731, - "end": 6749, + "start": 7116, + "end": 7134, "ctxt": 0 }, "id": { "type": "ArrayPattern", "span": { - "start": 6731, - "end": 6745, + "start": 7116, + "end": 7130, "ctxt": 0 }, "elements": [ { "type": "Identifier", "span": { - "start": 6732, - "end": 6737, + "start": 7117, + "end": 7122, "ctxt": 0 }, "value": "guard", @@ -13026,8 +13786,8 @@ { "type": "Identifier", "span": { - "start": 6739, - "end": 6744, + "start": 7124, + "end": 7129, "ctxt": 0 }, "value": "value", @@ -13041,8 +13801,8 @@ "init": { "type": "Identifier", "span": { - "start": 6748, - "end": 6749, + "start": 7133, + "end": 7134, "ctxt": 0 }, "value": "x", @@ -13055,15 +13815,15 @@ { "type": "IfStatement", "span": { - "start": 6755, - "end": 6914, + "start": 7140, + "end": 7299, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 6759, - "end": 6764, + "start": 7144, + "end": 7149, "ctxt": 0 }, "value": "guard", @@ -13072,16 +13832,16 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 6766, - "end": 6832, + "start": 7151, + "end": 7217, "ctxt": 0 }, "stmts": [ { "type": "ForStatement", "span": { - "start": 6776, - "end": 6826, + "start": 7161, + "end": 7211, "ctxt": 0 }, "init": null, @@ -13090,23 +13850,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 6785, - "end": 6826, + "start": 7170, + "end": 7211, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6799, - "end": 6805, + "start": 7184, + "end": 7190, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 6799, - "end": 6804, + "start": 7184, + "end": 7189, "ctxt": 0 }, "value": "value", @@ -13121,39 +13881,39 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 6842, - "end": 6914, + "start": 7227, + "end": 7299, "ctxt": 0 }, "stmts": [ { "type": "WhileStatement", "span": { - "start": 6852, - "end": 6908, + "start": 7237, + "end": 7293, "ctxt": 0 }, "test": { "type": "UnaryExpression", "span": { - "start": 6859, - "end": 6865, + "start": 7244, + "end": 7250, "ctxt": 0 }, "operator": "!", "argument": { "type": "UnaryExpression", "span": { - "start": 6860, - "end": 6865, + "start": 7245, + "end": 7250, "ctxt": 0 }, "operator": "!", "argument": { "type": "BooleanLiteral", "span": { - "start": 6861, - "end": 6865, + "start": 7246, + "end": 7250, "ctxt": 0 }, "value": true @@ -13163,23 +13923,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 6867, - "end": 6908, + "start": 7252, + "end": 7293, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 6881, - "end": 6887, + "start": 7266, + "end": 7272, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 6881, - "end": 6886, + "start": 7266, + "end": 7271, "ctxt": 0 }, "value": "value", @@ -13204,8 +13964,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 6927, - "end": 6930, + "start": 7312, + "end": 7315, "ctxt": 0 }, "value": "fa2", @@ -13216,16 +13976,16 @@ { "type": "Parameter", "span": { - "start": 6931, - "end": 6998, + "start": 7316, + "end": 7383, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 6931, - "end": 6998, + "start": 7316, + "end": 7383, "ctxt": 0 }, "value": "x", @@ -13233,39 +13993,39 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6932, - "end": 6998, + "start": 7317, + "end": 7383, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 6934, - "end": 6998, + "start": 7319, + "end": 7383, "ctxt": 0 }, "types": [ { "type": "TsTypeLiteral", "span": { - "start": 6934, - "end": 6964, + "start": 7319, + "end": 7349, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 6936, - "end": 6948, + "start": 7321, + "end": 7333, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 6936, - "end": 6941, + "start": 7321, + "end": 7326, "ctxt": 0 }, "value": "guard", @@ -13278,22 +14038,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6941, - "end": 6947, + "start": 7326, + "end": 7332, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 6943, - "end": 6947, + "start": 7328, + "end": 7332, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 6943, - "end": 6947, + "start": 7328, + "end": 7332, "ctxt": 0 }, "value": true @@ -13305,16 +14065,16 @@ { "type": "TsPropertySignature", "span": { - "start": 6949, - "end": 6962, + "start": 7334, + "end": 7347, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 6949, - "end": 6954, + "start": 7334, + "end": 7339, "ctxt": 0 }, "value": "value", @@ -13327,15 +14087,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6954, - "end": 6962, + "start": 7339, + "end": 7347, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 6956, - "end": 6962, + "start": 7341, + "end": 7347, "ctxt": 0 }, "kind": "number" @@ -13348,24 +14108,24 @@ { "type": "TsTypeLiteral", "span": { - "start": 6967, - "end": 6998, + "start": 7352, + "end": 7383, "ctxt": 0 }, "members": [ { "type": "TsPropertySignature", "span": { - "start": 6969, - "end": 6982, + "start": 7354, + "end": 7367, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 6969, - "end": 6974, + "start": 7354, + "end": 7359, "ctxt": 0 }, "value": "guard", @@ -13378,22 +14138,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6974, - "end": 6981, + "start": 7359, + "end": 7366, "ctxt": 0 }, "typeAnnotation": { "type": "TsLiteralType", "span": { - "start": 6976, - "end": 6981, + "start": 7361, + "end": 7366, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 6976, - "end": 6981, + "start": 7361, + "end": 7366, "ctxt": 0 }, "value": false @@ -13405,16 +14165,16 @@ { "type": "TsPropertySignature", "span": { - "start": 6983, - "end": 6996, + "start": 7368, + "end": 7381, "ctxt": 0 }, "readonly": false, "key": { "type": "Identifier", "span": { - "start": 6983, - "end": 6988, + "start": 7368, + "end": 7373, "ctxt": 0 }, "value": "value", @@ -13427,15 +14187,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 6988, - "end": 6996, + "start": 7373, + "end": 7381, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 6990, - "end": 6996, + "start": 7375, + "end": 7381, "ctxt": 0 }, "kind": "string" @@ -13453,23 +14213,23 @@ ], "decorators": [], "span": { - "start": 6918, - "end": 7199, + "start": 7303, + "end": 7584, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 7000, - "end": 7199, + "start": 7385, + "end": 7584, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 7006, - "end": 7033, + "start": 7391, + "end": 7418, "ctxt": 0 }, "kind": "const", @@ -13478,30 +14238,30 @@ { "type": "VariableDeclarator", "span": { - "start": 7012, - "end": 7032, + "start": 7397, + "end": 7417, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 7012, - "end": 7028, + "start": 7397, + "end": 7413, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 7014, - "end": 7019, + "start": 7399, + "end": 7404, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 7014, - "end": 7019, + "start": 7399, + "end": 7404, "ctxt": 0 }, "value": "guard", @@ -13512,15 +14272,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 7021, - "end": 7026, + "start": 7406, + "end": 7411, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 7021, - "end": 7026, + "start": 7406, + "end": 7411, "ctxt": 0 }, "value": "value", @@ -13535,8 +14295,8 @@ "init": { "type": "Identifier", "span": { - "start": 7031, - "end": 7032, + "start": 7416, + "end": 7417, "ctxt": 0 }, "value": "x", @@ -13549,15 +14309,15 @@ { "type": "IfStatement", "span": { - "start": 7038, - "end": 7197, + "start": 7423, + "end": 7582, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 7042, - "end": 7047, + "start": 7427, + "end": 7432, "ctxt": 0 }, "value": "guard", @@ -13566,16 +14326,16 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 7049, - "end": 7115, + "start": 7434, + "end": 7500, "ctxt": 0 }, "stmts": [ { "type": "ForStatement", "span": { - "start": 7059, - "end": 7109, + "start": 7444, + "end": 7494, "ctxt": 0 }, "init": null, @@ -13584,23 +14344,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 7068, - "end": 7109, + "start": 7453, + "end": 7494, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 7082, - "end": 7088, + "start": 7467, + "end": 7473, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 7082, - "end": 7087, + "start": 7467, + "end": 7472, "ctxt": 0 }, "value": "value", @@ -13615,39 +14375,39 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 7125, - "end": 7197, + "start": 7510, + "end": 7582, "ctxt": 0 }, "stmts": [ { "type": "WhileStatement", "span": { - "start": 7135, - "end": 7191, + "start": 7520, + "end": 7576, "ctxt": 0 }, "test": { "type": "UnaryExpression", "span": { - "start": 7142, - "end": 7148, + "start": 7527, + "end": 7533, "ctxt": 0 }, "operator": "!", "argument": { "type": "UnaryExpression", "span": { - "start": 7143, - "end": 7148, + "start": 7528, + "end": 7533, "ctxt": 0 }, "operator": "!", "argument": { "type": "BooleanLiteral", "span": { - "start": 7144, - "end": 7148, + "start": 7529, + "end": 7533, "ctxt": 0 }, "value": true @@ -13657,23 +14417,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 7150, - "end": 7191, + "start": 7535, + "end": 7576, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 7164, - "end": 7170, + "start": 7549, + "end": 7555, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 7164, - "end": 7169, + "start": 7549, + "end": 7554, "ctxt": 0 }, "value": "value", @@ -13696,8 +14456,8 @@ { "type": "VariableDeclaration", "span": { - "start": 7201, - "end": 7451, + "start": 7586, + "end": 7836, "ctxt": 0 }, "kind": "const", @@ -13706,15 +14466,15 @@ { "type": "VariableDeclarator", "span": { - "start": 7207, - "end": 7451, + "start": 7592, + "end": 7836, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 7207, - "end": 7210, + "start": 7592, + "end": 7595, "ctxt": 0 }, "value": "fa3", @@ -13722,35 +14482,35 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 7210, - "end": 7263, + "start": 7595, + "end": 7648, "ctxt": 0 }, "typeAnnotation": { "type": "TsFunctionType", "span": { - "start": 7212, - "end": 7263, + "start": 7597, + "end": 7648, "ctxt": 0 }, "params": [ { "type": "RestElement", "span": { - "start": 7213, - "end": 7254, + "start": 7598, + "end": 7639, "ctxt": 0 }, "rest": { - "start": 7213, - "end": 7216, + "start": 7598, + "end": 7601, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 7216, - "end": 7220, + "start": 7601, + "end": 7605, "ctxt": 0 }, "value": "args", @@ -13760,46 +14520,46 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 7220, - "end": 7254, + "start": 7605, + "end": 7639, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 7222, - "end": 7254, + "start": 7607, + "end": 7639, "ctxt": 0 }, "types": [ { "type": "TsTupleType", "span": { - "start": 7222, - "end": 7236, + "start": 7607, + "end": 7621, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 7223, - "end": 7227, + "start": 7608, + "end": 7612, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 7223, - "end": 7227, + "start": 7608, + "end": 7612, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 7223, - "end": 7227, + "start": 7608, + "end": 7612, "ctxt": 0 }, "value": true @@ -13809,16 +14569,16 @@ { "type": "TsTupleElement", "span": { - "start": 7229, - "end": 7235, + "start": 7614, + "end": 7620, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 7229, - "end": 7235, + "start": 7614, + "end": 7620, "ctxt": 0 }, "kind": "number" @@ -13829,31 +14589,31 @@ { "type": "TsTupleType", "span": { - "start": 7239, - "end": 7254, + "start": 7624, + "end": 7639, "ctxt": 0 }, "elemTypes": [ { "type": "TsTupleElement", "span": { - "start": 7240, - "end": 7245, + "start": 7625, + "end": 7630, "ctxt": 0 }, "label": null, "ty": { "type": "TsLiteralType", "span": { - "start": 7240, - "end": 7245, + "start": 7625, + "end": 7630, "ctxt": 0 }, "literal": { "type": "BooleanLiteral", "span": { - "start": 7240, - "end": 7245, + "start": 7625, + "end": 7630, "ctxt": 0 }, "value": false @@ -13863,16 +14623,16 @@ { "type": "TsTupleElement", "span": { - "start": 7247, - "end": 7253, + "start": 7632, + "end": 7638, "ctxt": 0 }, "label": null, "ty": { "type": "TsKeywordType", "span": { - "start": 7247, - "end": 7253, + "start": 7632, + "end": 7638, "ctxt": 0 }, "kind": "string" @@ -13889,15 +14649,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 7256, - "end": 7263, + "start": 7641, + "end": 7648, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 7259, - "end": 7263, + "start": 7644, + "end": 7648, "ctxt": 0 }, "kind": "void" @@ -13909,16 +14669,16 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 7266, - "end": 7451, + "start": 7651, + "end": 7836, "ctxt": 0 }, "params": [ { "type": "Identifier", "span": { - "start": 7267, - "end": 7272, + "start": 7652, + "end": 7657, "ctxt": 0 }, "value": "guard", @@ -13928,8 +14688,8 @@ { "type": "Identifier", "span": { - "start": 7274, - "end": 7279, + "start": 7659, + "end": 7664, "ctxt": 0 }, "value": "value", @@ -13940,23 +14700,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 7284, - "end": 7451, + "start": 7669, + "end": 7836, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 7290, - "end": 7449, + "start": 7675, + "end": 7834, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 7294, - "end": 7299, + "start": 7679, + "end": 7684, "ctxt": 0 }, "value": "guard", @@ -13965,16 +14725,16 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 7301, - "end": 7367, + "start": 7686, + "end": 7752, "ctxt": 0 }, "stmts": [ { "type": "ForStatement", "span": { - "start": 7311, - "end": 7361, + "start": 7696, + "end": 7746, "ctxt": 0 }, "init": null, @@ -13983,23 +14743,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 7320, - "end": 7361, + "start": 7705, + "end": 7746, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 7334, - "end": 7340, + "start": 7719, + "end": 7725, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 7334, - "end": 7339, + "start": 7719, + "end": 7724, "ctxt": 0 }, "value": "value", @@ -14014,39 +14774,39 @@ "alternate": { "type": "BlockStatement", "span": { - "start": 7377, - "end": 7449, + "start": 7762, + "end": 7834, "ctxt": 0 }, "stmts": [ { "type": "WhileStatement", "span": { - "start": 7387, - "end": 7443, + "start": 7772, + "end": 7828, "ctxt": 0 }, "test": { "type": "UnaryExpression", "span": { - "start": 7394, - "end": 7400, + "start": 7779, + "end": 7785, "ctxt": 0 }, "operator": "!", "argument": { "type": "UnaryExpression", "span": { - "start": 7395, - "end": 7400, + "start": 7780, + "end": 7785, "ctxt": 0 }, "operator": "!", "argument": { "type": "BooleanLiteral", "span": { - "start": 7396, - "end": 7400, + "start": 7781, + "end": 7785, "ctxt": 0 }, "value": true @@ -14056,23 +14816,23 @@ "body": { "type": "BlockStatement", "span": { - "start": 7402, - "end": 7443, + "start": 7787, + "end": 7828, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 7416, - "end": 7422, + "start": 7801, + "end": 7807, "ctxt": 0 }, "expression": { "type": "Identifier", "span": { - "start": 7416, - "end": 7421, + "start": 7801, + "end": 7806, "ctxt": 0 }, "value": "value", @@ -14095,6 +14855,1160 @@ "definite": false } ] + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 7860, + "end": 7979, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 7870, + "end": 7882, + "ctxt": 0 + }, + "value": "ClientEvents", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 7883, + "end": 7979, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 7889, + "end": 7913, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 7889, + "end": 7893, + "ctxt": 0 + }, + "value": "warn", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7893, + "end": 7912, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTupleType", + "span": { + "start": 7895, + "end": 7912, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 7896, + "end": 7911, + "ctxt": 0 + }, + "label": { + "type": "Identifier", + "span": { + "start": 7896, + "end": 7903, + "ctxt": 0 + }, + "value": "message", + "optional": false, + "typeAnnotation": null + }, + "ty": { + "type": "TsKeywordType", + "span": { + "start": 7905, + "end": 7911, + "ctxt": 0 + }, + "kind": "string" + } + } + ] + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 7918, + "end": 7977, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 7918, + "end": 7933, + "ctxt": 0 + }, + "value": "shardDisconnect", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7933, + "end": 7976, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTupleType", + "span": { + "start": 7935, + "end": 7976, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 7936, + "end": 7958, + "ctxt": 0 + }, + "label": { + "type": "Identifier", + "span": { + "start": 7936, + "end": 7946, + "ctxt": 0 + }, + "value": "closeEvent", + "optional": false, + "typeAnnotation": null + }, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 7948, + "end": 7958, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7948, + "end": 7958, + "ctxt": 0 + }, + "value": "CloseEvent", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 7960, + "end": 7975, + "ctxt": 0 + }, + "label": { + "type": "Identifier", + "span": { + "start": 7960, + "end": 7967, + "ctxt": 0 + }, + "value": "shardId", + "optional": false, + "typeAnnotation": null + }, + "ty": { + "type": "TsKeywordType", + "span": { + "start": 7969, + "end": 7975, + "ctxt": 0 + }, + "kind": "number" + } + } + ] + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7997, + "end": 8003, + "ctxt": 0 + }, + "value": "Client", + "optional": false + }, + "declare": true, + "span": { + "start": 7983, + "end": 8114, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassMethod", + "span": { + "start": 8010, + "end": 8112, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 8017, + "end": 8019, + "ctxt": 0 + }, + "value": "on", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 8050, + "end": 8058, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8050, + "end": 8058, + "ctxt": 0 + }, + "value": "event", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8055, + "end": 8058, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8057, + "end": 8058, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8057, + "end": 8058, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 8060, + "end": 8104, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8060, + "end": 8104, + "ctxt": 0 + }, + "value": "listener", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8068, + "end": 8104, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 8070, + "end": 8104, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 8071, + "end": 8095, + "ctxt": 0 + }, + "rest": { + "start": 8071, + "end": 8074, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 8074, + "end": 8078, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8078, + "end": 8095, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIndexedAccessType", + "span": { + "start": 8080, + "end": 8095, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 8080, + "end": 8092, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8080, + "end": 8092, + "ctxt": 0 + }, + "value": "ClientEvents", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 8093, + "end": 8094, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8093, + "end": 8094, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8097, + "end": 8104, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8100, + "end": 8104, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 8010, + "end": 8112, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 8019, + "end": 8049, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 8020, + "end": 8048, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8020, + "end": 8021, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 8030, + "end": 8048, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8036, + "end": 8048, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8036, + "end": 8048, + "ctxt": 0 + }, + "value": "ClientEvents", + "optional": false + }, + "typeParams": null + } + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 8105, + "end": 8111, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8107, + "end": 8111, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + "kind": "method", + "isStatic": false, + "accessibility": "public", + "isAbstract": false, + "isOptional": false, + "isOverride": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 8116, + "end": 8141, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 8122, + "end": 8140, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 8122, + "end": 8125, + "ctxt": 0 + }, + "value": "bot", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 8128, + "end": 8140, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 8132, + "end": 8138, + "ctxt": 0 + }, + "value": "Client", + "optional": false + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 8142, + "end": 8281, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 8142, + "end": 8280, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 8142, + "end": 8148, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8142, + "end": 8145, + "ctxt": 0 + }, + "value": "bot", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8146, + "end": 8148, + "ctxt": 0 + }, + "value": "on", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 8149, + "end": 8166, + "ctxt": 0 + }, + "value": "shardDisconnect", + "raw": "\"shardDisconnect\"" + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 8168, + "end": 8279, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 8169, + "end": 8174, + "ctxt": 0 + }, + "value": "event", + "optional": false, + "typeAnnotation": null + }, + { + "type": "Identifier", + "span": { + "start": 8176, + "end": 8181, + "ctxt": 0 + }, + "value": "shard", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 8186, + "end": 8279, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 8186, + "end": 8197, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8186, + "end": 8193, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8194, + "end": 8197, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 8198, + "end": 8278, + "ctxt": 0 + }, + "expressions": [ + { + "type": "Identifier", + "span": { + "start": 8207, + "end": 8212, + "ctxt": 0 + }, + "value": "shard", + "optional": false + }, + { + "type": "MemberExpression", + "span": { + "start": 8230, + "end": 8240, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8230, + "end": 8235, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8236, + "end": 8240, + "ctxt": 0 + }, + "value": "code", + "optional": false + } + }, + { + "type": "MemberExpression", + "span": { + "start": 8244, + "end": 8258, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8244, + "end": 8249, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8250, + "end": 8258, + "ctxt": 0 + }, + "value": "wasClean", + "optional": false + } + }, + { + "type": "MemberExpression", + "span": { + "start": 8264, + "end": 8276, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8264, + "end": 8269, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8270, + "end": 8276, + "ctxt": 0 + }, + "value": "reason", + "optional": false + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8199, + "end": 8205, + "ctxt": 0 + }, + "tail": false, + "cooked": "Shard ", + "raw": "Shard " + }, + { + "type": "TemplateElement", + "span": { + "start": 8213, + "end": 8228, + "ctxt": 0 + }, + "tail": false, + "cooked": " disconnected (", + "raw": " disconnected (" + }, + { + "type": "TemplateElement", + "span": { + "start": 8241, + "end": 8242, + "ctxt": 0 + }, + "tail": false, + "cooked": ",", + "raw": "," + }, + { + "type": "TemplateElement", + "span": { + "start": 8259, + "end": 8262, + "ctxt": 0 + }, + "tail": false, + "cooked": "): ", + "raw": "): " + }, + { + "type": "TemplateElement", + "span": { + "start": 8277, + "end": 8277, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 8282, + "end": 8381, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 8282, + "end": 8380, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 8282, + "end": 8288, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8282, + "end": 8285, + "ctxt": 0 + }, + "value": "bot", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8286, + "end": 8288, + "ctxt": 0 + }, + "value": "on", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 8289, + "end": 8306, + "ctxt": 0 + }, + "value": "shardDisconnect", + "raw": "\"shardDisconnect\"" + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 8308, + "end": 8379, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 8308, + "end": 8313, + "ctxt": 0 + }, + "value": "event", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 8317, + "end": 8379, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 8317, + "end": 8328, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8317, + "end": 8324, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8325, + "end": 8328, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 8329, + "end": 8378, + "ctxt": 0 + }, + "expressions": [ + { + "type": "MemberExpression", + "span": { + "start": 8332, + "end": 8342, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8332, + "end": 8337, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8338, + "end": 8342, + "ctxt": 0 + }, + "value": "code", + "optional": false + } + }, + { + "type": "MemberExpression", + "span": { + "start": 8346, + "end": 8360, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8346, + "end": 8351, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8352, + "end": 8360, + "ctxt": 0 + }, + "value": "wasClean", + "optional": false + } + }, + { + "type": "MemberExpression", + "span": { + "start": 8364, + "end": 8376, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 8364, + "end": 8369, + "ctxt": 0 + }, + "value": "event", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 8370, + "end": 8376, + "ctxt": 0 + }, + "value": "reason", + "optional": false + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8330, + "end": 8330, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8343, + "end": 8344, + "ctxt": 0 + }, + "tail": false, + "cooked": " ", + "raw": " " + }, + { + "type": "TemplateElement", + "span": { + "start": 8361, + "end": 8362, + "ctxt": 0 + }, + "tail": false, + "cooked": " ", + "raw": " " + }, + { + "type": "TemplateElement", + "span": { + "start": 8377, + "end": 8377, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + } } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.ts b/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.ts index 402a5482a7c..872a862aa3c 100644 --- a/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.ts +++ b/crates/swc_ecma_parser/tests/tsc/dependentDestructuredVariables.ts @@ -39,6 +39,26 @@ function f12({ kind, payload }: Action) { } } +// repro #50206 +function f13({ kind, payload }: T) { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } +} + +function f14(t: T) { + const { kind, payload } = t; + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } +} + type Action2 = | { kind: 'A', payload: number | undefined } | { kind: 'B', payload: string | undefined }; @@ -370,3 +390,18 @@ const fa3: (...args: [true, number] | [false, string]) => void = (guard, value) } } } + +// Repro from #52152 + +interface ClientEvents { + warn: [message: string]; + shardDisconnect: [closeEvent: CloseEvent, shardId: number]; +} + +declare class Client { + public on(event: K, listener: (...args: ClientEvents[K]) => void): void; +} + +const bot = new Client(); +bot.on("shardDisconnect", (event, shard) => console.log(`Shard ${shard} disconnected (${event.code},${event.wasClean}): ${event.reason}`)); +bot.on("shardDisconnect", event => console.log(`${event.code} ${event.wasClean} ${event.reason}`)); diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.json b/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.json deleted file mode 100644 index ed9086bf441..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.json +++ /dev/null @@ -1,2805 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 95, - "end": 1513, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 101, - "end": 105, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 95, - "end": 124, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 112, - "end": 122, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 112, - "end": 113, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 113, - "end": 121, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 115, - "end": 121, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 132, - "end": 139, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "declare": false, - "span": { - "start": 126, - "end": 227, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 159, - "end": 225, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 159, - "end": 170, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 182, - "end": 225, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 202, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 211, - "end": 219, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 211, - "end": 218, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 211, - "end": 216, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 148, - "end": 152, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "value": "Derived2", - "optional": false - }, - "declare": false, - "span": { - "start": 229, - "end": 338, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 263, - "end": 336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 274, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 275, - "end": 291, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 282, - "end": 291, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 283, - "end": 291, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 285, - "end": 291, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 293, - "end": 336, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 303, - "end": 313, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 307, - "end": 312, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 307, - "end": 308, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 322, - "end": 329, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 322, - "end": 327, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 346, - "end": 354, - "ctxt": 0 - }, - "value": "Derived3", - "optional": false - }, - "declare": false, - "span": { - "start": 340, - "end": 449, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 374, - "end": 447, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 374, - "end": 385, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 386, - "end": 402, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 393, - "end": 402, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 394, - "end": 402, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 396, - "end": 402, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 404, - "end": 447, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 414, - "end": 421, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 414, - "end": 419, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 431, - "end": 441, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 435, - "end": 440, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 439, - "end": 440, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 363, - "end": 367, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 457, - "end": 465, - "ctxt": 0 - }, - "value": "Derived4", - "optional": false - }, - "declare": false, - "span": { - "start": 451, - "end": 564, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 485, - "end": 491, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 485, - "end": 486, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 496, - "end": 562, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 496, - "end": 507, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 508, - "end": 517, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 508, - "end": 517, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 509, - "end": 517, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 511, - "end": 517, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 519, - "end": 562, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 529, - "end": 539, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 533, - "end": 538, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 533, - "end": 534, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 537, - "end": 538, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 548, - "end": 556, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 548, - "end": 555, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 548, - "end": 553, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 474, - "end": 478, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 572, - "end": 580, - "ctxt": 0 - }, - "value": "Derived5", - "optional": false - }, - "declare": false, - "span": { - "start": 566, - "end": 679, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 600, - "end": 606, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 600, - "end": 601, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 611, - "end": 677, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 611, - "end": 622, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 623, - "end": 632, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 623, - "end": 632, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 624, - "end": 632, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 626, - "end": 632, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 634, - "end": 677, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 644, - "end": 652, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 644, - "end": 651, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 644, - "end": 649, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 661, - "end": 671, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 665, - "end": 670, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 665, - "end": 666, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 669, - "end": 670, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 589, - "end": 593, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 687, - "end": 695, - "ctxt": 0 - }, - "value": "Derived6", - "optional": false - }, - "declare": false, - "span": { - "start": 681, - "end": 818, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 715, - "end": 725, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 715, - "end": 716, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 716, - "end": 724, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 718, - "end": 724, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 730, - "end": 816, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 730, - "end": 741, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 742, - "end": 751, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 742, - "end": 751, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 743, - "end": 751, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 745, - "end": 751, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 753, - "end": 816, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 763, - "end": 774, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 763, - "end": 773, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 763, - "end": 769, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 763, - "end": 767, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 768, - "end": 769, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 772, - "end": 773, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 783, - "end": 793, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 787, - "end": 792, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 787, - "end": 788, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 791, - "end": 792, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 802, - "end": 810, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 802, - "end": 809, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 802, - "end": 807, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 704, - "end": 708, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 826, - "end": 834, - "ctxt": 0 - }, - "value": "Derived7", - "optional": false - }, - "declare": false, - "span": { - "start": 820, - "end": 969, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 854, - "end": 860, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 854, - "end": 855, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 858, - "end": 859, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 865, - "end": 875, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 865, - "end": 866, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 866, - "end": 874, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 868, - "end": 874, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 880, - "end": 967, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 880, - "end": 891, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 892, - "end": 901, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 892, - "end": 901, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 893, - "end": 901, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 895, - "end": 901, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 903, - "end": 967, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 913, - "end": 924, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 913, - "end": 923, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 913, - "end": 919, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 913, - "end": 917, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 918, - "end": 919, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 922, - "end": 923, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 933, - "end": 944, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 933, - "end": 943, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 933, - "end": 939, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 933, - "end": 937, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 938, - "end": 939, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 942, - "end": 943, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 953, - "end": 961, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 953, - "end": 960, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 953, - "end": 958, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 843, - "end": 847, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 977, - "end": 985, - "ctxt": 0 - }, - "value": "Derived8", - "optional": false - }, - "declare": false, - "span": { - "start": 971, - "end": 1128, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1005, - "end": 1011, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1006, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1009, - "end": 1010, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1016, - "end": 1026, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1016, - "end": 1017, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1017, - "end": 1025, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1019, - "end": 1025, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1031, - "end": 1126, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1031, - "end": 1042, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1043, - "end": 1052, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1043, - "end": 1052, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1044, - "end": 1052, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1046, - "end": 1052, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1054, - "end": 1126, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1064, - "end": 1072, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1064, - "end": 1071, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1064, - "end": 1069, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1081, - "end": 1092, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1081, - "end": 1091, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1081, - "end": 1087, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1081, - "end": 1085, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1086, - "end": 1087, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1090, - "end": 1091, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1101, - "end": 1112, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1101, - "end": 1111, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1101, - "end": 1107, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1101, - "end": 1105, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1106, - "end": 1107, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1110, - "end": 1111, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 994, - "end": 998, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1178, - "end": 1183, - "ctxt": 0 - }, - "value": "Base2", - "optional": false - }, - "declare": false, - "span": { - "start": 1172, - "end": 1196, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1189, - "end": 1194, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1189, - "end": 1190, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1190, - "end": 1193, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1192, - "end": 1193, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1192, - "end": 1193, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1183, - "end": 1186, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1184, - "end": 1185, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1184, - "end": 1185, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1204, - "end": 1212, - "ctxt": 0 - }, - "value": "Derived9", - "optional": false - }, - "declare": false, - "span": { - "start": 1198, - "end": 1354, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1239, - "end": 1245, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1239, - "end": 1240, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1243, - "end": 1244, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1250, - "end": 1260, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1250, - "end": 1251, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1251, - "end": 1259, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1253, - "end": 1259, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1265, - "end": 1352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1265, - "end": 1276, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1277, - "end": 1286, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1277, - "end": 1286, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1278, - "end": 1286, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1280, - "end": 1286, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1288, - "end": 1352, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1298, - "end": 1309, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1298, - "end": 1308, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1298, - "end": 1304, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1298, - "end": 1302, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1303, - "end": 1304, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1307, - "end": 1308, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1318, - "end": 1329, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1318, - "end": 1328, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1318, - "end": 1324, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1318, - "end": 1322, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1323, - "end": 1324, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1327, - "end": 1328, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1338, - "end": 1346, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1338, - "end": 1345, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1338, - "end": 1343, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1224, - "end": 1229, - "ctxt": 0 - }, - "value": "Base2", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1212, - "end": 1215, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1213, - "end": 1214, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1213, - "end": 1214, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1229, - "end": 1232, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1230, - "end": 1231, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1230, - "end": 1231, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1362, - "end": 1371, - "ctxt": 0 - }, - "value": "Derived10", - "optional": false - }, - "declare": false, - "span": { - "start": 1356, - "end": 1513, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1398, - "end": 1404, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1398, - "end": 1399, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1402, - "end": 1403, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1409, - "end": 1419, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1409, - "end": 1410, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1410, - "end": 1418, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1412, - "end": 1418, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1424, - "end": 1511, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1424, - "end": 1435, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1436, - "end": 1445, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1436, - "end": 1445, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1437, - "end": 1445, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1439, - "end": 1445, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1447, - "end": 1511, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1457, - "end": 1465, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1457, - "end": 1464, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1457, - "end": 1462, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1474, - "end": 1485, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1474, - "end": 1484, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1474, - "end": 1480, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1474, - "end": 1478, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1479, - "end": 1480, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1483, - "end": 1484, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1494, - "end": 1505, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1494, - "end": 1504, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1494, - "end": 1500, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1494, - "end": 1498, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1499, - "end": 1500, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1503, - "end": 1504, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1383, - "end": 1388, - "ctxt": 0 - }, - "value": "Base2", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1371, - "end": 1374, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1372, - "end": 1373, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1372, - "end": 1373, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1388, - "end": 1391, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1389, - "end": 1390, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1389, - "end": 1390, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.ts b/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.ts deleted file mode 100644 index dd5dea9c15f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassParameterProperties.ts +++ /dev/null @@ -1,94 +0,0 @@ -// ordering of super calls in derived constructors matters depending on other class contents - -class Base { - x: string; -} - -class Derived extends Base { - constructor(y: string) { - var a = 1; - super(); - } -} - -class Derived2 extends Base { - constructor(public y: string) { - var a = 1; - super(); - } -} - -class Derived3 extends Base { - constructor(public y: string) { - super(); - var a = 1; - } -} - -class Derived4 extends Base { - a = 1; - constructor(y: string) { - var b = 2; - super(); - } -} - -class Derived5 extends Base { - a = 1; - constructor(y: string) { - super(); - var b = 2; - } -} - -class Derived6 extends Base { - a: number; - constructor(y: string) { - this.a = 1; - var b = 2; - super(); - } -} - -class Derived7 extends Base { - a = 1; - b: number; - constructor(y: string) { - this.a = 3; - this.b = 3; - super(); - } -} - -class Derived8 extends Base { - a = 1; - b: number; - constructor(y: string) { - super(); - this.a = 3; - this.b = 3; - } -} - -// generic cases of Derived7 and Derived8 -class Base2 { x: T; } - -class Derived9 extends Base2 { - a = 1; - b: number; - constructor(y: string) { - this.a = 3; - this.b = 3; - super(); - } -} - -class Derived10 extends Base2 { - a = 1; - b: number; - constructor(y: string) { - super(); - this.a = 3; - this.b = 3; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.json b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.json deleted file mode 100644 index 9e397fbb9d6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.json +++ /dev/null @@ -1,720 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 480, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 11, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 53, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 18, - "end": 28, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 19, - "end": 27, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 21, - "end": 27, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 33, - "end": 51, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 44, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 48, - "end": 51, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 61, - "end": 68, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "declare": false, - "span": { - "start": 55, - "end": 138, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 88, - "end": 136, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 88, - "end": 99, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 102, - "end": 136, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 112, - "end": 124, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 112, - "end": 123, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 112, - "end": 117, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 118, - "end": 122, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 77, - "end": 81, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "value": "Derived2", - "optional": false - }, - "declare": false, - "span": { - "start": 140, - "end": 243, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 174, - "end": 241, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 174, - "end": 185, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 186, - "end": 202, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 193, - "end": 202, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 214, - "end": 226, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 214, - "end": 225, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 214, - "end": 219, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 163, - "end": 167, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 251, - "end": 259, - "ctxt": 0 - }, - "value": "Derived3", - "optional": false - }, - "declare": false, - "span": { - "start": 245, - "end": 354, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 279, - "end": 352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 279, - "end": 290, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 291, - "end": 307, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 298, - "end": 307, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 299, - "end": 307, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 301, - "end": 307, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 309, - "end": 352, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 319, - "end": 337, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 319, - "end": 336, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 319, - "end": 324, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 325, - "end": 335, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 331, - "end": 335, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 268, - "end": 272, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 362, - "end": 370, - "ctxt": 0 - }, - "value": "Derived4", - "optional": false - }, - "declare": false, - "span": { - "start": 356, - "end": 480, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 390, - "end": 478, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 390, - "end": 401, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 402, - "end": 418, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 409, - "end": 418, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 410, - "end": 418, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 412, - "end": 418, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 420, - "end": 478, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 430, - "end": 466, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 430, - "end": 465, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 430, - "end": 435, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 436, - "end": 464, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 448, - "end": 464, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 450, - "end": 462, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 457, - "end": 461, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.ts b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.ts deleted file mode 100644 index 1f57cf3149c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperCallsWithThisArg.ts +++ /dev/null @@ -1,28 +0,0 @@ -class Base { - x: string; - constructor(a) { } -} - -class Derived extends Base { - constructor() { - super(this); // ok - } -} - -class Derived2 extends Base { - constructor(public a: string) { - super(this); // error - } -} - -class Derived3 extends Base { - constructor(public a: string) { - super(() => this); // error - } -} - -class Derived4 extends Base { - constructor(public a: string) { - super(function () { return this; }); // ok - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.json b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.json deleted file mode 100644 index da0f3b1b292..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.json +++ /dev/null @@ -1,8967 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 51, - "end": 7733, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 51, - "end": 79, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 65, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 65, - "end": 73, - "ctxt": 0 - }, - "value": "decorate", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 73, - "end": 78, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 75, - "end": 78, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 87, - "end": 91, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 81, - "end": 153, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 98, - "end": 117, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 98, - "end": 109, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 110, - "end": 112, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "a", - "optional": true, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 123, - "end": 151, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 123, - "end": 139, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 140, - "end": 146, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "value": "param", - "optional": true, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 123, - "end": 151, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 148, - "end": 151, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 161, - "end": 169, - "ctxt": 0 - }, - "value": "Derived1", - "optional": false - }, - "declare": false, - "span": { - "start": 155, - "end": 280, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 189, - "end": 201, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 189, - "end": 193, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 196, - "end": 200, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 206, - "end": 278, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 217, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 220, - "end": 278, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 230, - "end": 255, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 230, - "end": 254, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 230, - "end": 252, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 230, - "end": 235, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 236, - "end": 252, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 264, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 264, - "end": 271, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 264, - "end": 269, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 178, - "end": 182, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 288, - "end": 296, - "ctxt": 0 - }, - "value": "Derived2", - "optional": false - }, - "declare": false, - "span": { - "start": 282, - "end": 411, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 316, - "end": 328, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 323, - "end": 327, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 333, - "end": 409, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 333, - "end": 344, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 347, - "end": 409, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 357, - "end": 386, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 357, - "end": 385, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 357, - "end": 379, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 357, - "end": 362, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 363, - "end": 379, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 380, - "end": 384, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 395, - "end": 403, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 395, - "end": 402, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 395, - "end": 400, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 305, - "end": 309, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 419, - "end": 427, - "ctxt": 0 - }, - "value": "Derived3", - "optional": false - }, - "declare": false, - "span": { - "start": 413, - "end": 542, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 447, - "end": 459, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 454, - "end": 458, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 464, - "end": 540, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 464, - "end": 475, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 478, - "end": 540, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 488, - "end": 513, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 488, - "end": 512, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 488, - "end": 510, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 488, - "end": 493, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 494, - "end": 510, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 522, - "end": 534, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 522, - "end": 533, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 522, - "end": 527, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 528, - "end": 532, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 436, - "end": 440, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 550, - "end": 558, - "ctxt": 0 - }, - "value": "Derived4", - "optional": false - }, - "declare": false, - "span": { - "start": 544, - "end": 677, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 578, - "end": 590, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 578, - "end": 582, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 585, - "end": 589, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 595, - "end": 675, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 595, - "end": 606, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 609, - "end": 675, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 619, - "end": 648, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 619, - "end": 647, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 619, - "end": 641, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 619, - "end": 624, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 625, - "end": 641, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 642, - "end": 646, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 657, - "end": 669, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 657, - "end": 668, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 657, - "end": 662, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 663, - "end": 667, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 567, - "end": 571, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 685, - "end": 693, - "ctxt": 0 - }, - "value": "Derived5", - "optional": false - }, - "declare": false, - "span": { - "start": 679, - "end": 804, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 713, - "end": 725, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 713, - "end": 717, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 720, - "end": 724, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 730, - "end": 802, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 730, - "end": 741, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 744, - "end": 802, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 754, - "end": 762, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 754, - "end": 761, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 754, - "end": 759, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 771, - "end": 796, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 771, - "end": 795, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 771, - "end": 793, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 771, - "end": 776, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 777, - "end": 793, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 702, - "end": 706, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 812, - "end": 820, - "ctxt": 0 - }, - "value": "Derived6", - "optional": false - }, - "declare": false, - "span": { - "start": 806, - "end": 935, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 840, - "end": 852, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 840, - "end": 844, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 847, - "end": 851, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 857, - "end": 933, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 857, - "end": 868, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 871, - "end": 933, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 881, - "end": 893, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 881, - "end": 892, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 881, - "end": 886, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 887, - "end": 891, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 902, - "end": 927, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 902, - "end": 926, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 902, - "end": 924, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 902, - "end": 907, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 908, - "end": 924, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 829, - "end": 833, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 943, - "end": 951, - "ctxt": 0 - }, - "value": "Derived7", - "optional": false - }, - "declare": false, - "span": { - "start": 937, - "end": 1066, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 971, - "end": 983, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 971, - "end": 975, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 978, - "end": 982, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 988, - "end": 1064, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 988, - "end": 999, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1002, - "end": 1064, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1012, - "end": 1020, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1012, - "end": 1019, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1012, - "end": 1017, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1029, - "end": 1058, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1029, - "end": 1057, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 1029, - "end": 1051, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 1029, - "end": 1034, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1035, - "end": 1051, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 1052, - "end": 1056, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 960, - "end": 964, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1074, - "end": 1082, - "ctxt": 0 - }, - "value": "Derived8", - "optional": false - }, - "declare": false, - "span": { - "start": 1068, - "end": 1201, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1102, - "end": 1114, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1102, - "end": 1106, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1109, - "end": 1113, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1119, - "end": 1199, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1130, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1133, - "end": 1199, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1143, - "end": 1155, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1143, - "end": 1154, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1143, - "end": 1148, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 1149, - "end": 1153, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1164, - "end": 1193, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1164, - "end": 1192, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 1164, - "end": 1186, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 1164, - "end": 1169, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1170, - "end": 1186, - "ctxt": 0 - }, - "value": "receivesAnything", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 1187, - "end": 1191, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1095, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1209, - "end": 1233, - "ctxt": 0 - }, - "value": "DerivedWithArrowFunction", - "optional": false - }, - "declare": false, - "span": { - "start": 1203, - "end": 1334, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1253, - "end": 1265, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1253, - "end": 1257, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1260, - "end": 1264, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1270, - "end": 1332, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1270, - "end": 1281, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1284, - "end": 1332, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1294, - "end": 1309, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1294, - "end": 1308, - "ctxt": 0 - }, - "callee": { - "type": "ParenthesisExpression", - "span": { - "start": 1294, - "end": 1306, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1295, - "end": 1305, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 1301, - "end": 1305, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1318, - "end": 1326, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1318, - "end": 1325, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1318, - "end": 1323, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1242, - "end": 1246, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1342, - "end": 1375, - "ctxt": 0 - }, - "value": "DerivedWithArrowFunctionParameter", - "optional": false - }, - "declare": false, - "span": { - "start": 1336, - "end": 1497, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1395, - "end": 1407, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1395, - "end": 1399, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1402, - "end": 1406, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1412, - "end": 1495, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1412, - "end": 1423, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1426, - "end": 1495, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1436, - "end": 1472, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1442, - "end": 1471, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1442, - "end": 1448, - "ctxt": 0 - }, - "value": "lambda", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1451, - "end": 1471, - "ctxt": 0 - }, - "params": [ - { - "type": "AssignmentPattern", - "span": { - "start": 1452, - "end": 1464, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 1452, - "end": 1457, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ThisExpression", - "span": { - "start": 1460, - "end": 1464, - "ctxt": 0 - } - }, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1469, - "end": 1471, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1481, - "end": 1489, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1481, - "end": 1488, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1481, - "end": 1486, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1384, - "end": 1388, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1505, - "end": 1532, - "ctxt": 0 - }, - "value": "DerivedWithDecoratorOnClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1499, - "end": 1663, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1552, - "end": 1564, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1552, - "end": 1556, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1559, - "end": 1563, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1569, - "end": 1661, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1569, - "end": 1580, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1583, - "end": 1661, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1633, - "ctxt": 0 - }, - "value": "InnerClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1593, - "end": 1637, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 1593, - "end": 1608, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1594, - "end": 1608, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1594, - "end": 1602, - "ctxt": 0 - }, - "value": "decorate", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 1603, - "end": 1607, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1647, - "end": 1655, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1647, - "end": 1654, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1647, - "end": 1652, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1541, - "end": 1545, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1671, - "end": 1704, - "ctxt": 0 - }, - "value": "DerivedWithDecoratorOnClassMethod", - "optional": false - }, - "declare": false, - "span": { - "start": 1665, - "end": 1877, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1724, - "end": 1736, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1724, - "end": 1728, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1731, - "end": 1735, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1741, - "end": 1875, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1741, - "end": 1752, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1755, - "end": 1875, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1781, - "ctxt": 0 - }, - "value": "InnerClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1765, - "end": 1851, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1796, - "end": 1841, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1824, - "end": 1835, - "ctxt": 0 - }, - "value": "innerMethod", - "optional": false - }, - "function": { - "params": [], - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 1796, - "end": 1811, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1797, - "end": 1811, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1797, - "end": 1805, - "ctxt": 0 - }, - "value": "decorate", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 1806, - "end": 1810, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ], - "span": { - "start": 1796, - "end": 1841, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1838, - "end": 1841, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1861, - "end": 1869, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1861, - "end": 1868, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1861, - "end": 1866, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1713, - "end": 1717, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1885, - "end": 1920, - "ctxt": 0 - }, - "value": "DerivedWithDecoratorOnClassProperty", - "optional": false - }, - "declare": false, - "span": { - "start": 1879, - "end": 2093, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1940, - "end": 1952, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1940, - "end": 1944, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1947, - "end": 1951, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1957, - "end": 2091, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1957, - "end": 1968, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1971, - "end": 2091, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1987, - "end": 1997, - "ctxt": 0 - }, - "value": "InnerClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1981, - "end": 2067, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2012, - "end": 2057, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2040, - "end": 2049, - "ctxt": 0 - }, - "value": "innerProp", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2052, - "end": 2056, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 2012, - "end": 2027, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2013, - "end": 2027, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2013, - "end": 2021, - "ctxt": 0 - }, - "value": "decorate", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 2022, - "end": 2026, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2077, - "end": 2085, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2077, - "end": 2084, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2077, - "end": 2082, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1929, - "end": 1933, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2101, - "end": 2131, - "ctxt": 0 - }, - "value": "DerivedWithFunctionDeclaration", - "optional": false - }, - "declare": false, - "span": { - "start": 2095, - "end": 2276, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2151, - "end": 2163, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2151, - "end": 2155, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2158, - "end": 2162, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2168, - "end": 2274, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2168, - "end": 2179, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 2182, - "end": 2274, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2201, - "end": 2212, - "ctxt": 0 - }, - "value": "declaration", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 2192, - "end": 2251, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2215, - "end": 2251, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2229, - "end": 2241, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 2236, - "end": 2240, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2260, - "end": 2268, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2260, - "end": 2267, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2260, - "end": 2265, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2140, - "end": 2144, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2284, - "end": 2326, - "ctxt": 0 - }, - "value": "DerivedWithFunctionDeclarationAndThisParam", - "optional": false - }, - "declare": false, - "span": { - "start": 2278, - "end": 2484, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2346, - "end": 2358, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2346, - "end": 2350, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2353, - "end": 2357, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2363, - "end": 2482, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2363, - "end": 2374, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 2377, - "end": 2482, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2396, - "end": 2407, - "ctxt": 0 - }, - "value": "declaration", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2408, - "end": 2420, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 2408, - "end": 2420, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 2408, - "end": 2413, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ThisExpression", - "span": { - "start": 2416, - "end": 2420, - "ctxt": 0 - } - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 2387, - "end": 2459, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2422, - "end": 2459, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2436, - "end": 2449, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 2443, - "end": 2448, - "ctxt": 0 - }, - "value": "param", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2468, - "end": 2476, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2468, - "end": 2475, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2468, - "end": 2473, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2335, - "end": 2339, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2492, - "end": 2521, - "ctxt": 0 - }, - "value": "DerivedWithFunctionExpression", - "optional": false - }, - "declare": false, - "span": { - "start": 2486, - "end": 2660, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2541, - "end": 2553, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2541, - "end": 2545, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2548, - "end": 2552, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2558, - "end": 2658, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2558, - "end": 2569, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 2572, - "end": 2658, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2582, - "end": 2635, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2582, - "end": 2634, - "ctxt": 0 - }, - "callee": { - "type": "ParenthesisExpression", - "span": { - "start": 2582, - "end": 2632, - "ctxt": 0 - }, - "expression": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 2583, - "end": 2631, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2595, - "end": 2631, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2609, - "end": 2621, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 2616, - "end": 2620, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2644, - "end": 2652, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2644, - "end": 2651, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2644, - "end": 2649, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2530, - "end": 2534, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2668, - "end": 2690, - "ctxt": 0 - }, - "value": "DerivedWithParenthesis", - "optional": false - }, - "declare": false, - "span": { - "start": 2662, - "end": 2769, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2710, - "end": 2722, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2710, - "end": 2714, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2717, - "end": 2721, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2727, - "end": 2767, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2727, - "end": 2738, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 2741, - "end": 2767, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2751, - "end": 2761, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 2751, - "end": 2760, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2752, - "end": 2759, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2752, - "end": 2757, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2699, - "end": 2703, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2777, - "end": 2813, - "ctxt": 0 - }, - "value": "DerivedWithParenthesisAfterStatement", - "optional": false - }, - "declare": false, - "span": { - "start": 2771, - "end": 2911, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2833, - "end": 2845, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2833, - "end": 2837, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2840, - "end": 2844, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2850, - "end": 2909, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2850, - "end": 2861, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 2864, - "end": 2909, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2874, - "end": 2884, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2874, - "end": 2883, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2874, - "end": 2878, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2879, - "end": 2883, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2893, - "end": 2903, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 2893, - "end": 2902, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2894, - "end": 2901, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 2894, - "end": 2899, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2822, - "end": 2826, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2919, - "end": 2956, - "ctxt": 0 - }, - "value": "DerivedWithParenthesisBeforeStatement", - "optional": false - }, - "declare": false, - "span": { - "start": 2913, - "end": 3054, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2976, - "end": 2988, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2976, - "end": 2980, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2983, - "end": 2987, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 2993, - "end": 3052, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2993, - "end": 3004, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3007, - "end": 3052, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3017, - "end": 3027, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 3017, - "end": 3026, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3018, - "end": 3025, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 3018, - "end": 3023, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3036, - "end": 3046, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 3036, - "end": 3045, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3036, - "end": 3040, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3041, - "end": 3045, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2965, - "end": 2969, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3062, - "end": 3089, - "ctxt": 0 - }, - "value": "DerivedWithClassDeclaration", - "optional": false - }, - "declare": false, - "span": { - "start": 3056, - "end": 3415, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3109, - "end": 3121, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3109, - "end": 3113, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 3116, - "end": 3120, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 3126, - "end": 3413, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3126, - "end": 3137, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3140, - "end": 3413, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3156, - "end": 3166, - "ctxt": 0 - }, - "value": "InnerClass", - "optional": false - }, - "declare": false, - "span": { - "start": 3150, - "end": 3390, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 3181, - "end": 3242, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3189, - "end": 3195, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3181, - "end": 3242, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3198, - "end": 3242, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 3216, - "end": 3228, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 3223, - "end": 3227, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 3255, - "end": 3276, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3263, - "end": 3271, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 3274, - "end": 3275, - "ctxt": 0 - }, - "value": 7.0, - "raw": "7" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 3289, - "end": 3380, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3289, - "end": 3300, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3303, - "end": 3380, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3321, - "end": 3335, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 3321, - "end": 3334, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3321, - "end": 3325, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3326, - "end": 3334, - "ctxt": 0 - }, - "value": "property", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3352, - "end": 3366, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3352, - "end": 3365, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 3352, - "end": 3363, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3352, - "end": 3356, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3357, - "end": 3363, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3399, - "end": 3407, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3399, - "end": 3406, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 3399, - "end": 3404, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 3098, - "end": 3102, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3423, - "end": 3465, - "ctxt": 0 - }, - "value": "DerivedWithClassDeclarationExtendingMember", - "optional": false - }, - "declare": false, - "span": { - "start": 3417, - "end": 3853, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3485, - "end": 3509, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3485, - "end": 3496, - "ctxt": 0 - }, - "value": "memberClass", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 3499, - "end": 3508, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 3514, - "end": 3851, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3514, - "end": 3525, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3528, - "end": 3851, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3544, - "end": 3554, - "ctxt": 0 - }, - "value": "InnerClass", - "optional": false - }, - "declare": false, - "span": { - "start": 3538, - "end": 3828, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 3594, - "end": 3655, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3602, - "end": 3608, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3594, - "end": 3655, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3611, - "end": 3655, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 3629, - "end": 3641, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 3636, - "end": 3640, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 3668, - "end": 3689, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3676, - "end": 3684, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 3687, - "end": 3688, - "ctxt": 0 - }, - "value": 7.0, - "raw": "7" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 3702, - "end": 3818, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3702, - "end": 3713, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3716, - "end": 3818, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3734, - "end": 3742, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3734, - "end": 3741, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 3734, - "end": 3739, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3759, - "end": 3773, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 3759, - "end": 3772, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3759, - "end": 3763, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3764, - "end": 3772, - "ctxt": 0 - }, - "value": "property", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3790, - "end": 3804, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3790, - "end": 3803, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 3790, - "end": 3801, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3790, - "end": 3794, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3795, - "end": 3801, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 3563, - "end": 3579, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 3563, - "end": 3567, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3568, - "end": 3579, - "ctxt": 0 - }, - "value": "memberClass", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3837, - "end": 3845, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3837, - "end": 3844, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 3837, - "end": 3842, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 3474, - "end": 3478, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3861, - "end": 3887, - "ctxt": 0 - }, - "value": "DerivedWithClassExpression", - "optional": false - }, - "declare": false, - "span": { - "start": 3855, - "end": 4216, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3907, - "end": 3919, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3907, - "end": 3911, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 3914, - "end": 3918, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 3924, - "end": 4214, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3924, - "end": 3935, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 3938, - "end": 4214, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3948, - "end": 4191, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3948, - "end": 4190, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 3948, - "end": 3959, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 3948, - "end": 3955, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 3956, - "end": 3959, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 3960, - "end": 4189, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 3980, - "end": 4041, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3988, - "end": 3994, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3980, - "end": 4041, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3997, - "end": 4041, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 4015, - "end": 4027, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 4022, - "end": 4026, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 4054, - "end": 4075, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4062, - "end": 4070, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 4073, - "end": 4074, - "ctxt": 0 - }, - "value": 7.0, - "raw": "7" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 4088, - "end": 4179, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4088, - "end": 4099, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4102, - "end": 4179, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4120, - "end": 4134, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 4120, - "end": 4133, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 4120, - "end": 4124, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 4125, - "end": 4133, - "ctxt": 0 - }, - "value": "property", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4151, - "end": 4165, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4151, - "end": 4164, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 4151, - "end": 4162, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 4151, - "end": 4155, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 4156, - "end": 4162, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4200, - "end": 4208, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4200, - "end": 4207, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4200, - "end": 4205, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 3896, - "end": 3900, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4224, - "end": 4265, - "ctxt": 0 - }, - "value": "DerivedWithClassExpressionExtendingMember", - "optional": false - }, - "declare": false, - "span": { - "start": 4218, - "end": 4411, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 4285, - "end": 4309, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4285, - "end": 4296, - "ctxt": 0 - }, - "value": "memberClass", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 4299, - "end": 4308, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 4314, - "end": 4409, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4314, - "end": 4325, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4328, - "end": 4409, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4338, - "end": 4386, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4338, - "end": 4385, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 4338, - "end": 4349, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4338, - "end": 4345, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4346, - "end": 4349, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 4350, - "end": 4384, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 4364, - "end": 4380, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 4364, - "end": 4368, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 4369, - "end": 4380, - "ctxt": 0 - }, - "value": "memberClass", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4395, - "end": 4403, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4395, - "end": 4402, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4395, - "end": 4400, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4274, - "end": 4278, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4419, - "end": 4452, - "ctxt": 0 - }, - "value": "DerivedWithDerivedClassExpression", - "optional": false - }, - "declare": false, - "span": { - "start": 4413, - "end": 4756, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 4472, - "end": 4484, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4472, - "end": 4476, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 4479, - "end": 4483, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 4489, - "end": 4754, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4489, - "end": 4500, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4503, - "end": 4754, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4513, - "end": 4731, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4513, - "end": 4730, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 4513, - "end": 4524, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4513, - "end": 4520, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4521, - "end": 4524, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 4525, - "end": 4729, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 4558, - "end": 4612, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4558, - "end": 4569, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4572, - "end": 4612, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4590, - "end": 4598, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4590, - "end": 4597, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4590, - "end": 4595, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 4625, - "end": 4682, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4632, - "end": 4635, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 4625, - "end": 4682, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 4638, - "end": 4682, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 4656, - "end": 4668, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 4663, - "end": 4667, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 4695, - "end": 4719, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4702, - "end": 4705, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 4708, - "end": 4718, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 4714, - "end": 4718, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4539, - "end": 4543, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4740, - "end": 4748, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4740, - "end": 4747, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4740, - "end": 4745, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4461, - "end": 4465, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4764, - "end": 4800, - "ctxt": 0 - }, - "value": "DerivedWithNewDerivedClassExpression", - "optional": false - }, - "declare": false, - "span": { - "start": 4758, - "end": 5003, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 4820, - "end": 4832, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4820, - "end": 4824, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 4827, - "end": 4831, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 4837, - "end": 5001, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4837, - "end": 4848, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4851, - "end": 5001, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4861, - "end": 4978, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4861, - "end": 4977, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 4861, - "end": 4872, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4861, - "end": 4868, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4869, - "end": 4872, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NewExpression", - "span": { - "start": 4873, - "end": 4976, - "ctxt": 0 - }, - "callee": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 4877, - "end": 4974, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 4910, - "end": 4964, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4910, - "end": 4921, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 4924, - "end": 4964, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4942, - "end": 4950, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4942, - "end": 4949, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4942, - "end": 4947, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4891, - "end": 4895, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "arguments": [], - "typeArguments": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4987, - "end": 4995, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4987, - "end": 4994, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 4987, - "end": 4992, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4809, - "end": 4813, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 5011, - "end": 5037, - "ctxt": 0 - }, - "value": "DerivedWithObjectAccessors", - "optional": false - }, - "declare": false, - "span": { - "start": 5005, - "end": 5296, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 5057, - "end": 5069, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5057, - "end": 5061, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 5064, - "end": 5068, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 5074, - "end": 5294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5074, - "end": 5085, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 5088, - "end": 5294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 5098, - "end": 5271, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5104, - "end": 5270, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5104, - "end": 5107, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 5110, - "end": 5270, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 5124, - "end": 5179, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5128, - "end": 5132, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 5135, - "end": 5179, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 5153, - "end": 5165, - "ctxt": 0 - }, - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 5160, - "end": 5164, - "ctxt": 0 - }, - "value": true - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 5193, - "end": 5260, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5197, - "end": 5201, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 5202, - "end": 5207, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 5209, - "end": 5260, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 5227, - "end": 5246, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 5227, - "end": 5245, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 5227, - "end": 5237, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5227, - "end": 5231, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5232, - "end": 5237, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 5240, - "end": 5245, - "ctxt": 0 - }, - "value": "param", - "optional": false - } - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 5280, - "end": 5288, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5280, - "end": 5287, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 5280, - "end": 5285, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 5046, - "end": 5050, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 5304, - "end": 5345, - "ctxt": 0 - }, - "value": "DerivedWithObjectAccessorsUsingThisInKeys", - "optional": false - }, - "declare": false, - "span": { - "start": 5298, - "end": 5659, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 5365, - "end": 5383, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5365, - "end": 5373, - "ctxt": 0 - }, - "value": "propName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 5376, - "end": 5382, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 5388, - "end": 5657, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5388, - "end": 5399, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 5402, - "end": 5657, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 5412, - "end": 5634, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5418, - "end": 5633, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5418, - "end": 5421, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 5424, - "end": 5633, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 5438, - "end": 5443, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 5445, - "end": 5451, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 5465, - "end": 5531, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 5469, - "end": 5484, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 5470, - "end": 5483, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5470, - "end": 5474, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5475, - "end": 5483, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 5487, - "end": 5531, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 5505, - "end": 5517, - "ctxt": 0 - }, - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 5512, - "end": 5516, - "ctxt": 0 - }, - "value": true - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 5545, - "end": 5623, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 5549, - "end": 5564, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 5550, - "end": 5563, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5550, - "end": 5554, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5555, - "end": 5563, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - } - }, - "param": { - "type": "Identifier", - "span": { - "start": 5565, - "end": 5570, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 5572, - "end": 5623, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 5590, - "end": 5609, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 5590, - "end": 5608, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 5590, - "end": 5600, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5590, - "end": 5594, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5595, - "end": 5600, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 5603, - "end": 5608, - "ctxt": 0 - }, - "value": "param", - "optional": false - } - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 5643, - "end": 5651, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5643, - "end": 5650, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 5643, - "end": 5648, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 5354, - "end": 5358, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 5667, - "end": 5710, - "ctxt": 0 - }, - "value": "DerivedWithObjectAccessorsUsingThisInBodies", - "optional": false - }, - "declare": false, - "span": { - "start": 5661, - "end": 6008, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 5730, - "end": 5748, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5730, - "end": 5738, - "ctxt": 0 - }, - "value": "propName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 5741, - "end": 5747, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 5753, - "end": 6006, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5753, - "end": 5764, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 5767, - "end": 6006, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 5777, - "end": 5983, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5783, - "end": 5982, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5783, - "end": 5786, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 5789, - "end": 5982, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 5803, - "end": 5808, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 5810, - "end": 5816, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - } - }, - { - "type": "GetterProperty", - "span": { - "start": 5830, - "end": 5891, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5834, - "end": 5838, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 5841, - "end": 5891, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 5859, - "end": 5877, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 5866, - "end": 5876, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5866, - "end": 5870, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5871, - "end": 5876, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - } - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 5905, - "end": 5972, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 5909, - "end": 5913, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 5914, - "end": 5919, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 5921, - "end": 5972, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 5939, - "end": 5958, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 5939, - "end": 5957, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 5939, - "end": 5949, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 5939, - "end": 5943, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 5944, - "end": 5949, - "ctxt": 0 - }, - "value": "_prop", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 5952, - "end": 5957, - "ctxt": 0 - }, - "value": "param", - "optional": false - } - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 5992, - "end": 6000, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5992, - "end": 5999, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 5992, - "end": 5997, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 5719, - "end": 5723, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 6016, - "end": 6053, - "ctxt": 0 - }, - "value": "DerivedWithObjectComputedPropertyBody", - "optional": false - }, - "declare": false, - "span": { - "start": 6010, - "end": 6202, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6073, - "end": 6091, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6073, - "end": 6081, - "ctxt": 0 - }, - "value": "propName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 6084, - "end": 6090, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6096, - "end": 6200, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6096, - "end": 6107, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6110, - "end": 6200, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 6120, - "end": 6177, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6126, - "end": 6176, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6126, - "end": 6129, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 6132, - "end": 6176, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 6146, - "end": 6150, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 6152, - "end": 6165, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 6152, - "end": 6156, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 6157, - "end": 6165, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 6186, - "end": 6194, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 6186, - "end": 6193, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6186, - "end": 6191, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6062, - "end": 6066, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 6210, - "end": 6247, - "ctxt": 0 - }, - "value": "DerivedWithObjectComputedPropertyName", - "optional": false - }, - "declare": false, - "span": { - "start": 6204, - "end": 6398, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6267, - "end": 6285, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6267, - "end": 6275, - "ctxt": 0 - }, - "value": "propName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 6278, - "end": 6284, - "ctxt": 0 - }, - "value": "prop", - "raw": "\"prop\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6290, - "end": 6396, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6290, - "end": 6301, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6304, - "end": 6396, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 6314, - "end": 6373, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6320, - "end": 6372, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6320, - "end": 6323, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 6326, - "end": 6372, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 6340, - "end": 6355, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 6341, - "end": 6354, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 6341, - "end": 6345, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 6346, - "end": 6354, - "ctxt": 0 - }, - "value": "propName", - "optional": false - } - } - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 6357, - "end": 6361, - "ctxt": 0 - }, - "value": true - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 6382, - "end": 6390, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 6382, - "end": 6389, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6382, - "end": 6387, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6256, - "end": 6260, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 6406, - "end": 6429, - "ctxt": 0 - }, - "value": "DerivedWithObjectMethod", - "optional": false - }, - "declare": false, - "span": { - "start": 6400, - "end": 6607, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6449, - "end": 6461, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6449, - "end": 6453, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 6456, - "end": 6460, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6466, - "end": 6605, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6466, - "end": 6477, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6480, - "end": 6605, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 6490, - "end": 6582, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6496, - "end": 6581, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6496, - "end": 6499, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 6502, - "end": 6581, - "ctxt": 0 - }, - "properties": [ - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 6516, - "end": 6523, - "ctxt": 0 - }, - "value": "getProp", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 6516, - "end": 6570, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 6526, - "end": 6570, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 6544, - "end": 6556, - "ctxt": 0 - }, - "argument": { - "type": "ThisExpression", - "span": { - "start": 6551, - "end": 6555, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 6591, - "end": 6599, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 6591, - "end": 6598, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6591, - "end": 6596, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6438, - "end": 6442, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6609, - "end": 6618, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6613, - "end": 6614, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6613, - "end": 6614, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 6616, - "end": 6617, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6616, - "end": 6617, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6620, - "end": 7733, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6626, - "end": 7733, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6626, - "end": 6642, - "ctxt": 0 - }, - "value": "DerivedWithLoops", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 6645, - "end": 7733, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 6651, - "end": 6762, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6680, - "end": 6692, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6680, - "end": 6684, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 6687, - "end": 6691, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6701, - "end": 6756, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6701, - "end": 6712, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6715, - "end": 6756, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForStatement", - "span": { - "start": 6729, - "end": 6746, - "ctxt": 0 - }, - "init": { - "type": "CallExpression", - "span": { - "start": 6733, - "end": 6740, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6733, - "end": 6738, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "test": null, - "update": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 6744, - "end": 6746, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6665, - "end": 6669, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 6768, - "end": 6881, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6797, - "end": 6809, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6797, - "end": 6801, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 6804, - "end": 6808, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6818, - "end": 6875, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6818, - "end": 6829, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6832, - "end": 6875, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForStatement", - "span": { - "start": 6846, - "end": 6865, - "ctxt": 0 - }, - "init": { - "type": "Identifier", - "span": { - "start": 6850, - "end": 6851, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "test": { - "type": "CallExpression", - "span": { - "start": 6853, - "end": 6860, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6853, - "end": 6858, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "update": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 6863, - "end": 6865, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6782, - "end": 6786, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 6887, - "end": 7002, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 6916, - "end": 6928, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6916, - "end": 6920, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 6923, - "end": 6927, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 6937, - "end": 6996, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 6937, - "end": 6948, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 6951, - "end": 6996, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForStatement", - "span": { - "start": 6965, - "end": 6986, - "ctxt": 0 - }, - "init": { - "type": "Identifier", - "span": { - "start": 6969, - "end": 6970, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "test": { - "type": "Identifier", - "span": { - "start": 6972, - "end": 6973, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "update": { - "type": "CallExpression", - "span": { - "start": 6975, - "end": 6982, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 6975, - "end": 6980, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 6984, - "end": 6986, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 6901, - "end": 6905, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7008, - "end": 7129, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7037, - "end": 7049, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7037, - "end": 7041, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7044, - "end": 7048, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7058, - "end": 7123, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7058, - "end": 7069, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7072, - "end": 7123, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForStatement", - "span": { - "start": 7086, - "end": 7113, - "ctxt": 0 - }, - "init": null, - "test": null, - "update": { - "type": "CallExpression", - "span": { - "start": 7094, - "end": 7101, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7094, - "end": 7099, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 7103, - "end": 7113, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 7105, - "end": 7111, - "ctxt": 0 - }, - "label": null - } - ] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7022, - "end": 7026, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7135, - "end": 7256, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7164, - "end": 7176, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7164, - "end": 7168, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7171, - "end": 7175, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7185, - "end": 7250, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7185, - "end": 7196, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7199, - "end": 7250, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ForOfStatement", - "span": { - "start": 7213, - "end": 7240, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 7218, - "end": 7225, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 7224, - "end": 7225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 7224, - "end": 7225, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "CallExpression", - "span": { - "start": 7229, - "end": 7236, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7229, - "end": 7234, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 7238, - "end": 7240, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7149, - "end": 7153, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7262, - "end": 7374, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7291, - "end": 7303, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7291, - "end": 7295, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7298, - "end": 7302, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7312, - "end": 7368, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7312, - "end": 7323, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7326, - "end": 7368, - "ctxt": 0 - }, - "stmts": [ - { - "type": "WhileStatement", - "span": { - "start": 7340, - "end": 7358, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 7347, - "end": 7354, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7347, - "end": 7352, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 7356, - "end": 7358, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7276, - "end": 7280, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7380, - "end": 7496, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7409, - "end": 7421, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7409, - "end": 7413, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7416, - "end": 7420, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7430, - "end": 7490, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7430, - "end": 7441, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7444, - "end": 7490, - "ctxt": 0 - }, - "stmts": [ - { - "type": "DoWhileStatement", - "span": { - "start": 7458, - "end": 7480, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 7471, - "end": 7478, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7471, - "end": 7476, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 7461, - "end": 7463, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7394, - "end": 7398, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7502, - "end": 7611, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7531, - "end": 7543, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7531, - "end": 7535, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7538, - "end": 7542, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7552, - "end": 7605, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7552, - "end": 7563, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7566, - "end": 7605, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 7580, - "end": 7595, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 7584, - "end": 7591, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7584, - "end": 7589, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 7593, - "end": 7595, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7516, - "end": 7520, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "spread": null, - "expression": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 7617, - "end": 7730, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 7646, - "end": 7658, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7646, - "end": 7650, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 7653, - "end": 7657, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 7667, - "end": 7724, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 7667, - "end": 7678, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 7681, - "end": 7724, - "ctxt": 0 - }, - "stmts": [ - { - "type": "SwitchStatement", - "span": { - "start": 7695, - "end": 7714, - "ctxt": 0 - }, - "discriminant": { - "type": "CallExpression", - "span": { - "start": 7703, - "end": 7710, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 7703, - "end": 7708, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "cases": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 7631, - "end": 7635, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.ts b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.ts deleted file mode 100644 index 5e218464490..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperProperties.ts +++ /dev/null @@ -1,403 +0,0 @@ -// @experimentaldecorators: true -// @target: ES5 - -declare const decorate: any; - -class Base { - constructor(a?) { } - - receivesAnything(param?) { } -} - -class Derived1 extends Base { - prop = true; - constructor() { - super.receivesAnything(); - super(); - } -} - -class Derived2 extends Base { - prop = true; - constructor() { - super.receivesAnything(this); - super(); - } -} - -class Derived3 extends Base { - prop = true; - constructor() { - super.receivesAnything(); - super(this); - } -} - -class Derived4 extends Base { - prop = true; - constructor() { - super.receivesAnything(this); - super(this); - } -} - -class Derived5 extends Base { - prop = true; - constructor() { - super(); - super.receivesAnything(); - } -} - -class Derived6 extends Base { - prop = true; - constructor() { - super(this); - super.receivesAnything(); - } -} - -class Derived7 extends Base { - prop = true; - constructor() { - super(); - super.receivesAnything(this); - } -} - -class Derived8 extends Base { - prop = true; - constructor() { - super(this); - super.receivesAnything(this); - } -} - -class DerivedWithArrowFunction extends Base { - prop = true; - constructor() { - (() => this)(); - super(); - } -} - -class DerivedWithArrowFunctionParameter extends Base { - prop = true; - constructor() { - const lambda = (param = this) => {}; - super(); - } -} - -class DerivedWithDecoratorOnClass extends Base { - prop = true; - constructor() { - @decorate(this) - class InnerClass { } - - super(); - } -} - -class DerivedWithDecoratorOnClassMethod extends Base { - prop = true; - constructor() { - class InnerClass { - @decorate(this) - innerMethod() { } - } - - super(); - } -} - -class DerivedWithDecoratorOnClassProperty extends Base { - prop = true; - constructor() { - class InnerClass { - @decorate(this) - innerProp = true; - } - - super(); - } -} - -class DerivedWithFunctionDeclaration extends Base { - prop = true; - constructor() { - function declaration() { - return this; - } - super(); - } -} - -class DerivedWithFunctionDeclarationAndThisParam extends Base { - prop = true; - constructor() { - function declaration(param = this) { - return param; - } - super(); - } -} - -class DerivedWithFunctionExpression extends Base { - prop = true; - constructor() { - (function () { - return this; - })(); - super(); - } -} - -class DerivedWithParenthesis extends Base { - prop = true; - constructor() { - (super()); - } -} - -class DerivedWithParenthesisAfterStatement extends Base { - prop = true; - constructor() { - this.prop; - (super()); - } -} - -class DerivedWithParenthesisBeforeStatement extends Base { - prop = true; - constructor() { - (super()); - this.prop; - } -} - -class DerivedWithClassDeclaration extends Base { - prop = true; - constructor() { - class InnerClass { - private method() { - return this; - } - private property = 7; - constructor() { - this.property; - this.method(); - } - } - super(); - } -} - -class DerivedWithClassDeclarationExtendingMember extends Base { - memberClass = class { }; - constructor() { - class InnerClass extends this.memberClass { - private method() { - return this; - } - private property = 7; - constructor() { - super(); - this.property; - this.method(); - } - } - super(); - } -} - -class DerivedWithClassExpression extends Base { - prop = true; - constructor() { - console.log(class { - private method() { - return this; - } - private property = 7; - constructor() { - this.property; - this.method(); - } - }); - super(); - } -} - -class DerivedWithClassExpressionExtendingMember extends Base { - memberClass = class { }; - constructor() { - console.log(class extends this.memberClass { }); - super(); - } -} - -class DerivedWithDerivedClassExpression extends Base { - prop = true; - constructor() { - console.log(class extends Base { - constructor() { - super(); - } - public foo() { - return this; - } - public bar = () => this; - }); - super(); - } -} - -class DerivedWithNewDerivedClassExpression extends Base { - prop = true; - constructor() { - console.log(new class extends Base { - constructor() { - super(); - } - }()); - super(); - } -} - -class DerivedWithObjectAccessors extends Base { - prop = true; - constructor() { - const obj = { - get prop() { - return true; - }, - set prop(param) { - this._prop = param; - } - }; - super(); - } -} - -class DerivedWithObjectAccessorsUsingThisInKeys extends Base { - propName = "prop"; - constructor() { - const obj = { - _prop: "prop", - get [this.propName]() { - return true; - }, - set [this.propName](param) { - this._prop = param; - } - }; - super(); - } -} - -class DerivedWithObjectAccessorsUsingThisInBodies extends Base { - propName = "prop"; - constructor() { - const obj = { - _prop: "prop", - get prop() { - return this._prop; - }, - set prop(param) { - this._prop = param; - } - }; - super(); - } -} - -class DerivedWithObjectComputedPropertyBody extends Base { - propName = "prop"; - constructor() { - const obj = { - prop: this.propName, - }; - super(); - } -} - -class DerivedWithObjectComputedPropertyName extends Base { - propName = "prop"; - constructor() { - const obj = { - [this.propName]: true, - }; - super(); - } -} - -class DerivedWithObjectMethod extends Base { - prop = true; - constructor() { - const obj = { - getProp() { - return this; - }, - }; - super(); - } -} - -let a, b; - -const DerivedWithLoops = [ - class extends Base { - prop = true; - constructor() { - for(super();;) {} - } - }, - class extends Base { - prop = true; - constructor() { - for(a; super();) {} - } - }, - class extends Base { - prop = true; - constructor() { - for(a; b; super()) {} - } - }, - class extends Base { - prop = true; - constructor() { - for(; ; super()) { break; } - } - }, - class extends Base { - prop = true; - constructor() { - for (const x of super()) {} - } - }, - class extends Base { - prop = true; - constructor() { - while (super()) {} - } - }, - class extends Base { - prop = true; - constructor() { - do {} while (super()); - } - }, - class extends Base { - prop = true; - constructor() { - if (super()) {} - } - }, - class extends Base { - prop = true; - constructor() { - switch (super()) {} - } - }, -] diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.json b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.json deleted file mode 100644 index 095025b6dbf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.json +++ /dev/null @@ -1,2300 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 1681, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 36, - "ctxt": 0 - }, - "value": "DerivedBasic", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 112, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 58, - "end": 67, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 58, - "end": 62, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 72, - "end": 110, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 72, - "end": 83, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 86, - "end": 110, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 96, - "end": 104, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 96, - "end": 103, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 96, - "end": 101, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 45, - "end": 51, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 120, - "end": 148, - "ctxt": 0 - }, - "value": "DerivedAfterParameterDefault", - "optional": false - }, - "declare": false, - "span": { - "start": 114, - "end": 296, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 170, - "end": 182, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 172, - "ctxt": 0 - }, - "value": "x1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 181, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 187, - "end": 199, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 187, - "end": 189, - "ctxt": 0 - }, - "value": "x2", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 198, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 198, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 204, - "end": 294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 215, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 216, - "end": 225, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 216, - "end": 225, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 220, - "end": 225, - "ctxt": 0 - }, - "value": false - }, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 227, - "end": 294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 237, - "end": 249, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 237, - "end": 248, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 237, - "end": 244, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 237, - "end": 241, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 242, - "end": 244, - "ctxt": 0 - }, - "value": "x1", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 258, - "end": 267, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 258, - "end": 266, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 258, - "end": 263, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 264, - "end": 265, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 276, - "end": 288, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 276, - "end": 287, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 276, - "end": 283, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 276, - "end": 280, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 281, - "end": 283, - "ctxt": 0 - }, - "value": "x2", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 157, - "end": 163, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 304, - "end": 329, - "ctxt": 0 - }, - "value": "DerivedAfterRestParameter", - "optional": false - }, - "declare": false, - "span": { - "start": 298, - "end": 487, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 351, - "end": 365, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 351, - "end": 353, - "ctxt": 0 - }, - "value": "x1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 353, - "end": 364, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 355, - "end": 364, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 355, - "end": 362, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 370, - "end": 384, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 370, - "end": 372, - "ctxt": 0 - }, - "value": "x2", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 372, - "end": 383, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 374, - "end": 383, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 374, - "end": 381, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 389, - "end": 485, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 389, - "end": 400, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 401, - "end": 416, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 401, - "end": 416, - "ctxt": 0 - }, - "rest": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 404, - "end": 405, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 405, - "end": 416, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 407, - "end": 416, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 407, - "end": 414, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 418, - "end": 485, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 428, - "end": 440, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 428, - "end": 439, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 428, - "end": 435, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 428, - "end": 432, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 433, - "end": 435, - "ctxt": 0 - }, - "value": "x1", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 438, - "end": 439, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 449, - "end": 458, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 449, - "end": 457, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 449, - "end": 454, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 455, - "end": 456, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 467, - "end": 479, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 467, - "end": 478, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 467, - "end": 474, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 467, - "end": 471, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 472, - "end": 474, - "ctxt": 0 - }, - "value": "x2", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 338, - "end": 344, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 495, - "end": 510, - "ctxt": 0 - }, - "value": "DerivedComments", - "optional": false - }, - "declare": false, - "span": { - "start": 489, - "end": 704, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 532, - "end": 539, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 533, - "end": 538, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 535, - "end": 538, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 544, - "end": 702, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 544, - "end": 555, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 558, - "end": 702, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 582, - "end": 596, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 582, - "end": 595, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 582, - "end": 593, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 582, - "end": 589, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 590, - "end": 593, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 625, - "end": 633, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 625, - "end": 632, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 625, - "end": 630, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 662, - "end": 676, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 662, - "end": 675, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 662, - "end": 668, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 662, - "end": 666, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 671, - "end": 675, - "ctxt": 0 - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 519, - "end": 525, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 712, - "end": 738, - "ctxt": 0 - }, - "value": "DerivedCommentsInvalidThis", - "optional": false - }, - "declare": false, - "span": { - "start": 706, - "end": 960, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 760, - "end": 767, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 760, - "end": 761, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 761, - "end": 766, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 763, - "end": 766, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 772, - "end": 958, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 772, - "end": 783, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 786, - "end": 958, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 810, - "end": 815, - "ctxt": 0 - }, - "expression": { - "type": "ThisExpression", - "span": { - "start": 810, - "end": 814, - "ctxt": 0 - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 838, - "end": 852, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 838, - "end": 851, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 838, - "end": 849, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 838, - "end": 845, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 846, - "end": 849, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 881, - "end": 889, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 881, - "end": 888, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 881, - "end": 886, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 918, - "end": 932, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 918, - "end": 931, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 918, - "end": 924, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 918, - "end": 922, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 923, - "end": 924, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 927, - "end": 931, - "ctxt": 0 - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 747, - "end": 753, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 968, - "end": 988, - "ctxt": 0 - }, - "value": "DerivedInConditional", - "optional": false - }, - "declare": false, - "span": { - "start": 962, - "end": 1116, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1010, - "end": 1019, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1010, - "end": 1014, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1017, - "end": 1018, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1024, - "end": 1114, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1024, - "end": 1035, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1038, - "end": 1114, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1048, - "end": 1108, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 1048, - "end": 1107, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1048, - "end": 1061, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1048, - "end": 1059, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1048, - "end": 1052, - "ctxt": 0 - }, - "value": "Math", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1053, - "end": 1059, - "ctxt": 0 - }, - "value": "random", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "CallExpression", - "span": { - "start": 1076, - "end": 1084, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1076, - "end": 1081, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1082, - "end": 1083, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - }, - "alternate": { - "type": "CallExpression", - "span": { - "start": 1099, - "end": 1107, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1099, - "end": 1104, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1105, - "end": 1106, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ], - "typeArguments": null - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 997, - "end": 1003, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1124, - "end": 1135, - "ctxt": 0 - }, - "value": "DerivedInIf", - "optional": false - }, - "declare": false, - "span": { - "start": 1118, - "end": 1302, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1157, - "end": 1166, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1157, - "end": 1161, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1164, - "end": 1165, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1171, - "end": 1300, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1171, - "end": 1182, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1185, - "end": 1300, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 1195, - "end": 1294, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1199, - "end": 1212, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1199, - "end": 1210, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1199, - "end": 1203, - "ctxt": 0 - }, - "value": "Math", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1204, - "end": 1210, - "ctxt": 0 - }, - "value": "random", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1214, - "end": 1247, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1228, - "end": 1237, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1228, - "end": 1236, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1228, - "end": 1233, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1234, - "end": 1235, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 1261, - "end": 1294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1275, - "end": 1284, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1275, - "end": 1283, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1275, - "end": 1280, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1281, - "end": 1282, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ], - "typeArguments": null - } - } - ] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1144, - "end": 1150, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1310, - "end": 1338, - "ctxt": 0 - }, - "value": "DerivedInBlockWithProperties", - "optional": false - }, - "declare": false, - "span": { - "start": 1304, - "end": 1459, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1360, - "end": 1369, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1360, - "end": 1364, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1367, - "end": 1368, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1374, - "end": 1457, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1374, - "end": 1385, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 1386, - "end": 1407, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "private", - "override": false, - "readonly": false, - "param": { - "type": "AssignmentPattern", - "span": { - "start": 1394, - "end": 1407, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 1394, - "end": 1403, - "ctxt": 0 - }, - "value": "paramProp", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1406, - "end": 1407, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1409, - "end": 1457, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BlockStatement", - "span": { - "start": 1419, - "end": 1451, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1433, - "end": 1441, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1433, - "end": 1440, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1433, - "end": 1438, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1347, - "end": 1353, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1467, - "end": 1501, - "ctxt": 0 - }, - "value": "DerivedInConditionalWithProperties", - "optional": false - }, - "declare": false, - "span": { - "start": 1461, - "end": 1681, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1523, - "end": 1532, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1523, - "end": 1527, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1530, - "end": 1531, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1537, - "end": 1679, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1537, - "end": 1548, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 1549, - "end": 1570, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "private", - "override": false, - "readonly": false, - "param": { - "type": "AssignmentPattern", - "span": { - "start": 1557, - "end": 1570, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 1557, - "end": 1566, - "ctxt": 0 - }, - "value": "paramProp", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1569, - "end": 1570, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1572, - "end": 1679, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 1582, - "end": 1673, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 1586, - "end": 1599, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1586, - "end": 1597, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1586, - "end": 1590, - "ctxt": 0 - }, - "value": "Math", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1591, - "end": 1597, - "ctxt": 0 - }, - "value": "random", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1601, - "end": 1634, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1615, - "end": 1624, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1615, - "end": 1623, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1615, - "end": 1620, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1621, - "end": 1622, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 1640, - "end": 1673, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1654, - "end": 1663, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1654, - "end": 1662, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1654, - "end": 1659, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1660, - "end": 1661, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ], - "typeArguments": null - } - } - ] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1516, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.ts b/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.ts deleted file mode 100644 index fc836fd43c5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedClassSuperStatementPosition.ts +++ /dev/null @@ -1,97 +0,0 @@ -// @target: ES5 - -class DerivedBasic extends Object { - prop = 1; - constructor() { - super(); - } -} - -class DerivedAfterParameterDefault extends Object { - x1: boolean; - x2: boolean; - constructor(x = false) { - this.x1 = x; - super(x); - this.x2 = x; - } -} - -class DerivedAfterRestParameter extends Object { - x1: boolean[]; - x2: boolean[]; - constructor(...x: boolean[]) { - this.x1 = x; - super(x); - this.x2 = x; - } -} - -class DerivedComments extends Object { - x: any; - constructor() { - // c1 - console.log(); // c2 - // c3 - super(); // c4 - // c5 - this.x = null; // c6 - // c7 - } -} - -class DerivedCommentsInvalidThis extends Object { - x: any; - constructor() { - // c0 - this; - // c1 - console.log(); // c2 - // c3 - super(); // c4 - // c5 - this.x = null; // c6 - // c7 - } -} - -class DerivedInConditional extends Object { - prop = 1; - constructor() { - Math.random() - ? super(1) - : super(0); - } -} - -class DerivedInIf extends Object { - prop = 1; - constructor() { - if (Math.random()) { - super(1); - } - else { - super(0); - } - } -} - -class DerivedInBlockWithProperties extends Object { - prop = 1; - constructor(private paramProp = 2) { - { - super(); - } - } -} - -class DerivedInConditionalWithProperties extends Object { - prop = 1; - constructor(private paramProp = 2) { - if (Math.random()) { - super(1); - } else { - super(0); - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.json b/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.json deleted file mode 100644 index c789f4816c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.json +++ /dev/null @@ -1,2452 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 1495, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 70, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 32, - "end": 47, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 40, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 43, - "end": 46, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 52, - "end": 68, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 52, - "end": 53, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 52, - "end": 68, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 56, - "end": 68, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 58, - "end": 66, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 77, - "end": 78, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 71, - "end": 120, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 95, - "end": 109, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 95, - "end": 103, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 105, - "end": 108, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 127, - "end": 129, - "ctxt": 0 - }, - "value": "BD", - "optional": false - }, - "declare": false, - "span": { - "start": 121, - "end": 212, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 146, - "end": 168, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 164, - "end": 167, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 219, - "end": 225, - "ctxt": 0 - }, - "value": "BDBang", - "optional": false - }, - "declare": false, - "span": { - "start": 213, - "end": 319, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 242, - "end": 265, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 250, - "end": 258, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 259, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": true - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 326, - "end": 332, - "ctxt": 0 - }, - "value": "BOther", - "optional": false - }, - "declare": false, - "span": { - "start": 320, - "end": 532, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 349, - "end": 373, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 349, - "end": 373, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 361, - "end": 373, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 363, - "end": 371, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 404, - "end": 423, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 412, - "end": 417, - "ctxt": 0 - }, - "value": "nonce", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 419, - "end": 422, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 468, - "end": 490, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 476, - "end": 484, - "ctxt": 0 - }, - "value": "property", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "value": "y", - "raw": "'y'" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "declare": false, - "span": { - "start": 533, - "end": 603, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 547, - "end": 566, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 555, - "end": 560, - "ctxt": 0 - }, - "value": "nonce", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 560, - "end": 565, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 562, - "end": 565, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 611, - "end": 612, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 605, - "end": 631, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 619, - "end": 629, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 619, - "end": 620, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 620, - "end": 628, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 622, - "end": 628, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 638, - "end": 639, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 632, - "end": 675, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 656, - "end": 664, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 656, - "end": 657, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 657, - "end": 663, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 659, - "end": 663, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 659, - "end": 663, - "ctxt": 0 - }, - "value": "hi", - "raw": "'hi'" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 648, - "end": 649, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 682, - "end": 684, - "ctxt": 0 - }, - "value": "DD", - "optional": false - }, - "declare": false, - "span": { - "start": 676, - "end": 726, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 701, - "end": 718, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 709, - "end": 710, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 710, - "end": 717, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 712, - "end": 717, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 712, - "end": 717, - "ctxt": 0 - }, - "value": "bye", - "raw": "'bye'" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 693, - "end": 694, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 743, - "end": 744, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": true, - "span": { - "start": 729, - "end": 778, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 751, - "end": 761, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 751, - "end": 753, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 753, - "end": 761, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 755, - "end": 761, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 766, - "end": 776, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 766, - "end": 768, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 768, - "end": 776, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 770, - "end": 776, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 785, - "end": 786, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "declare": false, - "span": { - "start": 779, - "end": 837, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 803, - "end": 811, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 803, - "end": 805, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 806, - "end": 811, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 808, - "end": 811, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 808, - "end": 811, - "ctxt": 0 - }, - "value": "z", - "raw": "'z'" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "ClassProperty", - "span": { - "start": 816, - "end": 835, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 824, - "end": 826, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 826, - "end": 835, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 828, - "end": 835, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 828, - "end": 835, - "ctxt": 0 - }, - "value": "alpha", - "raw": "'alpha'" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 795, - "end": 796, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 845, - "end": 846, - "ctxt": 0 - }, - "value": "G", - "optional": false - }, - "declare": false, - "span": { - "start": 839, - "end": 936, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 863, - "end": 870, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 863, - "end": 865, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 865, - "end": 870, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 867, - "end": 870, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 867, - "end": 870, - "ctxt": 0 - }, - "value": "z", - "raw": "'z'" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 875, - "end": 934, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 875, - "end": 886, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 889, - "end": 934, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 899, - "end": 906, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 899, - "end": 906, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 899, - "end": 904, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 915, - "end": 928, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 915, - "end": 928, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 915, - "end": 922, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 915, - "end": 919, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 920, - "end": 922, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 925, - "end": 928, - "ctxt": 0 - }, - "value": "z", - "raw": "'z'" - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 855, - "end": 856, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 953, - "end": 954, - "ctxt": 0 - }, - "value": "H", - "optional": false - }, - "declare": false, - "span": { - "start": 938, - "end": 1042, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 971, - "end": 999, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 980, - "end": 982, - "ctxt": 0 - }, - "value": "p1", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 982, - "end": 999, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 984, - "end": 999, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 990, - "end": 993, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 990, - "end": 993, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 996, - "end": 999, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 996, - "end": 999, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1004, - "end": 1040, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1021, - "end": 1023, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1023, - "end": 1040, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1025, - "end": 1040, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 1025, - "end": 1028, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1025, - "end": 1028, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1031, - "end": 1034, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1031, - "end": 1034, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1037, - "end": 1040, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1037, - "end": 1040, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": true, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 963, - "end": 964, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "isAbstract": true, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1044, - "end": 1073, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1054, - "end": 1055, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1056, - "end": 1073, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1062, - "end": 1071, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1062, - "end": 1063, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1063, - "end": 1071, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1065, - "end": 1071, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1074, - "end": 1099, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1084, - "end": 1085, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1094, - "end": 1095, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1094, - "end": 1095, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1096, - "end": 1099, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1106, - "end": 1107, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "declare": false, - "span": { - "start": 1100, - "end": 1121, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1114, - "end": 1119, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1114, - "end": 1115, - "ctxt": 0 - }, - "value": "r", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1118, - "end": 1119, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1128, - "end": 1129, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "declare": false, - "span": { - "start": 1122, - "end": 1240, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1146, - "end": 1159, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1146, - "end": 1147, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1148, - "end": 1159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1150, - "end": 1159, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 1150, - "end": 1151, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1150, - "end": 1151, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1154, - "end": 1155, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1154, - "end": 1155, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1158, - "end": 1159, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1158, - "end": 1159, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "ClassProperty", - "span": { - "start": 1208, - "end": 1217, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1208, - "end": 1209, - "ctxt": 0 - }, - "value": "r", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1210, - "end": 1217, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1212, - "end": 1217, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 1212, - "end": 1213, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1212, - "end": 1213, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 1216, - "end": 1217, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 1216, - "end": 1217, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1138, - "end": 1139, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1258, - "end": 1259, - "ctxt": 0 - }, - "value": "L", - "optional": false - }, - "declare": false, - "span": { - "start": 1252, - "end": 1331, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1266, - "end": 1273, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1266, - "end": 1267, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1267, - "end": 1272, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1269, - "end": 1272, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1278, - "end": 1329, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1278, - "end": 1289, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1290, - "end": 1298, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1290, - "end": 1298, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1293, - "end": 1298, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1295, - "end": 1298, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1300, - "end": 1329, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1310, - "end": 1323, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1310, - "end": 1322, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 1310, - "end": 1316, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1310, - "end": 1314, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1315, - "end": 1316, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1319, - "end": 1322, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1338, - "end": 1339, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "declare": false, - "span": { - "start": 1332, - "end": 1495, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1356, - "end": 1374, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1364, - "end": 1365, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1365, - "end": 1373, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1367, - "end": 1373, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": true, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 1379, - "end": 1493, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1379, - "end": 1390, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1391, - "end": 1402, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1391, - "end": 1402, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1394, - "end": 1402, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1396, - "end": 1402, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1404, - "end": 1493, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1414, - "end": 1425, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1414, - "end": 1424, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 1414, - "end": 1419, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1420, - "end": 1423, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1434, - "end": 1454, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1434, - "end": 1453, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1434, - "end": 1445, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1441, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1442, - "end": 1445, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1446, - "end": 1452, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1446, - "end": 1450, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1451, - "end": 1452, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1348, - "end": 1349, - "ctxt": 0 - }, - "value": "L", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.ts b/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.ts deleted file mode 100644 index eab12031000..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/derivedUninitializedPropertyDeclaration.ts +++ /dev/null @@ -1,82 +0,0 @@ -// @strict: true -class A { - property = 'x'; - m() { return 1 } -} -class B extends A { - property: any; // error -} -class BD extends A { - declare property: any; // ok because it's implicitly initialised -} -class BDBang extends A { - declare property!: any; // ! is not allowed, this is an ambient declaration -} -class BOther extends A { - declare m() { return 2 } // not allowed on methods - declare nonce: any; // ok, even though it's not in the base - declare property = 'y' // initialiser not allowed with declare -} -class U { - declare nonce: any; // ok, even though there's no base -} - -class C { - p: string; -} -class D extends C { - p: 'hi'; // error -} -class DD extends C { - declare p: 'bye'; // ok -} - - -declare class E { - p1: string - p2: string -} -class F extends E { - p1!: 'z' - declare p2: 'alpha' -} - -class G extends E { - p1: 'z' - constructor() { - super() - this.p1 = 'z' - } -} - -abstract class H extends E { - abstract p1: 'a' | 'b' | 'c' - declare abstract p2: 'a' | 'b' | 'c' -} - -interface I { - q: number -} -interface J extends I { } -class J { - r = 5 -} -class K extends J { - q!: 1 | 2 | 3 // ok, extends a property from an interface - r!: 4 | 5 // error, from class -} - -// #35327 -class L { - a: any; - constructor(arg: any) { - this.a = arg; - } -} -class M extends L { - declare a: number; - constructor(arg: number) { - super(arg); - console.log(this.a); // should be OK, M.a is ambient - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5.ts index 48a40d96496..ac79a737bb8 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5.ts @@ -1,4 +1,4 @@ -/* AssignmentPattern: +/* AssignmentPattern: * ObjectAssignmentPattern * ArrayAssignmentPattern * ArrayAssignmentPattern: diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts index ffc1658ba3a..ac7c7f29742 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts @@ -1,4 +1,4 @@ -// @downlevelIteration: true +// @downlevelIteration: true /* AssignmentPattern: * ObjectAssignmentPattern * ArrayAssignmentPattern diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES6.ts b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES6.ts index 53b17f43555..38249192275 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment1ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 /* AssignmentPattern: * ObjectAssignmentPattern diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment2.ts b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment2.ts index 328163d00b1..73c5fd680c0 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment2.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringArrayBindingPatternAndAssignment2.ts @@ -1,4 +1,4 @@ -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is the type Any, or var [[a0], [[a1]]] = [] // Error var [[a2], [[a3]]] = undefined // Error diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES5.ts index 476fdf6a8bc..f13caa706f5 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES5.ts @@ -1,4 +1,4 @@ -// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. // An expression of type S is considered assignable to an assignment target V if one of the following is true // V is an object assignment pattern and, for each assignment property P in V, diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES6.ts b/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES6.ts index 5065b0817b4..41f338d173d 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringObjectBindingPatternAndAssignment1ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. // An expression of type S is considered assignable to an assignment target V if one of the following is true diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5.ts index 587a8172061..2a3de812561 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5.ts @@ -1,4 +1,4 @@ -// A parameter declaration may specify either an identifier or a binding pattern. +// A parameter declaration may specify either an identifier or a binding pattern. // The identifiers specified in parameter declarations and binding patterns // in a parameter list must be unique within that parameter list. diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5iterable.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5iterable.ts index b440782c3a5..cb325284a62 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5iterable.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES5iterable.ts @@ -1,4 +1,4 @@ -// @downlevelIteration: true +// @downlevelIteration: true // A parameter declaration may specify either an identifier or a binding pattern. // The identifiers specified in parameter declarations and binding patterns // in a parameter list must be unique within that parameter list. diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES6.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES6.ts index 81482d5b9aa..4ac9fa65581 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration1ES6.ts @@ -1,4 +1,4 @@ -// Conformance for emitting ES6 +// Conformance for emitting ES6 // @target: es6 // A parameter declaration may specify either an identifier or a binding pattern. diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5.ts index 60095858677..82415a9f641 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // If the parameter is a rest parameter, the parameter type is any[] // A type annotation for a rest parameter must denote an array type. diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5iterable.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5iterable.ts index 817eee997f2..46fb5c5091e 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5iterable.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES5iterable.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // @downlevelIteration: true // If the parameter is a rest parameter, the parameter type is any[] diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES6.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES6.ts index 60095858677..82415a9f641 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration3ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // If the parameter is a rest parameter, the parameter type is any[] // A type annotation for a rest parameter must denote an array type. diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration5.ts index c0112ab8fb6..2fc876b538a 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration5.ts @@ -1,4 +1,4 @@ -// Parameter Declaration with generic +// Parameter Declaration with generic interface F { } class Class implements F { diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5.ts index 02adc9ca927..77731c0ed73 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 interface ISomething { foo: string, diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5iterable.ts b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5iterable.ts index 2b32de67d62..50ef886c714 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5iterable.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringParameterDeclaration7ES5iterable.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // @downlevelIteration: true interface ISomething { diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5.ts b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5.ts index aaff935ab37..b8e4bfa317e 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5.ts @@ -1,4 +1,4 @@ -// The type T associated with a destructuring variable declaration is determined as follows: +// The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5iterable.ts b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5iterable.ts index 2122ce01651..51dc388121b 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5iterable.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES5iterable.ts @@ -1,4 +1,4 @@ -// @downlevelIteration: true +// @downlevelIteration: true // The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES6.ts b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES6.ts index 08d49724dd4..e77fe5af8a7 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration1ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } diff --git a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration2.ts index 89e8502928a..ad7c6c6b41d 100644 --- a/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration2.ts +++ b/crates/swc_ecma_parser/tests/tsc/destructuringVariableDeclaration2.ts @@ -1,4 +1,4 @@ -// The type T associated with a destructuring variable declaration is determined as follows: +// The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error diff --git a/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.json b/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.json deleted file mode 100644 index dfc95e8b996..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.json +++ /dev/null @@ -1,1272 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 56, - "end": 551, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 56, - "end": 110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 66, - "end": 72, - "ctxt": 0 - }, - "value": "Number", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 73, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 79, - "end": 91, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 82, - "end": 90, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 84, - "end": 90, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 96, - "end": 108, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 112, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "value": "String", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 129, - "end": 170, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 135, - "end": 149, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 148, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 154, - "end": 168, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 154, - "end": 157, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 159, - "end": 167, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 161, - "end": 167, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 172, - "end": 218, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 187, - "ctxt": 0 - }, - "value": "Array", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 191, - "end": 218, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 197, - "end": 204, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 202, - "end": 203, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 202, - "end": 203, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 209, - "end": 216, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 214, - "end": 215, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 214, - "end": 215, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 226, - "end": 227, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 220, - "end": 337, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 234, - "end": 246, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 234, - "end": 237, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 251, - "end": 263, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 254, - "end": 262, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 256, - "end": 262, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 269, - "end": 279, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 272, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 269, - "end": 279, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 276, - "end": 279, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 284, - "end": 294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 284, - "end": 294, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 291, - "end": 294, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 300, - "end": 315, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 300, - "end": 303, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 306, - "end": 315, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 320, - "end": 335, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 326, - "end": 335, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 332, - "end": 335, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 339, - "end": 388, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 351, - "end": 388, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 357, - "end": 369, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 360, - "end": 368, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 362, - "end": 368, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 374, - "end": 386, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 377, - "end": 385, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 379, - "end": 385, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 390, - "end": 473, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 394, - "end": 473, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 395, - "end": 473, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 397, - "end": 473, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 403, - "end": 415, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 403, - "end": 406, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 406, - "end": 414, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 408, - "end": 414, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 420, - "end": 432, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 420, - "end": 423, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 423, - "end": 431, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 425, - "end": 431, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 438, - "end": 452, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 438, - "end": 441, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 441, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 443, - "end": 451, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 446, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 449, - "end": 451, - "ctxt": 0 - }, - "members": [] - } - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 457, - "end": 471, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 457, - "end": 460, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 460, - "end": 470, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 462, - "end": 470, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 465, - "end": 470, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 468, - "end": 470, - "ctxt": 0 - }, - "members": [] - } - } - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 475, - "end": 551, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 479, - "end": 551, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 479, - "end": 480, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 483, - "end": 551, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 489, - "end": 492, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 494, - "end": 496, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 502, - "end": 505, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 507, - "end": 509, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 515, - "end": 518, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 526, - "end": 529, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 535, - "end": 538, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 540, - "end": 549, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 546, - "end": 549, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.ts b/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.ts deleted file mode 100644 index 6250034f983..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/duplicatePropertyNames.ts +++ /dev/null @@ -1,47 +0,0 @@ -// duplicate property names are an error in all types - -interface Number { - foo: string; - foo: string; -} - -interface String { - foo(): string; - foo(): string; -} - -interface Array { - foo: T; - foo: T; -} - -class C { - foo: string; - foo: string; - - bar(x) { } - bar(x) { } - - baz = () => { } - baz = () => { } -} - -interface I { - foo: string; - foo: string; -} - -var a: { - foo: string; - foo: string; - - bar: () => {}; - bar: () => {}; -} - -var b = { - foo: '', - foo: '', - bar: () => { }, - bar: () => { } -} diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunction.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunction.ts index 72cf621c9c6..15f28e18ca5 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunction.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var f1 = () => { } var f2 = (x: string, y: string) => { } var f3 = (x: string, y: number, ...rest) => { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIs.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIs.ts index d53ba8a3185..32a1fd1ac8d 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIs.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIs.ts @@ -1,4 +1,4 @@ -// @target:ES5 +// @target:ES5 var arrow1 = a => { }; var arrow2 = (a) => { }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIsES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIsES6.ts index c88789299c4..e8ea83307c4 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIsES6.ts @@ -1,4 +1,4 @@ -// @target:ES6 +// @target:ES6 var arrow1 = a => { }; var arrow2 = (a) => { }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionES6.ts index af181e2d7f9..adaa7ae3171 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 var f1 = () => { } var f2 = (x: string, y: string) => { } var f3 = (x: string, y: number, ...rest) => { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturing.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturing.ts index 81bd6446736..0138da6a036 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturing.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturing.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var f1 = () => { this.age = 10 }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturingES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturingES6.ts index 3081144968d..7381cc538c4 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturingES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturingES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 var f1 = () => { this.age = 10 }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01.ts index 9a6a89bc60d..560fe2a50ed 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var a = () => { var arg = arguments[0]; // error } diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01_ES6.ts index 1b4129f4f52..ef8d6a76bab 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var a = () => { var arg = arguments[0]; // error } diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02.ts index b78fe6a0033..a6b59655309 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var a = () => arguments; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02_ES6.ts index 30b38f38524..8985fd7ebfc 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var a = () => arguments; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03.ts index ce5822789ad..fb691dc9c46 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var arguments; var a = () => arguments; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03_ES6.ts index 54cd74f3df8..f7ea289fe59 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var arguments; var a = () => arguments; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04.ts index 847641920c8..c712c437cf2 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04_ES6.ts index 7bb4567ca9a..d1966d90845 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05.ts index 0379fbe0a75..136a20d85ac 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(arguments) { var a = () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05_ES6.ts index 923254675c5..6af8f350c28 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(arguments) { var a = () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06.ts index 90416157b6d..9a0231f849e 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(arguments) { var a = () => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06_ES6.ts index f547ee4ce82..0ec7f3671d5 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(arguments) { var a = () => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07.ts index 4e89b358101..05040deecbe 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(arguments) { var a = (arguments) => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07_ES6.ts index 48a5d3aea5a..a5540772028 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(arguments) { var a = (arguments) => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08.ts index c661f8454ae..a1fe94e74de 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(arguments) { var a = () => (arguments) => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08_ES6.ts index 17895c6d7b3..d3f6d3b56ac 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(arguments) { var a = () => (arguments) => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09.ts index eda732c8419..53c07c003c9 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(_arguments) { var a = () => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09_ES6.ts index 7e3a651fe07..b780346463a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(_arguments) { var a = () => () => arguments; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10.ts index a3636f67e62..dab433e096f 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10_ES6.ts index 25a997832cd..e9c230411ab 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11.ts index 09f80dfba97..161011c4dcb 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f(arguments) { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11_ES6.ts index 6789a0cae83..a2b800930c8 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(arguments) { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.json b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.json deleted file mode 100644 index 7c9fdc63c5c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 87, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 87, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 32, - "end": 85, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 34, - "end": 43, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 34, - "end": 43, - "ctxt": 0 - }, - "value": "arguments", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 32, - "end": 85, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 45, - "end": 85, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 55, - "end": 79, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 59, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 63, - "end": 78, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "Identifier", - "span": { - "start": 69, - "end": 78, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.ts deleted file mode 100644 index f13e534bbaf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @target: es5 - -class C { - f(arguments) { - var a = () => arguments; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.json b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.json deleted file mode 100644 index 7c9fdc63c5c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 87, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 87, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 32, - "end": 85, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 34, - "end": 43, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 34, - "end": 43, - "ctxt": 0 - }, - "value": "arguments", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 32, - "end": 85, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 45, - "end": 85, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 55, - "end": 79, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 59, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 63, - "end": 78, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "Identifier", - "span": { - "start": 69, - "end": 78, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.ts deleted file mode 100644 index a8d886a706e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments12_ES6.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @target: es6 - -class C { - f(arguments) { - var a = () => arguments; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13.ts index 7e29a0ecdee..003f911062c 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13_ES6.ts index f9ac23676e5..be3978c9cf7 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var _arguments = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14.ts index 5c48001f82c..3c3900449e1 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { if (Math.random()) { diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14_ES6.ts index 5c70bfad76f..3a8765a0c41 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { if (Math.random()) { diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15.ts index f66dec12a80..46cb73dd879 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var arguments = "hello"; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15_ES6.ts index e503ab07ce5..6aa40a9f160 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var arguments = "hello"; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16.ts index d211fea1b66..2f222ddbc55 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var arguments = "hello"; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16_ES6.ts index 2583b2c998c..a4fb10cc1b4 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var arguments = "hello"; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17.ts index b5a2b02b6f4..687abcb4667 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var { arguments } = { arguments: "hello" }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17_ES6.ts index cbc3c366aac..2f3b30c62d5 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var { arguments } = { arguments: "hello" }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18.ts index c97239f3a01..37aa4346c95 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { var { arguments: args } = { arguments }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18_ES6.ts index 1b5c3e10950..c5d0da54da7 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { var { arguments: args } = { arguments }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19.ts index 8d7082ba115..3bce15b893a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function f() { function g() { diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19_ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19_ES6.ts index 837d6d0ade3..ab5ff3b27f4 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f() { function g() { diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIs.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIs.ts index d53ba8a3185..32a1fd1ac8d 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIs.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIs.ts @@ -1,4 +1,4 @@ -// @target:ES5 +// @target:ES5 var arrow1 = a => { }; var arrow2 = (a) => { }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIsES6.ts b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIsES6.ts index c88789299c4..e8ea83307c4 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIsES6.ts @@ -1,4 +1,4 @@ -// @target:ES6 +// @target:ES6 var arrow1 = a => { }; var arrow2 = (a) => { }; diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationOverloadInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationOverloadInES6.ts index c22ca30c959..679538c2977 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationOverloadInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationOverloadInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class C { constructor(y: any) constructor(x: number) { diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithConstructorInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithConstructorInES6.ts index 5fa9fb568f5..294f7892eab 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithConstructorInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithConstructorInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class A { y: number; constructor(x: number) { diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts index 6e228859601..b46e18a9403 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { constructor(a: T) { } } diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionInES6.ts index c750fd7a516..53bd173cc7c 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { baz(a: string, y = 10) { } } diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithGetterSetterInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithGetterSetterInES6.ts index 1d779c08045..1d41da8e261 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithGetterSetterInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithGetterSetterInES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 class C { _name: string; get name(): string { diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithLiteralPropertyNameInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithLiteralPropertyNameInES6.ts index 89a88770a76..1a56a9c744e 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithLiteralPropertyNameInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithLiteralPropertyNameInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { "hello" = 10; 0b110 = "world"; diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithMethodInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithMethodInES6.ts index 5404313b0c1..40c097f2629 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithMethodInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithMethodInES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 class D { _bar: string; foo() { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAssignmentInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAssignmentInES6.ts index 415f80baffa..c412e3c6734 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAssignmentInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAssignmentInES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 class C { x: string = "Hello world"; } diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts index 7539631af97..34d56b4735a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 class C { static z: string = "Foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithSuperMethodCall01.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithSuperMethodCall01.ts index 2c48d5b17a0..532daed2ce1 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithSuperMethodCall01.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithSuperMethodCall01.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 class Parent { foo() { diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithThisKeywordInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithThisKeywordInES6.ts index b882362a193..a8965846e52 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithThisKeywordInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithThisKeywordInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { x = 10; constructor() { diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts index 5c5c65c972e..5e7312b9300 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { x: T; B: T; diff --git a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentInES6.ts b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentInES6.ts index 8e4865b7520..a1b62fb05d5 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentInES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentInES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class B { x: T; B: T; diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts index ecd75beb948..9d3e78216ac 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var globalCounter = 0; function foo() { globalCounter += 1; diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts index ec52e667495..749b6a413cd 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var object = { _0: 2, diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts index 193783572f3..bed5d92044f 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var globalCounter = 0; function incrementIdx(max: number) { diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts index 862bc8f7672..87d09b15088 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var globalCounter = 0; function foo() { diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator1.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator1.ts index 6fff42110ed..a90526e31cf 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator1.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator1.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var comp: number; diff --git a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator2.ts b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator2.ts index cbbeb5fa24e..b20ad7bc8df 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator2.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator2.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var comp: number; diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunction.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunction.ts index d3ced2ceaa0..2429d9102fa 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunction.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 function foo(x: string, y = 10) { } function baz(x: string, y = 5, ...rest) { } function bar(y = 10) { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionES6.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionES6.ts index 2fc96118b2d..f217292a37a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 function foo(x: string, y = 10) { } function baz(x: string, y = 5, ...rest) { } function bar(y = 10) { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpression.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpression.ts index b384958f1ca..b86b5c4e743 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpression.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var lambda1 = (y = "hello") => { } var lambda2 = (x: number, y = "hello") => { } var lambda3 = (x: number, y = "hello", ...rest) => { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpressionES6.ts index 42f71d19d62..14a84ac008a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpressionES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 var lambda1 = (y = "hello") => { } var lambda2 = (x: number, y = "hello") => { } var lambda3 = (x: number, y = "hello", ...rest) => { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionProperty.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionProperty.ts index ecf8488cdea..045c09d09ed 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionProperty.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionProperty.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var obj2 = { func1(y = 10, ...rest) { }, func2(x = "hello") { }, diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionPropertyES6.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionPropertyES6.ts index 175d008310a..708f72c66e9 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionPropertyES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionPropertyES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 var obj2 = { func1(y = 10, ...rest) { }, func2(x = "hello") { }, diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethod.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethod.ts index c18257c4316..a935eaf41ff 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethod.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethod.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 class C { constructor(t: boolean, z: string, x: number, y = "hello") { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethodES6.ts b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethodES6.ts index 69c03f17eb8..470932f4cc1 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethodES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethodES6.ts @@ -1,4 +1,4 @@ -// @target:es6 +// @target:es6 class C { constructor(t: boolean, z: string, x: number, y = "hello") { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator1.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator1.ts index 546caeeac63..54dc3f71328 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator1.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator1.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 1 ** -2; 1 ** 2; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator2.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator2.ts index c416fb6aaf9..2cf02479521 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator2.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator2.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var temp = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator3.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator3.ts index e9c3f51aa35..aec2886e7e9 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator3.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator3.ts @@ -1,4 +1,4 @@ -// @target:es5 +// @target:es5 var temp = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator4.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator4.ts index e53dae4990e..5b64c1bff54 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator4.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator4.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var temp: any; (temp) ** 3; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4.ts index eeeb1266151..f320b78be46 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4ES6.ts index 8613c4ffcf3..78497ef5bb2 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1.ts index 0208d56ae57..1be8f3c15e0 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1ES6.ts index 16b8cc1b207..4244b70be4d 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2.ts index b03bd37b015..e287166aada 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2ES6.ts index 49bd3bafe4e..ba1215cadb9 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3.ts index 1e6f2a47d68..f61151c34ed 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3ES6.ts b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3ES6.ts index b858b351452..77b6f37f992 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var t1 = 10; var t2 = 10; diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunction.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunction.ts index 1f787176a25..82fa906e726 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunction.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 function bar(...rest) { } function foo(x: number, y: string, ...rest) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionES6.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionES6.ts index ed09c53ec0c..e6e2a7c915c 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 function bar(...rest) { } function foo(x: number, y: string, ...rest) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpression.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpression.ts index 5cfa57ea986..04b866a9af0 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpression.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var funcExp = (...rest) => { } var funcExp1 = (X: number, ...rest) => { } var funcExp2 = function (...rest) { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpressionES6.ts index e30073389f1..570b97d8f6a 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionExpressionES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var funcExp = (...rest) => { } var funcExp1 = (X: number, ...rest) => { } var funcExp2 = function (...rest) { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionProperty.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionProperty.ts index 64e80b43383..44ed4007bbc 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionProperty.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionProperty.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var obj: { func1: (...rest) => void } diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionPropertyES6.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionPropertyES6.ts index 3c68c45e9ef..bb44b1adc1b 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionPropertyES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersFunctionPropertyES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var obj: { func1: (...rest) => void } diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethod.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethod.ts index bc01aa1f6f5..f8ca9d85a63 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethod.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethod.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 class C { constructor(name: string, ...rest) { } diff --git a/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethodES6.ts b/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethodES6.ts index b7623c294a3..e20c77e4597 100644 --- a/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethodES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/emitRestParametersMethodES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 class C { constructor(name: string, ...rest) { } diff --git a/crates/swc_ecma_parser/tests/tsc/enums.json b/crates/swc_ecma_parser/tests/tsc/enums.json new file mode 100644 index 00000000000..787c24a1af3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/enums.json @@ -0,0 +1,735 @@ +{ + "type": "Module", + "span": { + "start": 21, + "end": 564, + "ctxt": 0 + }, + "body": [ + { + "type": "TsEnumDeclaration", + "span": { + "start": 21, + "end": 76, + "ctxt": 0 + }, + "declare": false, + "isConst": false, + "id": { + "type": "Identifier", + "span": { + "start": 26, + "end": 36, + "ctxt": 0 + }, + "value": "SyntaxKind", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 41, + "end": 53, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 41, + "end": 53, + "ctxt": 0 + }, + "value": "ImportClause", + "optional": false + }, + "init": null + }, + { + "type": "TsEnumMember", + "span": { + "start": 57, + "end": 74, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 57, + "end": 74, + "ctxt": 0 + }, + "value": "ExportDeclaration", + "optional": false + }, + "init": null + } + ] + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 78, + "end": 139, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 89, + "end": 100, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 105, + "end": 118, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 105, + "end": 109, + "ctxt": 0 + }, + "value": "Type", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 112, + "end": 118, + "ctxt": 0 + }, + "value": "Type", + "raw": "\"Type\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 122, + "end": 137, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 122, + "end": 127, + "ctxt": 0 + }, + "value": "Value", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 130, + "end": 137, + "ctxt": 0 + }, + "value": "Value", + "raw": "\"Value\"" + } + } + ] + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 141, + "end": 168, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 155, + "end": 165, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 155, + "end": 165, + "ctxt": 0 + }, + "value": "SyntaxKind", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 169, + "end": 192, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 178, + "end": 189, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 178, + "end": 189, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 214, + "end": 265, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 228, + "end": 238, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 228, + "end": 238, + "ctxt": 0 + }, + "value": "SyntaxKind", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 240, + "end": 251, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 240, + "end": 251, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 259, + "end": 264, + "ctxt": 0 + }, + "value": "./a", + "raw": "'./a'" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 267, + "end": 291, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 267, + "end": 290, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 267, + "end": 277, + "ctxt": 0 + }, + "value": "SyntaxKind", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 278, + "end": 290, + "ctxt": 0 + }, + "value": "ImportClause", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 292, + "end": 309, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 292, + "end": 308, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 292, + "end": 303, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 304, + "end": 308, + "ctxt": 0 + }, + "value": "Type", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 310, + "end": 344, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 314, + "end": 343, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 314, + "end": 318, + "ctxt": 0 + }, + "value": "kind", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 318, + "end": 343, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 320, + "end": 343, + "ctxt": 0 + }, + "typeName": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 320, + "end": 330, + "ctxt": 0 + }, + "value": "SyntaxKind", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 331, + "end": 343, + "ctxt": 0 + }, + "value": "ImportClause", + "optional": false + } + }, + "typeParams": null + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 345, + "end": 368, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 349, + "end": 367, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 349, + "end": 354, + "ctxt": 0 + }, + "value": "flags", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 354, + "end": 367, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 356, + "end": 367, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 356, + "end": 367, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "typeParams": null + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 370, + "end": 403, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 375, + "end": 383, + "ctxt": 0 + }, + "value": "TypeFlag", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 386, + "end": 402, + "ctxt": 0 + }, + "typeName": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 386, + "end": 397, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 398, + "end": 402, + "ctxt": 0 + }, + "value": "Type", + "optional": false + } + }, + "typeParams": null + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 404, + "end": 429, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 418, + "end": 426, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 418, + "end": 426, + "ctxt": 0 + }, + "value": "TypeFlag", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 451, + "end": 485, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 460, + "end": 471, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 460, + "end": 471, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 479, + "end": 484, + "ctxt": 0 + }, + "value": "./a", + "raw": "'./a'" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 486, + "end": 522, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 500, + "end": 508, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 500, + "end": 508, + "ctxt": 0 + }, + "value": "TypeFlag", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 516, + "end": 521, + "ctxt": 0 + }, + "value": "./b", + "raw": "'./b'" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 523, + "end": 564, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 529, + "end": 563, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 529, + "end": 534, + "ctxt": 0 + }, + "value": "flags", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 534, + "end": 544, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 536, + "end": 544, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 536, + "end": 544, + "ctxt": 0 + }, + "value": "TypeFlag", + "optional": false + }, + "typeParams": null + } + } + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 547, + "end": 563, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 547, + "end": 558, + "ctxt": 0 + }, + "value": "SymbolFlags", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 559, + "end": 563, + "ctxt": 0 + }, + "value": "Type", + "optional": false + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/enums.ts b/crates/swc_ecma_parser/tests/tsc/enums.ts new file mode 100644 index 00000000000..b632bdbce54 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/enums.ts @@ -0,0 +1,29 @@ +// @Filename: /a.ts +enum SyntaxKind { + ImportClause, + ExportDeclaration +} + +const enum SymbolFlags { + Type = "Type", + Value = "Value" +} + +export type { SyntaxKind }; +export { SymbolFlags }; + +// @Filename: /b.ts +import type { SyntaxKind, SymbolFlags } from './a'; + +SyntaxKind.ImportClause; +SymbolFlags.Type; +let kind: SyntaxKind.ImportClause; +let flags: SymbolFlags; + +type TypeFlag = SymbolFlags.Type; +export type { TypeFlag }; + +// @Filename: /c.ts +import { SymbolFlags } from './a'; +import type { TypeFlag } from './b'; +const flags: TypeFlag = SymbolFlags.Type; diff --git a/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.json b/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.json deleted file mode 100644 index 7ce8ab020cb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.json +++ /dev/null @@ -1,1883 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 29, - "end": 1201, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 38, - "end": 40, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 42, - "end": 50, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 44, - "end": 50, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 29, - "end": 535, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 52, - "end": 535, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 58, - "end": 85, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 62, - "end": 76, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 67, - "end": 76, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 78, - "end": 85, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 90, - "end": 117, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 94, - "end": 108, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 99, - "end": 108, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 110, - "end": 117, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 122, - "end": 150, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 126, - "end": 141, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 132, - "end": 141, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 143, - "end": 150, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 155, - "end": 183, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 159, - "end": 174, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 159, - "end": 160, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 176, - "end": 183, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 188, - "end": 210, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 192, - "end": 201, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 197, - "end": 201, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 203, - "end": 210, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 215, - "end": 237, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 219, - "end": 228, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 224, - "end": 228, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 230, - "end": 237, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 242, - "end": 265, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 246, - "end": 256, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 258, - "end": 265, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 270, - "end": 293, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 274, - "end": 284, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 280, - "end": 284, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 286, - "end": 293, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 298, - "end": 325, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 302, - "end": 316, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 302, - "end": 311, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 315, - "end": 316, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 318, - "end": 325, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 330, - "end": 357, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 334, - "end": 348, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "Identifier", - "span": { - "start": 334, - "end": 343, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 347, - "end": 348, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 350, - "end": 357, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 362, - "end": 390, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 366, - "end": 381, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 366, - "end": 375, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 380, - "end": 381, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 383, - "end": 390, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 395, - "end": 423, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 399, - "end": 414, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 399, - "end": 408, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 413, - "end": 414, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 416, - "end": 423, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 428, - "end": 450, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 432, - "end": 441, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 432, - "end": 436, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 440, - "end": 441, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 443, - "end": 450, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 455, - "end": 477, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 459, - "end": 468, - "ctxt": 0 - }, - "operator": "!=", - "left": { - "type": "NullLiteral", - "span": { - "start": 459, - "end": 463, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 467, - "end": 468, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 470, - "end": 477, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 482, - "end": 505, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 486, - "end": 496, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "NullLiteral", - "span": { - "start": 486, - "end": 490, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 495, - "end": 496, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 498, - "end": 505, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 510, - "end": 533, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 514, - "end": 524, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "NullLiteral", - "span": { - "start": 514, - "end": 518, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 523, - "end": 524, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 526, - "end": 533, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 546, - "end": 548, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 537, - "end": 694, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 551, - "end": 694, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 557, - "end": 592, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 561, - "end": 583, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 561, - "end": 570, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 574, - "end": 583, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 585, - "end": 592, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 597, - "end": 627, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 601, - "end": 618, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 601, - "end": 610, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 614, - "end": 618, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 620, - "end": 627, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 632, - "end": 662, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 636, - "end": 653, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 636, - "end": 640, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 644, - "end": 653, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 655, - "end": 662, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 667, - "end": 692, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 671, - "end": 683, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "NullLiteral", - "span": { - "start": 671, - "end": 675, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 679, - "end": 683, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 685, - "end": 692, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 705, - "end": 707, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 708, - "end": 717, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 708, - "end": 717, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 709, - "end": 717, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 711, - "end": 717, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 719, - "end": 729, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 719, - "end": 729, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 720, - "end": 729, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 722, - "end": 729, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 731, - "end": 747, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 731, - "end": 747, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 732, - "end": 747, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 734, - "end": 747, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 736, - "end": 745, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 736, - "end": 737, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 737, - "end": 745, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 739, - "end": 745, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 749, - "end": 767, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 749, - "end": 767, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 750, - "end": 767, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 752, - "end": 767, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 752, - "end": 758, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 761, - "end": 767, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 696, - "end": 880, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 769, - "end": 880, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 775, - "end": 797, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 779, - "end": 788, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 779, - "end": 780, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 784, - "end": 788, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 790, - "end": 797, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 802, - "end": 824, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 806, - "end": 815, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 806, - "end": 807, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 811, - "end": 815, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 817, - "end": 824, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 829, - "end": 851, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 833, - "end": 842, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 833, - "end": 834, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 838, - "end": 842, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 844, - "end": 851, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 856, - "end": 878, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 860, - "end": 869, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 860, - "end": 861, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 865, - "end": 869, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 871, - "end": 878, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 891, - "end": 893, - "ctxt": 0 - }, - "value": "f4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 894, - "end": 903, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 894, - "end": 903, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 895, - "end": 903, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 897, - "end": 903, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 882, - "end": 1034, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 905, - "end": 1034, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 911, - "end": 937, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 915, - "end": 928, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 915, - "end": 916, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 919, - "end": 928, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 930, - "end": 937, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 942, - "end": 968, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 946, - "end": 959, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 946, - "end": 947, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 950, - "end": 959, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 961, - "end": 968, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 973, - "end": 1000, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 977, - "end": 991, - "ctxt": 0 - }, - "operator": ">=", - "left": { - "type": "Identifier", - "span": { - "start": 977, - "end": 978, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 982, - "end": 991, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 993, - "end": 1000, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 1005, - "end": 1032, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1009, - "end": 1023, - "ctxt": 0 - }, - "operator": "<=", - "left": { - "type": "Identifier", - "span": { - "start": 1009, - "end": 1010, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1014, - "end": 1023, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1025, - "end": 1032, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1044, - "end": 1046, - "ctxt": 0 - }, - "value": "f5", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1047, - "end": 1056, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1056, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1048, - "end": 1056, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1050, - "end": 1056, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1035, - "end": 1201, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1058, - "end": 1201, - "ctxt": 0 - }, - "stmts": [ - { - "type": "SwitchStatement", - "span": { - "start": 1064, - "end": 1199, - "ctxt": 0 - }, - "discriminant": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1072, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "cases": [ - { - "type": "SwitchCase", - "span": { - "start": 1084, - "end": 1113, - "ctxt": 0 - }, - "test": { - "type": "NullLiteral", - "span": { - "start": 1089, - "end": 1093, - "ctxt": 0 - } - }, - "consequent": [ - { - "type": "BreakStatement", - "span": { - "start": 1107, - "end": 1113, - "ctxt": 0 - }, - "label": null - } - ] - }, - { - "type": "SwitchCase", - "span": { - "start": 1122, - "end": 1156, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 1127, - "end": 1136, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "consequent": [ - { - "type": "BreakStatement", - "span": { - "start": 1150, - "end": 1156, - "ctxt": 0 - }, - "label": null - } - ] - }, - { - "type": "SwitchCase", - "span": { - "start": 1165, - "end": 1193, - "ctxt": 0 - }, - "test": null, - "consequent": [ - { - "type": "ReturnStatement", - "span": { - "start": 1186, - "end": 1193, - "ctxt": 0 - }, - "argument": null - } - ] - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.ts b/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.ts deleted file mode 100644 index 0d67cb33d58..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/equalityStrictNulls.ts +++ /dev/null @@ -1,79 +0,0 @@ -// @strictNullChecks: true - -function f1(x: string) { - if (x == undefined) { - } - if (x != undefined) { - } - if (x === undefined) { - } - if (x !== undefined) { - } - if (x == null) { - } - if (x != null) { - } - if (x === null) { - } - if (x !== null) { - } - if (undefined == x) { - } - if (undefined != x) { - } - if (undefined === x) { - } - if (undefined !== x) { - } - if (null == x) { - } - if (null != x) { - } - if (null === x) { - } - if (null !== x) { - } -} - -function f2() { - if (undefined == undefined) { - } - if (undefined == null) { - } - if (null == undefined) { - } - if (null == null) { - } -} - -function f3(a: number, b: boolean, c: { x: number }, d: number | string) { - if (a == null) { - } - if (b == null) { - } - if (c == null) { - } - if (d == null) { - } -} - -function f4(x: number) { - if (x > undefined) { - } - if (x < undefined) { - } - if (x >= undefined) { - } - if (x <= undefined) { - } -} -function f5(x: string) { - switch(x) { - case null: - break; - case undefined: - break; - default: - return; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.json b/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.json new file mode 100644 index 00000000000..9afbb74b9ba --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.json @@ -0,0 +1,613 @@ +{ + "type": "Script", + "span": { + "start": 26, + "end": 259, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 35, + "end": 37, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 38, + "end": 49, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 38, + "end": 49, + "ctxt": 0 + }, + "value": "a", + "optional": true, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 40, + "end": 49, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 42, + "end": 49, + "ctxt": 0 + }, + "kind": "boolean" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 26, + "end": 130, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 57, + "end": 130, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 63, + "end": 74, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 63, + "end": 73, + "ctxt": 0 + }, + "operator": "??=", + "left": { + "type": "Identifier", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "BooleanLiteral", + "span": { + "start": 69, + "end": 73, + "ctxt": 0 + }, + "value": true + } + } + }, + { + "type": "IfStatement", + "span": { + "start": 80, + "end": 128, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 84, + "end": 95, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 84, + "end": 85, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "BooleanLiteral", + "span": { + "start": 90, + "end": 95, + "ctxt": 0 + }, + "value": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 97, + "end": 128, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 107, + "end": 122, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 107, + "end": 121, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 107, + "end": 118, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 107, + "end": 114, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 115, + "end": 118, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 119, + "end": 120, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 50, + "end": 56, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 52, + "end": 56, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 131, + "end": 141, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 131, + "end": 140, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 131, + "end": 133, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BooleanLiteral", + "span": { + "start": 134, + "end": 139, + "ctxt": 0 + }, + "value": false + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 152, + "end": 154, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 143, + "end": 259, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 157, + "end": 259, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 163, + "end": 195, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 167, + "end": 194, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 168, + "end": 183, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 170, + "end": 183, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 170, + "end": 171, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 170, + "end": 171, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 174, + "end": 175, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 174, + "end": 175, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 178, + "end": 179, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 178, + "end": 179, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 182, + "end": 183, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 182, + "end": 183, + "ctxt": 0 + }, + "value": 3.0, + "raw": "3" + } + } + ] + } + } + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 186, + "end": 194, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 186, + "end": 187, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 191, + "end": 194, + "ctxt": 0 + }, + "kind": "any" + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 200, + "end": 208, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 200, + "end": 207, + "ctxt": 0 + }, + "operator": "??=", + "left": { + "type": "Identifier", + "span": { + "start": 200, + "end": 201, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 206, + "end": 207, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + { + "type": "IfStatement", + "span": { + "start": 213, + "end": 257, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 217, + "end": 224, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 217, + "end": 218, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 223, + "end": 224, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 226, + "end": 257, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 236, + "end": 251, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 236, + "end": 250, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 236, + "end": 247, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 236, + "end": 243, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 244, + "end": 247, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 248, + "end": 249, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.ts b/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.ts new file mode 100644 index 00000000000..f4d5a992456 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/equalityWithtNullishCoalescingAssignment.ts @@ -0,0 +1,18 @@ +// @strict: true, false + +function f1(a?: boolean): void { + a ??= true; + + if (a === false) { + console.log(a); + } +} +f1(false); + +function f2() { + let x: 0 | 1 | 2 | 3 = 0 as any; + x ??= 1; + if (x === 0) { + console.log(x); + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.json b/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.json index 61e8f786c5a..0d404e63028 100644 --- a/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.json +++ b/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 71, - "end": 369, + "end": 609, "ctxt": 0 }, "body": [ @@ -179,7 +179,7 @@ "type": "VariableDeclaration", "span": { "start": 178, - "end": 222, + "end": 254, "ctxt": 0 }, "kind": "const", @@ -189,14 +189,183 @@ "type": "VariableDeclarator", "span": { "start": 184, - "end": 221, + "end": 253, "ctxt": 0 }, "id": { "type": "Identifier", "span": { "start": 184, - "end": 193, + "end": 189, + "ctxt": 0 + }, + "value": "sab64", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 192, + "end": 253, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 196, + "end": 213, + "ctxt": 0 + }, + "value": "SharedArrayBuffer", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 214, + "end": 252, + "ctxt": 0 + }, + "operator": "*", + "left": { + "type": "MemberExpression", + "span": { + "start": 214, + "end": 245, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 214, + "end": 227, + "ctxt": 0 + }, + "value": "BigInt64Array", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 228, + "end": 245, + "ctxt": 0 + }, + "value": "BYTES_PER_ELEMENT", + "optional": false + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 248, + "end": 252, + "ctxt": 0 + }, + "value": 1024.0, + "raw": "1024" + } + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 255, + "end": 294, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 261, + "end": 293, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 261, + "end": 266, + "ctxt": 0 + }, + "value": "int64", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 269, + "end": 293, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 273, + "end": 286, + "ctxt": 0 + }, + "value": "BigInt64Array", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 287, + "end": 292, + "ctxt": 0 + }, + "value": "sab64", + "optional": false + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 295, + "end": 339, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 301, + "end": 338, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 301, + "end": 310, "ctxt": 0 }, "value": "waitValue", @@ -206,22 +375,22 @@ "init": { "type": "CallExpression", "span": { - "start": 196, - "end": 221, + "start": 313, + "end": 338, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 196, - "end": 208, + "start": 313, + "end": 325, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 196, - "end": 203, + "start": 313, + "end": 320, "ctxt": 0 }, "value": "Atomics", @@ -230,8 +399,8 @@ "property": { "type": "Identifier", "span": { - "start": 204, - "end": 208, + "start": 321, + "end": 325, "ctxt": 0 }, "value": "wait", @@ -244,8 +413,8 @@ "expression": { "type": "Identifier", "span": { - "start": 209, - "end": 214, + "start": 326, + "end": 331, "ctxt": 0 }, "value": "int32", @@ -257,8 +426,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 216, - "end": 217, + "start": 333, + "end": 334, "ctxt": 0 }, "value": 0.0, @@ -270,8 +439,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 219, - "end": 220, + "start": 336, + "end": 337, "ctxt": 0 }, "value": 0.0, @@ -288,8 +457,8 @@ { "type": "VariableDeclaration", "span": { - "start": 223, - "end": 287, + "start": 340, + "end": 396, "ctxt": 0 }, "kind": "const", @@ -298,30 +467,30 @@ { "type": "VariableDeclarator", "span": { - "start": 229, - "end": 286, + "start": 346, + "end": 395, "ctxt": 0 }, "id": { "type": "ObjectPattern", "span": { - "start": 229, - "end": 245, + "start": 346, + "end": 362, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 231, - "end": 236, + "start": 348, + "end": 353, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 231, - "end": 236, + "start": 348, + "end": 353, "ctxt": 0 }, "value": "async", @@ -332,15 +501,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 238, - "end": 243, + "start": 355, + "end": 360, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 238, - "end": 243, + "start": 355, + "end": 360, "ctxt": 0 }, "value": "value", @@ -355,22 +524,22 @@ "init": { "type": "CallExpression", "span": { - "start": 248, - "end": 286, + "start": 365, + "end": 395, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 248, - "end": 265, + "start": 365, + "end": 382, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 248, - "end": 255, + "start": 365, + "end": 372, "ctxt": 0 }, "value": "Atomics", @@ -379,8 +548,8 @@ "property": { "type": "Identifier", "span": { - "start": 256, - "end": 265, + "start": 373, + "end": 382, "ctxt": 0 }, "value": "waitAsync", @@ -393,8 +562,8 @@ "expression": { "type": "Identifier", "span": { - "start": 266, - "end": 271, + "start": 383, + "end": 388, "ctxt": 0 }, "value": "int32", @@ -406,8 +575,167 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 273, - "end": 274, + "start": 390, + "end": 391, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 393, + "end": 394, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 397, + "end": 479, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 403, + "end": 478, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 403, + "end": 437, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Identifier", + "span": { + "start": 405, + "end": 410, + "ctxt": 0 + }, + "value": "async", + "optional": false + }, + "value": { + "type": "Identifier", + "span": { + "start": 412, + "end": 419, + "ctxt": 0 + }, + "value": "async64", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "KeyValuePatternProperty", + "key": { + "type": "Identifier", + "span": { + "start": 421, + "end": 426, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "value": { + "type": "Identifier", + "span": { + "start": 428, + "end": 435, + "ctxt": 0 + }, + "value": "value64", + "optional": false, + "typeAnnotation": null + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 440, + "end": 478, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 440, + "end": 457, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 440, + "end": 447, + "ctxt": 0 + }, + "value": "Atomics", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 448, + "end": 457, + "ctxt": 0 + }, + "value": "waitAsync", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 458, + "end": 463, + "ctxt": 0 + }, + "value": "int64", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 465, + "end": 466, "ctxt": 0 }, "value": 0.0, @@ -419,15 +747,15 @@ "expression": { "type": "CallExpression", "span": { - "start": 276, - "end": 285, + "start": 468, + "end": 477, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 276, - "end": 282, + "start": 468, + "end": 474, "ctxt": 0 }, "value": "BigInt", @@ -439,8 +767,8 @@ "expression": { "type": "NumericLiteral", "span": { - "start": 283, - "end": 284, + "start": 475, + "end": 476, "ctxt": 0 }, "value": 0.0, @@ -461,8 +789,8 @@ { "type": "VariableDeclaration", "span": { - "start": 289, - "end": 361, + "start": 481, + "end": 601, "ctxt": 0 }, "kind": "const", @@ -471,15 +799,15 @@ { "type": "VariableDeclarator", "span": { - "start": 295, - "end": 361, + "start": 487, + "end": 601, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 295, - "end": 299, + "start": 487, + "end": 491, "ctxt": 0 }, "value": "main", @@ -489,31 +817,31 @@ "init": { "type": "ArrowFunctionExpression", "span": { - "start": 302, - "end": 361, + "start": 494, + "end": 601, "ctxt": 0 }, "params": [], "body": { "type": "BlockStatement", "span": { - "start": 314, - "end": 361, + "start": 506, + "end": 601, "ctxt": 0 }, "stmts": [ { "type": "IfStatement", "span": { - "start": 320, - "end": 359, + "start": 512, + "end": 551, "ctxt": 0 }, "test": { "type": "Identifier", "span": { - "start": 324, - "end": 329, + "start": 516, + "end": 521, "ctxt": 0 }, "value": "async", @@ -522,30 +850,30 @@ "consequent": { "type": "BlockStatement", "span": { - "start": 331, - "end": 359, + "start": 523, + "end": 551, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 341, - "end": 353, + "start": 533, + "end": 545, "ctxt": 0 }, "expression": { "type": "AwaitExpression", "span": { - "start": 341, - "end": 352, + "start": 533, + "end": 544, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 347, - "end": 352, + "start": 539, + "end": 544, "ctxt": 0 }, "value": "value", @@ -556,6 +884,61 @@ ] }, "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 556, + "end": 599, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 560, + "end": 567, + "ctxt": 0 + }, + "value": "async64", + "optional": false + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 569, + "end": 599, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 579, + "end": 593, + "ctxt": 0 + }, + "expression": { + "type": "AwaitExpression", + "span": { + "start": 579, + "end": 592, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 585, + "end": 592, + "ctxt": 0 + }, + "value": "value64", + "optional": false + } + } + } + ] + }, + "alternate": null } ] }, @@ -571,22 +954,22 @@ { "type": "ExpressionStatement", "span": { - "start": 362, - "end": 369, + "start": 602, + "end": 609, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 362, - "end": 368, + "start": 602, + "end": 608, "ctxt": 0 }, "callee": { "type": "Identifier", "span": { - "start": 362, - "end": 366, + "start": 602, + "end": 606, "ctxt": 0 }, "value": "main", diff --git a/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.ts b/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.ts index c28d50bbefd..efc391bbed7 100644 --- a/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.ts +++ b/crates/swc_ecma_parser/tests/tsc/es2022SharedMemory.ts @@ -5,12 +5,18 @@ const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 1024); const int32 = new Int32Array(sab); +const sab64 = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 1024); +const int64 = new BigInt64Array(sab64); const waitValue = Atomics.wait(int32, 0, 0); -const { async, value } = Atomics.waitAsync(int32, 0, BigInt(0)); +const { async, value } = Atomics.waitAsync(int32, 0, 0); +const { async: async64, value: value64 } = Atomics.waitAsync(int64, 0, BigInt(0)); const main = async () => { if (async) { await value; } + if (async64) { + await value64; + } } main(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts index 8f3ed2b9047..adf0ed144bc 100644 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts +++ b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts @@ -1,4 +1,4 @@ -var temp: any; +var temp: any; // Error: incorrect type on left-hand side (! --temp) ** 3; diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNew.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNew.ts index 8f86a638652..849d72e6302 100644 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNew.ts +++ b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNew.ts @@ -1,4 +1,4 @@ -var a: any; +var a: any; var b: any; var c: any; new a ** b ** c; diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.json deleted file mode 100644 index dbe70c8a7bd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.json +++ /dev/null @@ -1,872 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 110, - "end": 448, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 110, - "end": 125, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 114, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 115, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 124, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 124, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 126, - "end": 140, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 130, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 131, - "end": 139, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 141, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 145, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 145, - "end": 146, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 172, - "end": 193, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 176, - "end": 192, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 176, - "end": 180, - "ctxt": 0 - }, - "value": "r1a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 183, - "end": 192, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 183, - "end": 187, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 194, - "end": 215, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 198, - "end": 214, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 202, - "ctxt": 0 - }, - "value": "r1a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 205, - "end": 214, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 205, - "end": 209, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 216, - "end": 237, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 220, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - }, - "value": "r1a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 227, - "end": 236, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 239, - "end": 260, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 243, - "end": 259, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 243, - "end": 247, - "ctxt": 0 - }, - "value": "r1b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 250, - "end": 259, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 255, - "end": 259, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 261, - "end": 282, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 265, - "end": 281, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "value": "r1b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 272, - "end": 281, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 277, - "end": 281, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 283, - "end": 304, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 287, - "end": 303, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 287, - "end": 291, - "ctxt": 0 - }, - "value": "r1b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 294, - "end": 303, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 299, - "end": 303, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 306, - "end": 330, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 310, - "end": 329, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 310, - "end": 314, - "ctxt": 0 - }, - "value": "r1c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 317, - "end": 329, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 317, - "end": 321, - "ctxt": 0 - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 325, - "end": 329, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 331, - "end": 353, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 335, - "end": 352, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 335, - "end": 339, - "ctxt": 0 - }, - "value": "r1c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 342, - "end": 352, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 342, - "end": 346, - "ctxt": 0 - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 350, - "end": 352, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 354, - "end": 376, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 358, - "end": 375, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 358, - "end": 362, - "ctxt": 0 - }, - "value": "r1c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 365, - "end": 375, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 365, - "end": 369, - "ctxt": 0 - } - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 373, - "end": 375, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 378, - "end": 402, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 382, - "end": 401, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - }, - "value": "r1d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 389, - "end": 401, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 389, - "end": 393, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 403, - "end": 425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 407, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - }, - "value": "r1d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 414, - "end": 424, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "StringLiteral", - "span": { - "start": 414, - "end": 416, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 420, - "end": 424, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 426, - "end": 448, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 447, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 434, - "ctxt": 0 - }, - "value": "r1d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 437, - "end": 447, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "ObjectExpression", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 443, - "end": 447, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.ts deleted file mode 100644 index 7ecec740d41..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndInvalidOperands.ts +++ /dev/null @@ -1,23 +0,0 @@ -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. - -var a: boolean; -var b: string; -var c: Object; - -// operator ** -var r1a1 = null ** a; -var r1a2 = null ** b; -var r1a3 = null ** c; - -var r1b1 = a ** null; -var r1b2 = b ** null; -var r1b3 = c ** null; - -var r1c1 = null ** true; -var r1c2 = null ** ''; -var r1c3 = null ** {}; - -var r1d1 = true ** null; -var r1d2 = '' ** null; -var r1d3 = {} ** null; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.json b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.json deleted file mode 100644 index 02d01868a2b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.json +++ /dev/null @@ -1,677 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 110, - "end": 341, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 110, - "end": 133, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 135, - "end": 146, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 139, - "end": 145, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 139, - "end": 140, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 147, - "end": 161, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 151, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 151, - "end": 152, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 160, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 154, - "end": 160, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 178, - "end": 197, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 182, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "value": "r1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 187, - "end": 196, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 198, - "end": 217, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 202, - "end": 216, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 202, - "end": 204, - "ctxt": 0 - }, - "value": "r2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 207, - "end": 216, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 215, - "end": 216, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 218, - "end": 237, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 222, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 222, - "end": 224, - "ctxt": 0 - }, - "value": "r3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 227, - "end": 236, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 238, - "end": 259, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 242, - "end": 258, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 242, - "end": 244, - "ctxt": 0 - }, - "value": "r4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 247, - "end": 258, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 247, - "end": 251, - "ctxt": 0 - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 255, - "end": 258, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 255, - "end": 256, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 260, - "end": 279, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 264, - "end": 278, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 264, - "end": 266, - "ctxt": 0 - }, - "value": "r5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 274, - "end": 278, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 280, - "end": 299, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 284, - "end": 298, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 284, - "end": 286, - "ctxt": 0 - }, - "value": "r6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 289, - "end": 298, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 300, - "end": 319, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 304, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 304, - "end": 306, - "ctxt": 0 - }, - "value": "r7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 309, - "end": 318, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NumericLiteral", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 314, - "end": 318, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 341, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 324, - "end": 340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 324, - "end": 326, - "ctxt": 0 - }, - "value": "r8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 329, - "end": 340, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "MemberExpression", - "span": { - "start": 329, - "end": 332, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 336, - "end": 340, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.ts deleted file mode 100644 index acc152ea696..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNullValueAndValidOperands.ts +++ /dev/null @@ -1,20 +0,0 @@ -// If one operand is the null or undefined value, it is treated as having the type of the -// other operand. - -enum E { - a, - b -} - -var a: any; -var b: number; - -// operator ** -var r1 = null ** a; -var r2 = null ** b; -var r3 = null ** 1; -var r4 = null ** E.a; -var r5 = a ** null; -var r6 = b ** null; -var r7 = 0 ** null; -var r8 = E.b ** null; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.json b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.json deleted file mode 100644 index b43dd2a1aa2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 127, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 37, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 22, - "ctxt": 0 - }, - "value": "r1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 25, - "end": 37, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 25, - "end": 29, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 33, - "end": 37, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 39, - "end": 66, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 43, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 43, - "end": 45, - "ctxt": 0 - }, - "value": "r2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 48, - "end": 65, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NullLiteral", - "span": { - "start": 48, - "end": 52, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 56, - "end": 65, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 67, - "end": 94, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 71, - "end": 93, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 73, - "ctxt": 0 - }, - "value": "r3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 76, - "end": 93, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 76, - "end": 85, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 95, - "end": 127, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 99, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 99, - "end": 101, - "ctxt": 0 - }, - "value": "r4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 104, - "end": 126, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 104, - "end": 113, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 117, - "end": 126, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts deleted file mode 100644 index 82133ed3914..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithOnlyNullValueOrUndefinedValue.ts +++ /dev/null @@ -1,5 +0,0 @@ -// operator ** -var r1 = null ** null; -var r2 = null ** undefined; -var r3 = undefined ** null; -var r4 = undefined ** undefined; diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalid.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalid.ts index ed190f632d1..1b5aab3fae6 100644 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalid.ts +++ b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalid.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var a = 1 ** `${ 3 }`; var b = 1 ** `2${ 3 }`; diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalidES6.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalidES6.ts index ef12bf08233..7b1a29c2dc4 100644 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalidES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalidES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var a = 1 ** `${ 3 }`; var b = 1 ** `2${ 3 }`; diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.json deleted file mode 100644 index 6d8fa04f321..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.json +++ /dev/null @@ -1,896 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 115, - "end": 513, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 115, - "end": 130, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 120, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 131, - "end": 145, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 135, - "end": 144, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 146, - "end": 160, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 150, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 151, - "end": 159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 153, - "end": 159, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 153, - "end": 159, - "ctxt": 0 - }, - "value": "Object", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 177, - "end": 203, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 181, - "end": 202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 185, - "ctxt": 0 - }, - "value": "r1a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 188, - "end": 202, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 188, - "end": 197, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 204, - "end": 230, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 208, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 208, - "end": 212, - "ctxt": 0 - }, - "value": "r1a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 215, - "end": 229, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 215, - "end": 224, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 231, - "end": 257, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 235, - "end": 256, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 235, - "end": 239, - "ctxt": 0 - }, - "value": "r1a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 242, - "end": 256, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 242, - "end": 251, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 255, - "end": 256, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 259, - "end": 285, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 263, - "end": 284, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 263, - "end": 267, - "ctxt": 0 - }, - "value": "r1b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 270, - "end": 284, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 275, - "end": 284, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 286, - "end": 312, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 290, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 290, - "end": 294, - "ctxt": 0 - }, - "value": "r1b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 297, - "end": 311, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 297, - "end": 298, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 302, - "end": 311, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 313, - "end": 339, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 317, - "end": 338, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 317, - "end": 321, - "ctxt": 0 - }, - "value": "r1b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 324, - "end": 338, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 324, - "end": 325, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 329, - "end": 338, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 341, - "end": 370, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 345, - "end": 369, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 345, - "end": 349, - "ctxt": 0 - }, - "value": "r1c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 352, - "end": 369, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 352, - "end": 361, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 365, - "end": 369, - "ctxt": 0 - }, - "value": true - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 371, - "end": 398, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 375, - "end": 397, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 375, - "end": 379, - "ctxt": 0 - }, - "value": "r1c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 382, - "end": 397, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 382, - "end": 391, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 395, - "end": 397, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 399, - "end": 426, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 403, - "end": 425, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 403, - "end": 407, - "ctxt": 0 - }, - "value": "r1c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 410, - "end": 425, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 410, - "end": 419, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 423, - "end": 425, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 428, - "end": 457, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 432, - "end": 456, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 432, - "end": 436, - "ctxt": 0 - }, - "value": "r1d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 439, - "end": 456, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 439, - "end": 443, - "ctxt": 0 - }, - "value": true - }, - "right": { - "type": "Identifier", - "span": { - "start": 447, - "end": 456, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 458, - "end": 485, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 462, - "end": 484, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 462, - "end": 466, - "ctxt": 0 - }, - "value": "r1d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 469, - "end": 484, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "StringLiteral", - "span": { - "start": 469, - "end": 471, - "ctxt": 0 - }, - "value": "", - "raw": "''" - }, - "right": { - "type": "Identifier", - "span": { - "start": 475, - "end": 484, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 486, - "end": 513, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 490, - "end": 512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 490, - "end": 494, - "ctxt": 0 - }, - "value": "r1d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 497, - "end": 512, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "ObjectExpression", - "span": { - "start": 497, - "end": 499, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 503, - "end": 512, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts deleted file mode 100644 index 7693e4a83f9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndInvalidOperands.ts +++ /dev/null @@ -1,23 +0,0 @@ -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. - -var a: boolean; -var b: string; -var c: Object; - -// operator ** -var r1a1 = undefined ** a; -var r1a2 = undefined ** b; -var r1a3 = undefined ** c; - -var r1b1 = a ** undefined; -var r1b2 = b ** undefined; -var r1b3 = c ** undefined; - -var r1c1 = undefined ** true; -var r1c2 = undefined ** ''; -var r1c3 = undefined ** {}; - -var r1d1 = true ** undefined; -var r1d2 = '' ** undefined; -var r1d3 = {} ** undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.json b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.json deleted file mode 100644 index d36c61bedff..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.json +++ /dev/null @@ -1,693 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 115, - "end": 393, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 115, - "end": 138, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 140, - "end": 151, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 144, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 152, - "end": 166, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 156, - "end": 165, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 159, - "end": 165, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 182, - "end": 207, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 186, - "end": 206, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "value": "rk1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 192, - "end": 206, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 201, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 208, - "end": 233, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 212, - "end": 232, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "value": "rk2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 218, - "end": 232, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 218, - "end": 227, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 234, - "end": 259, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 238, - "end": 258, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "value": "rk3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 244, - "end": 258, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 244, - "end": 253, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 260, - "end": 287, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 264, - "end": 286, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "value": "rk4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 270, - "end": 286, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 270, - "end": 279, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 283, - "end": 284, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 288, - "end": 313, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 292, - "end": 312, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "rk5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 298, - "end": 312, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 314, - "end": 339, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 318, - "end": 338, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 318, - "end": 321, - "ctxt": 0 - }, - "value": "rk6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 324, - "end": 338, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "Identifier", - "span": { - "start": 324, - "end": 325, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 329, - "end": 338, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 340, - "end": 365, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 344, - "end": 364, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 344, - "end": 347, - "ctxt": 0 - }, - "value": "rk7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 350, - "end": 364, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "NumericLiteral", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "right": { - "type": "Identifier", - "span": { - "start": 355, - "end": 364, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 366, - "end": 393, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 370, - "end": 392, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 370, - "end": 373, - "ctxt": 0 - }, - "value": "rk8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 376, - "end": 392, - "ctxt": 0 - }, - "operator": "**", - "left": { - "type": "MemberExpression", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 383, - "end": 392, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.ts b/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.ts deleted file mode 100644 index c1862f1bbe9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithUndefinedValueAndValidOperands.ts +++ /dev/null @@ -1,20 +0,0 @@ -// If one operand is the undefined or undefined value, it is treated as having the type of the -// other operand. - -enum E { - a, - b -} - -var a: any; -var b: number; - -// operator * -var rk1 = undefined ** a; -var rk2 = undefined ** b; -var rk3 = undefined ** 1; -var rk4 = undefined ** E.a; -var rk5 = a ** undefined; -var rk6 = b ** undefined; -var rk7 = 0 ** undefined; -var rk8 = E.b ** undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.json b/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.json new file mode 100644 index 00000000000..7fa4319cbbc --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.json @@ -0,0 +1,27 @@ +{ + "type": "Module", + "span": { + "start": 50, + "end": 69, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDefaultExpression", + "span": { + "start": 50, + "end": 69, + "ctxt": 0 + }, + "expression": { + "type": "NullLiteral", + "span": { + "start": 65, + "end": 69, + "ctxt": 0 + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.ts b/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.ts new file mode 100644 index 00000000000..08934188788 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.ts @@ -0,0 +1,6 @@ +// @declaration: true + +/** + * JSDoc Comments + */ +export default null diff --git a/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.json b/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.json new file mode 100644 index 00000000000..9067c7ed4a9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.json @@ -0,0 +1,86 @@ +{ + "type": "Module", + "span": { + "start": 76, + "end": 111, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 76, + "end": 90, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 82, + "end": 89, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 82, + "end": 85, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 88, + "end": 89, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 91, + "end": 111, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 100, + "end": 108, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 105, + "end": 108, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "exported": null, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.ts b/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.ts new file mode 100644 index 00000000000..b8280ae66a5 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.ts @@ -0,0 +1,7 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: ./a.js +const foo = 0; +export { type foo }; diff --git a/crates/swc_ecma_parser/tests/tsc/exportsAndImportsWithContextualKeywordNames02.ts b/crates/swc_ecma_parser/tests/tsc/exportsAndImportsWithContextualKeywordNames02.ts index 8b27d6e97ba..93316333029 100644 --- a/crates/swc_ecma_parser/tests/tsc/exportsAndImportsWithContextualKeywordNames02.ts +++ b/crates/swc_ecma_parser/tests/tsc/exportsAndImportsWithContextualKeywordNames02.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: es5 // @filename: t1.ts diff --git a/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.json b/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.json new file mode 100644 index 00000000000..212942269a4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.json @@ -0,0 +1,163 @@ +{ + "type": "Module", + "span": { + "start": 142, + "end": 424, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDefaultExpression", + "span": { + "start": 142, + "end": 164, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 157, + "end": 163, + "ctxt": 0 + }, + "value": "a.js", + "raw": "\"a.js\"" + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 197, + "end": 222, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 212, + "end": 221, + "ctxt": 0 + }, + "value": "a.js.js", + "raw": "\"a.js.js\"" + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 260, + "end": 290, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 275, + "end": 289, + "ctxt": 0 + }, + "value": "dir/index.ts", + "raw": "\"dir/index.ts\"" + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 322, + "end": 346, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 337, + "end": 345, + "ctxt": 0 + }, + "value": "dir.js", + "raw": "\"dir.js\"" + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 376, + "end": 399, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 383, + "end": 384, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 383, + "end": 384, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 390, + "end": 398, + "ctxt": 0 + }, + "value": "./a.js", + "raw": "\"./a.js\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 400, + "end": 424, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 407, + "end": 410, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 407, + "end": 410, + "ctxt": 0 + }, + "value": "dir", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 416, + "end": 423, + "ctxt": 0 + }, + "value": "./dir", + "raw": "\"./dir\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.ts b/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.ts new file mode 100644 index 00000000000..c3a06a36b52 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/extensionLoadingPriority.ts @@ -0,0 +1,20 @@ +// @moduleResolution: classic,node,node16,nodenext,bundler +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /project/a.js +export default "a.js"; + +// @Filename: /project/a.js.js +export default "a.js.js"; + +// @Filename: /project/dir/index.ts +export default "dir/index.ts"; + +// @Filename: /project/dir.js +export default "dir.js"; + +// @Filename: /project/b.ts +import a from "./a.js"; +import dir from "./dir"; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of1.ts b/crates/swc_ecma_parser/tests/tsc/for-of1.ts index 4ce70f7473a..c3a2abe6bca 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of1.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of1.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v; for (v of []) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of10.ts b/crates/swc_ecma_parser/tests/tsc/for-of10.ts index db7dff591af..a3fb56c1c0c 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of10.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of10.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v: string; for (v of [0]) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of11.ts b/crates/swc_ecma_parser/tests/tsc/for-of11.ts index 0fb862ae4a1..22e3b514bba 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of11.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of11.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v: string; for (v of [0, ""]) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of12.ts b/crates/swc_ecma_parser/tests/tsc/for-of12.ts index 35a4cfdcfd3..3bd3fb644ed 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of12.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of12.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v: string; for (v of [0, ""].values()) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of13.ts b/crates/swc_ecma_parser/tests/tsc/for-of13.ts index 3413216352a..735e887b16b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of13.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of13.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v: string; for (v of [""].values()) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of14.ts b/crates/swc_ecma_parser/tests/tsc/for-of14.ts index c91fac34525..e9db955336f 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of14.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of14.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return ""; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of15.ts b/crates/swc_ecma_parser/tests/tsc/for-of15.ts index 0888f741c14..f151c5be747 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of15.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of15.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return ""; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of16.ts b/crates/swc_ecma_parser/tests/tsc/for-of16.ts index a96d5c839d0..f94261dbd5e 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of16.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of16.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { [Symbol.iterator]() { return this; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of17.ts b/crates/swc_ecma_parser/tests/tsc/for-of17.ts index a3911c46581..9a75d1859bd 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of17.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of17.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class NumberIterator { next() { return { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of18.ts b/crates/swc_ecma_parser/tests/tsc/for-of18.ts index 58f5809b9fa..341aa761668 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of18.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of18.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of19.ts b/crates/swc_ecma_parser/tests/tsc/for-of19.ts index 86483643698..91a3bc19d41 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of19.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of19.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class Foo { } class FooIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of2.json b/crates/swc_ecma_parser/tests/tsc/for-of2.json deleted file mode 100644 index 884a53c2985..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/for-of2.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 24, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ForOfStatement", - "span": { - "start": 25, - "end": 42, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ArrayExpression", - "span": { - "start": 35, - "end": 37, - "ctxt": 0 - }, - "elements": [] - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/for-of2.ts b/crates/swc_ecma_parser/tests/tsc/for-of2.ts deleted file mode 100644 index 1c17ca1df55..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/for-of2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -const v; -for (v of []) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of20.ts b/crates/swc_ecma_parser/tests/tsc/for-of20.ts index b6ad1c3a846..ac46240cd3f 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of20.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of20.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class Foo { } class FooIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of21.ts b/crates/swc_ecma_parser/tests/tsc/for-of21.ts index d15f53133e4..87f2b3022e0 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of21.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of21.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class Foo { } class FooIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of22.ts b/crates/swc_ecma_parser/tests/tsc/for-of22.ts index 74e11e8aee1..067ae3045fe 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of22.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of22.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class Foo { } class FooIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of23.ts b/crates/swc_ecma_parser/tests/tsc/for-of23.ts index 0287c6910ac..e06563e613f 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of23.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of23.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class Foo { } class FooIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of24.ts b/crates/swc_ecma_parser/tests/tsc/for-of24.ts index 0effd5f17fa..505627b9f83 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of24.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of24.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var x: any; for (var v of x) { } diff --git a/crates/swc_ecma_parser/tests/tsc/for-of25.ts b/crates/swc_ecma_parser/tests/tsc/for-of25.ts index a0ddeab5c9c..fa03add020a 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of25.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of25.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { [Symbol.iterator]() { return x; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of26.ts b/crates/swc_ecma_parser/tests/tsc/for-of26.ts index a6b18918b32..1fa7d0a35b0 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of26.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of26.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return x; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of27.ts b/crates/swc_ecma_parser/tests/tsc/for-of27.ts index 4163e80c4b5..19ecfdc635b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of27.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of27.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { [Symbol.iterator]: any; } diff --git a/crates/swc_ecma_parser/tests/tsc/for-of28.ts b/crates/swc_ecma_parser/tests/tsc/for-of28.ts index 4441866e51c..ee1748c8b80 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of28.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of28.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next: any; [Symbol.iterator]() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of29.ts b/crates/swc_ecma_parser/tests/tsc/for-of29.ts index 06fc612db91..be1674cbd7f 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of29.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of29.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var iterableWithOptionalIterator: { [Symbol.iterator]?(): Iterator }; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of3.ts b/crates/swc_ecma_parser/tests/tsc/for-of3.ts index cfb46622214..91b401eb0bc 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of3.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of3.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 var v: any; for (v++ of []) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of30.ts b/crates/swc_ecma_parser/tests/tsc/for-of30.ts index e7ea277dcde..3ba2531dfa7 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of30.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of30.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of31.ts b/crates/swc_ecma_parser/tests/tsc/for-of31.ts index 9095c6a70e2..951f2f8508b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of31.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of31.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 class StringIterator { next() { return { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of32.ts b/crates/swc_ecma_parser/tests/tsc/for-of32.ts index e5806a140a3..9427757b474 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of32.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of32.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 //@noImplicitAny: true for (var v of v) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of33.ts b/crates/swc_ecma_parser/tests/tsc/for-of33.ts index 6119d002a5d..cef875903ea 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of33.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of33.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 //@noImplicitAny: true class StringIterator { [Symbol.iterator]() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of34.ts b/crates/swc_ecma_parser/tests/tsc/for-of34.ts index ef3e65a88ba..58357522227 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of34.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of34.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 //@noImplicitAny: true class StringIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of35.ts b/crates/swc_ecma_parser/tests/tsc/for-of35.ts index 1d14a457503..202d9dfdeaf 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of35.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of35.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 //@noImplicitAny: true class StringIterator { next() { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of36.ts b/crates/swc_ecma_parser/tests/tsc/for-of36.ts index 4730accb757..0b032df055e 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of36.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of36.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var tuple: [string, boolean] = ["", true]; for (var v of tuple) { v; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of37.ts b/crates/swc_ecma_parser/tests/tsc/for-of37.ts index bdba0755a9c..e8ca70ad87d 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of37.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of37.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var map = new Map([["", true]]); for (var v of map) { v; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of38.ts b/crates/swc_ecma_parser/tests/tsc/for-of38.ts index a2370609d1c..20b49483108 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of38.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of38.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var map = new Map([["", true]]); for (var [k, v] of map) { k; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of39.ts b/crates/swc_ecma_parser/tests/tsc/for-of39.ts index 371324e459f..2af50c7a2e4 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of39.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of39.ts @@ -1,4 +1,4 @@ -// @lib: es2015 +// @lib: es2015 // @target: ES6 var map = new Map([["", true], ["", 0]]); for (var [k, v] of map) { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of4.ts b/crates/swc_ecma_parser/tests/tsc/for-of4.ts index bbef682e14e..ee73d25a5d5 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of4.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of4.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 for (var v of [0]) { v; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of40.ts b/crates/swc_ecma_parser/tests/tsc/for-of40.ts index b2cf5aee3de..239287c1a99 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of40.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of40.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var map = new Map([["", true]]); for (var [k = "", v = false] of map) { k; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of41.ts b/crates/swc_ecma_parser/tests/tsc/for-of41.ts index 9faaae601c3..e221b2cf6f6 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of41.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of41.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var array = [{x: [0], y: {p: ""}}] for (var {x: [a], y: {p}} of array) { a; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of42.ts b/crates/swc_ecma_parser/tests/tsc/for-of42.ts index 74cd77ef0ca..9af5c37f12d 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of42.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of42.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var array = [{ x: "", y: 0 }] for (var {x: a, y: b} of array) { a; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of43.ts b/crates/swc_ecma_parser/tests/tsc/for-of43.ts index 33889e9b787..8770f775421 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of43.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of43.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var array = [{ x: "", y: 0 }] for (var {x: a = "", y: b = true} of array) { a; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of44.ts b/crates/swc_ecma_parser/tests/tsc/for-of44.ts index bc86c5ef420..db1579e850b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of44.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of44.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] for (var [num, strBoolSym] of array) { num; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of45.ts b/crates/swc_ecma_parser/tests/tsc/for-of45.ts index 2abb126fe41..04e457e648d 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of45.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of45.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var k: string, v: boolean; var map = new Map([["", true]]); for ([k = "", v = false] of map) { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of46.ts b/crates/swc_ecma_parser/tests/tsc/for-of46.ts index 2b910d090de..e685dded4d8 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of46.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of46.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var k: string, v: boolean; var map = new Map([["", true]]); for ([k = false, v = ""] of map) { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of47.ts b/crates/swc_ecma_parser/tests/tsc/for-of47.ts index ea5c8f7781b..00a9942b5ea 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of47.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of47.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var x: string, y: number; var array = [{ x: "", y: true }] enum E { x } diff --git a/crates/swc_ecma_parser/tests/tsc/for-of48.ts b/crates/swc_ecma_parser/tests/tsc/for-of48.ts index 977abea06b8..48440a5b92b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of48.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of48.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var x: string, y: number; var array = [{ x: "", y: true }] enum E { x } diff --git a/crates/swc_ecma_parser/tests/tsc/for-of49.ts b/crates/swc_ecma_parser/tests/tsc/for-of49.ts index 4430cf3cb06..53aa4127ce5 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of49.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of49.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var k: string, v: boolean; var map = new Map([["", true]]); for ([k, ...[v]] of map) { diff --git a/crates/swc_ecma_parser/tests/tsc/for-of5.ts b/crates/swc_ecma_parser/tests/tsc/for-of5.ts index c297df2afa9..78e9f182e7a 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of5.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of5.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 for (let v of [0]) { v; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of50.ts b/crates/swc_ecma_parser/tests/tsc/for-of50.ts index c82d9fbac65..5cca8d0233c 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of50.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of50.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var map = new Map([["", true]]); for (const [k, v] of map) { k; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of51.ts b/crates/swc_ecma_parser/tests/tsc/for-of51.ts index 26bb1574157..d13cd42e16a 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of51.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of51.ts @@ -1,2 +1,2 @@ -//@target: ES6 +//@target: ES6 for (let let of []) {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of52.ts b/crates/swc_ecma_parser/tests/tsc/for-of52.ts index 10a66d9cab0..b24fa2f314b 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of52.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of52.ts @@ -1,2 +1,2 @@ -//@target: ES6 +//@target: ES6 for (let [v, v] of [[]]) {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of53.ts b/crates/swc_ecma_parser/tests/tsc/for-of53.ts index e5132935019..864bb0eb572 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of53.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of53.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 for (let v of []) { var v; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of54.ts b/crates/swc_ecma_parser/tests/tsc/for-of54.ts index dfde9ddc00f..fa56e1cc68f 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of54.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of54.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 for (let v of []) { var v = 0; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of55.ts b/crates/swc_ecma_parser/tests/tsc/for-of55.ts index c5faf41f87e..e9f88c245b1 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of55.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of55.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 let v = [1]; for (let v of v) { v; diff --git a/crates/swc_ecma_parser/tests/tsc/for-of56.ts b/crates/swc_ecma_parser/tests/tsc/for-of56.ts index 6d3f6a559a4..9c766742003 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of56.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of56.ts @@ -1,2 +1,2 @@ -//@target: ES6 +//@target: ES6 for (var let of []) {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of6.ts b/crates/swc_ecma_parser/tests/tsc/for-of6.ts index b720c45c3d8..d8f5a305cd8 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of6.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of6.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 for (v of [0]) { let v; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of7.ts b/crates/swc_ecma_parser/tests/tsc/for-of7.ts index 050c2d9b688..bbf7a91e7f4 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of7.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of7.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 v; for (let v of [0]) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of8.ts b/crates/swc_ecma_parser/tests/tsc/for-of8.ts index d1b011b0fb4..4f93d7b68d1 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of8.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of8.ts @@ -1,3 +1,3 @@ -//@target: ES6 +//@target: ES6 v; for (var v of [0]) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/for-of9.ts b/crates/swc_ecma_parser/tests/tsc/for-of9.ts index fda553573ee..293b9a036e7 100644 --- a/crates/swc_ecma_parser/tests/tsc/for-of9.ts +++ b/crates/swc_ecma_parser/tests/tsc/for-of9.ts @@ -1,4 +1,4 @@ -//@target: ES6 +//@target: ES6 var v: string; for (v of ["hello"]) { } for (v of "hello") { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.json b/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.json new file mode 100644 index 00000000000..bab2282e45b --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.json @@ -0,0 +1,972 @@ +{ + "type": "Script", + "span": { + "start": 96, + "end": 692, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 96, + "end": 174, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 102, + "end": 173, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 102, + "end": 107, + "ctxt": 0 + }, + "value": "sleep", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 110, + "end": 173, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 111, + "end": 121, + "ctxt": 0 + }, + "value": "tm", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 113, + "end": 121, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 115, + "end": 121, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ], + "body": { + "type": "NewExpression", + "span": { + "start": 126, + "end": 173, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 130, + "end": 137, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 138, + "end": 172, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 138, + "end": 145, + "ctxt": 0 + }, + "value": "resolve", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 149, + "end": 172, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 149, + "end": 159, + "ctxt": 0 + }, + "value": "setTimeout", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 160, + "end": 167, + "ctxt": 0 + }, + "value": "resolve", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 169, + "end": 171, + "ctxt": 0 + }, + "value": "tm", + "optional": false + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 192, + "end": 195, + "ctxt": 0 + }, + "value": "gen", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 176, + "end": 250, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 198, + "end": 250, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 204, + "end": 212, + "ctxt": 0 + }, + "expression": { + "type": "YieldExpression", + "span": { + "start": 204, + "end": 211, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 210, + "end": 211, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "delegate": false + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 217, + "end": 235, + "ctxt": 0 + }, + "expression": { + "type": "AwaitExpression", + "span": { + "start": 217, + "end": 234, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 223, + "end": 234, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 223, + "end": 228, + "ctxt": 0 + }, + "value": "sleep", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 229, + "end": 233, + "ctxt": 0 + }, + "value": 1000.0, + "raw": "1000" + } + } + ], + "typeArguments": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 240, + "end": 248, + "ctxt": 0 + }, + "expression": { + "type": "YieldExpression", + "span": { + "start": 240, + "end": 247, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 246, + "end": 247, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + }, + "delegate": false + } + } + ] + }, + "generator": true, + "async": true, + "typeParameters": null, + "returnType": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 252, + "end": 276, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 258, + "end": 275, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 258, + "end": 261, + "ctxt": 0 + }, + "value": "log", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 264, + "end": 275, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 264, + "end": 271, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 272, + "end": 275, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 278, + "end": 692, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 278, + "end": 691, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 278, + "end": 689, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 279, + "end": 688, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 291, + "end": 688, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ForOfStatement", + "span": { + "start": 297, + "end": 686, + "ctxt": 0 + }, + "await": { + "start": 301, + "end": 306, + "ctxt": 0 + }, + "left": { + "type": "VariableDeclaration", + "span": { + "start": 308, + "end": 319, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 314, + "end": 319, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 314, + "end": 319, + "ctxt": 0 + }, + "value": "outer", + "optional": false, + "typeAnnotation": null + }, + "init": null, + "definite": false + } + ] + }, + "right": { + "type": "CallExpression", + "span": { + "start": 323, + "end": 328, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 323, + "end": 326, + "ctxt": 0 + }, + "value": "gen", + "optional": false + }, + "arguments": [], + "typeArguments": null + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 330, + "end": 686, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 340, + "end": 365, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 340, + "end": 364, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 340, + "end": 343, + "ctxt": 0 + }, + "value": "log", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 344, + "end": 363, + "ctxt": 0 + }, + "expressions": [ + { + "type": "Identifier", + "span": { + "start": 356, + "end": 361, + "ctxt": 0 + }, + "value": "outer", + "optional": false + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 345, + "end": 354, + "ctxt": 0 + }, + "tail": false, + "cooked": "I'm loop ", + "raw": "I'm loop " + }, + { + "type": "TemplateElement", + "span": { + "start": 362, + "end": 362, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 374, + "end": 680, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 374, + "end": 679, + "ctxt": 0 + }, + "callee": { + "type": "ParenthesisExpression", + "span": { + "start": 374, + "end": 677, + "ctxt": 0 + }, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 375, + "end": 676, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 387, + "end": 676, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 401, + "end": 421, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 407, + "end": 420, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 407, + "end": 412, + "ctxt": 0 + }, + "value": "inner", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 415, + "end": 420, + "ctxt": 0 + }, + "value": "outer", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 434, + "end": 452, + "ctxt": 0 + }, + "expression": { + "type": "AwaitExpression", + "span": { + "start": 434, + "end": 451, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 440, + "end": 451, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 440, + "end": 445, + "ctxt": 0 + }, + "value": "sleep", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 446, + "end": 450, + "ctxt": 0 + }, + "value": 2000.0, + "raw": "2000" + } + } + ], + "typeArguments": null + } + } + }, + { + "type": "IfStatement", + "span": { + "start": 465, + "end": 666, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 469, + "end": 484, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 469, + "end": 474, + "ctxt": 0 + }, + "value": "inner", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 479, + "end": 484, + "ctxt": 0 + }, + "value": "outer", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 486, + "end": 572, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 504, + "end": 558, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 504, + "end": 557, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 504, + "end": 507, + "ctxt": 0 + }, + "value": "log", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 508, + "end": 556, + "ctxt": 0 + }, + "expressions": [ + { + "type": "Identifier", + "span": { + "start": 520, + "end": 525, + "ctxt": 0 + }, + "value": "inner", + "optional": false + }, + { + "type": "Identifier", + "span": { + "start": 549, + "end": 554, + "ctxt": 0 + }, + "value": "outer", + "optional": false + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 509, + "end": 518, + "ctxt": 0 + }, + "tail": false, + "cooked": "I'm loop ", + "raw": "I'm loop " + }, + { + "type": "TemplateElement", + "span": { + "start": 526, + "end": 547, + "ctxt": 0 + }, + "tail": false, + "cooked": " and I know I'm loop ", + "raw": " and I know I'm loop " + }, + { + "type": "TemplateElement", + "span": { + "start": 555, + "end": 555, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ], + "typeArguments": null + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 578, + "end": 666, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 596, + "end": 652, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 596, + "end": 651, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 596, + "end": 599, + "ctxt": 0 + }, + "value": "log", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 600, + "end": 650, + "ctxt": 0 + }, + "expressions": [ + { + "type": "Identifier", + "span": { + "start": 612, + "end": 617, + "ctxt": 0 + }, + "value": "inner", + "optional": false + }, + { + "type": "Identifier", + "span": { + "start": 643, + "end": 648, + "ctxt": 0 + }, + "value": "outer", + "optional": false + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 601, + "end": 610, + "ctxt": 0 + }, + "tail": false, + "cooked": "I'm loop ", + "raw": "I'm loop " + }, + { + "type": "TemplateElement", + "span": { + "start": 618, + "end": 641, + "ctxt": 0 + }, + "tail": false, + "cooked": ", but I think I'm loop ", + "raw": ", but I think I'm loop " + }, + { + "type": "TemplateElement", + "span": { + "start": 649, + "end": 649, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ], + "typeArguments": null + } + } + ] + } + } + ] + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + } + } + ] + }, + "async": true, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.ts b/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.ts new file mode 100644 index 00000000000..4a41e63c038 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/forAwaitPerIterationBindingDownlevel.ts @@ -0,0 +1,29 @@ +// @target: es5 +// @lib: esnext, dom +// @downlevelIteration: true +// @noTypesAndSymbols: true + +const sleep = (tm: number) => new Promise(resolve => setTimeout(resolve, tm)); + +async function* gen() { + yield 1; + await sleep(1000); + yield 2; +} + +const log = console.log; + +(async () => { + for await (const outer of gen()) { + log(`I'm loop ${outer}`); + (async () => { + const inner = outer; + await sleep(2000); + if (inner === outer) { + log(`I'm loop ${inner} and I know I'm loop ${outer}`); + } else { + log(`I'm loop ${inner}, but I think I'm loop ${outer}`); + } + })(); + } +})(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping1.ts b/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping1.ts index 915180855a0..3932df23597 100644 --- a/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping1.ts +++ b/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping1.ts @@ -1,4 +1,4 @@ -// When a function expression with no type parameters and no parameter type annotations +// When a function expression with no type parameters and no parameter type annotations // is contextually typed (section 4.19) by a type T and a contextual signature S can be extracted from T enum E { red, blue } diff --git a/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping2.ts b/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping2.ts index f8b8e7b9213..4535584e530 100644 --- a/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping2.ts +++ b/crates/swc_ecma_parser/tests/tsc/functionExpressionContextualTyping2.ts @@ -1,4 +1,4 @@ -// A contextual signature S is extracted from a function type T as follows: +// A contextual signature S is extracted from a function type T as follows: // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. // If T is a union type, let U be the set of element types in T that have call signatures. // If each type in U has exactly one call signature and that call signature is non- generic, diff --git a/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.json b/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.json deleted file mode 100644 index 99d9d166195..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 90, - "end": 367, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 99, - "end": 103, - "ctxt": 0 - }, - "value": "fn4a", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 104, - "end": 114, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 104, - "end": 114, - "ctxt": 0 - }, - "value": "x", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 106, - "end": 114, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 108, - "end": 114, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 116, - "end": 125, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 116, - "end": 125, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 90, - "end": 127, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 137, - "end": 141, - "ctxt": 0 - }, - "value": "fn4a", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 128, - "end": 147, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 147, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 158, - "end": 162, - "ctxt": 0 - }, - "value": "fn4b", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 172, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 166, - "end": 172, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 174, - "end": 184, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 174, - "end": 184, - "ctxt": 0 - }, - "value": "x", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 176, - "end": 184, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 178, - "end": 184, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 186, - "end": 195, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 186, - "end": 195, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 189, - "end": 195, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 149, - "end": 197, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "value": "fn4b", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 198, - "end": 217, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 309, - "end": 312, - "ctxt": 0 - }, - "value": "fn5", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 313, - "end": 322, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 313, - "end": 322, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 314, - "end": 322, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 316, - "end": 322, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 324, - "end": 335, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 324, - "end": 335, - "ctxt": 0 - }, - "rest": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 328, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 330, - "end": 335, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 337, - "end": 346, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 337, - "end": 346, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 338, - "end": 346, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 300, - "end": 348, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 358, - "end": 361, - "ctxt": 0 - }, - "value": "fn5", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 349, - "end": 367, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 364, - "end": 367, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.ts b/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.ts deleted file mode 100644 index 811ec92b896..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionOverloadErrorsSyntax.ts +++ /dev/null @@ -1,10 +0,0 @@ -//Function overload signature with optional parameter followed by non-optional parameter -function fn4a(x?: number, y: string); -function fn4a() { } - -function fn4b(n: string, x?: number, y: string); -function fn4b() { } - -//Function overload signature with rest param followed by non-optional parameter -function fn5(x: string, ...y: any[], z: string); -function fn5() { } diff --git a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.json b/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.json deleted file mode 100644 index 1a096d28ce1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.json +++ /dev/null @@ -1,1381 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 1, - "end": 681, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 12, - "end": 18, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 12, - "end": 18, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 12, - "end": 13, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 16, - "end": 18, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 1, - "end": 41, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 20, - "end": 41, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 26, - "end": 39, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 26, - "end": 38, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 43, - "end": 63, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 50, - "end": 63, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 54, - "end": 62, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 60, - "end": 62, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "definite": false - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 73, - "end": 74, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 75, - "end": 81, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 75, - "end": 81, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 75, - "end": 76, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 79, - "end": 81, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 64, - "end": 86, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 83, - "end": 86, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 97, - "end": 106, - "ctxt": 0 - }, - "value": "container", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 88, - "end": 161, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 109, - "end": 161, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 115, - "end": 128, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 115, - "end": 127, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 144, - "end": 150, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 144, - "end": 150, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 148, - "end": 150, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 133, - "end": 159, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 152, - "end": 159, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 172, - "end": 176, - "ctxt": 0 - }, - "value": "rest", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 177, - "end": 191, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 177, - "end": 191, - "ctxt": 0 - }, - "rest": { - "start": 177, - "end": 180, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 184, - "end": 191, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 186, - "end": 191, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 163, - "end": 214, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 193, - "end": 214, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 199, - "end": 212, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 199, - "end": 211, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "rest1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 231, - "end": 236, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 231, - "end": 236, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 238, - "end": 245, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 238, - "end": 245, - "ctxt": 0 - }, - "rest": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 241, - "end": 245, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 216, - "end": 268, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 247, - "end": 268, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 253, - "end": 266, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 253, - "end": 265, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 279, - "end": 291, - "ctxt": 0 - }, - "value": "paramDefault", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 292, - "end": 297, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 300, - "end": 301, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 270, - "end": 324, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 303, - "end": 324, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 309, - "end": 322, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 309, - "end": 321, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 335, - "end": 355, - "ctxt": 0 - }, - "value": "objectBindingPattern", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 356, - "end": 366, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 356, - "end": 366, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 361, - "end": 366, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 326, - "end": 389, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 368, - "end": 389, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 374, - "end": 387, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 374, - "end": 386, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 400, - "end": 419, - "ctxt": 0 - }, - "value": "arrayBindingPattern", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 420, - "end": 432, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ArrayPattern", - "span": { - "start": 420, - "end": 432, - "ctxt": 0 - }, - "elements": [ - { - "type": "Identifier", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 425, - "end": 432, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 427, - "end": 432, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 391, - "end": 455, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 434, - "end": 455, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 440, - "end": 453, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 440, - "end": 452, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 466, - "end": 479, - "ctxt": 0 - }, - "value": "manyParameter", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 480, - "end": 486, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 480, - "end": 486, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 480, - "end": 481, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 484, - "end": 486, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 488, - "end": 494, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 488, - "end": 494, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 488, - "end": 489, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 492, - "end": 494, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 457, - "end": 517, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 496, - "end": 517, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 502, - "end": 515, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 502, - "end": 514, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 528, - "end": 540, - "ctxt": 0 - }, - "value": "manyPrologue", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 541, - "end": 547, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 541, - "end": 547, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 541, - "end": 542, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 545, - "end": 547, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 549, - "end": 555, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 549, - "end": 555, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 549, - "end": 550, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 553, - "end": 555, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 519, - "end": 589, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 557, - "end": 589, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 563, - "end": 569, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 563, - "end": 568, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 574, - "end": 587, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 574, - "end": 586, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 600, - "end": 615, - "ctxt": 0 - }, - "value": "invalidPrologue", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 616, - "end": 622, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 616, - "end": 622, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 616, - "end": 617, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 620, - "end": 622, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 624, - "end": 630, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 624, - "end": 630, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 624, - "end": 625, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 628, - "end": 630, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 591, - "end": 681, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 632, - "end": 681, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 638, - "end": 644, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 638, - "end": 643, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 649, - "end": 661, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 655, - "end": 660, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 655, - "end": 656, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 659, - "end": 660, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 666, - "end": 679, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 666, - "end": 678, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.ts b/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.ts deleted file mode 100644 index d4b8ced9b42..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList.ts +++ /dev/null @@ -1,48 +0,0 @@ -function a(a = 10) { - "use strict"; -} - -export var foo = 10; -function b(a = 10) { -} - -function container() { - "use strict"; - function f(a = 10) { - } -} - -function rest(...args: any[]) { - 'use strict'; -} - -function rest1(a = 1, ...args) { - 'use strict'; -} - -function paramDefault(param = 1) { - 'use strict'; -} - -function objectBindingPattern({foo}: any) { - 'use strict'; -} - -function arrayBindingPattern([foo]: any[]) { - 'use strict'; -} - -function manyParameter(a = 10, b = 20) { - "use strict"; -} - -function manyPrologue(a = 10, b = 20) { - "foo"; - "use strict"; -} - -function invalidPrologue(a = 10, b = 20) { - "foo"; - const c = 1; - "use strict"; -} diff --git a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.json b/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.json deleted file mode 100644 index 208824fa768..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.json +++ /dev/null @@ -1,1381 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 21, - "end": 701, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 36, - "end": 38, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 21, - "end": 61, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 40, - "end": 61, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 46, - "end": 59, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 46, - "end": 58, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 63, - "end": 83, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 83, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 80, - "end": 82, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "definite": false - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 93, - "end": 94, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 95, - "end": 101, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 95, - "end": 101, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 95, - "end": 96, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 99, - "end": 101, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 84, - "end": 106, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 103, - "end": 106, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 117, - "end": 126, - "ctxt": 0 - }, - "value": "container", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 108, - "end": 181, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 129, - "end": 181, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 135, - "end": 148, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 147, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 164, - "end": 170, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 164, - "end": 170, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 164, - "end": 165, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 168, - "end": 170, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 153, - "end": 179, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 172, - "end": 179, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 192, - "end": 196, - "ctxt": 0 - }, - "value": "rest", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 197, - "end": 211, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 197, - "end": 211, - "ctxt": 0 - }, - "rest": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 200, - "end": 204, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 211, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 206, - "end": 211, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 183, - "end": 234, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 213, - "end": 234, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 219, - "end": 232, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 219, - "end": 231, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 245, - "end": 250, - "ctxt": 0 - }, - "value": "rest1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 251, - "end": 256, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 251, - "end": 256, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 251, - "end": 252, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 255, - "end": 256, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 258, - "end": 265, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 258, - "end": 265, - "ctxt": 0 - }, - "rest": { - "start": 258, - "end": 261, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 261, - "end": 265, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 236, - "end": 288, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 267, - "end": 288, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 273, - "end": 286, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 273, - "end": 285, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 299, - "end": 311, - "ctxt": 0 - }, - "value": "paramDefault", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 312, - "end": 317, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 290, - "end": 344, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 323, - "end": 344, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 329, - "end": 342, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 329, - "end": 341, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 355, - "end": 375, - "ctxt": 0 - }, - "value": "objectBindingPattern", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 376, - "end": 386, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 376, - "end": 386, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 381, - "end": 386, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 346, - "end": 409, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 388, - "end": 409, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 394, - "end": 407, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 394, - "end": 406, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 420, - "end": 439, - "ctxt": 0 - }, - "value": "arrayBindingPattern", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 440, - "end": 452, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ArrayPattern", - "span": { - "start": 440, - "end": 452, - "ctxt": 0 - }, - "elements": [ - { - "type": "Identifier", - "span": { - "start": 441, - "end": 444, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 445, - "end": 452, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 447, - "end": 452, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 447, - "end": 450, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 411, - "end": 475, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 454, - "end": 475, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 460, - "end": 473, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 460, - "end": 472, - "ctxt": 0 - }, - "value": "use strict", - "raw": "'use strict'" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 486, - "end": 499, - "ctxt": 0 - }, - "value": "manyParameter", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 500, - "end": 506, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 500, - "end": 506, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 504, - "end": 506, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 508, - "end": 509, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 512, - "end": 514, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 477, - "end": 537, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 516, - "end": 537, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 522, - "end": 535, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 522, - "end": 534, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 548, - "end": 560, - "ctxt": 0 - }, - "value": "manyPrologue", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 561, - "end": 567, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 561, - "end": 567, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 561, - "end": 562, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 565, - "end": 567, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 569, - "end": 575, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 569, - "end": 575, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 569, - "end": 570, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 573, - "end": 575, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 539, - "end": 609, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 577, - "end": 609, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 583, - "end": 589, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 583, - "end": 588, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 594, - "end": 607, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 594, - "end": 606, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 620, - "end": 635, - "ctxt": 0 - }, - "value": "invalidPrologue", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 636, - "end": 642, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 636, - "end": 642, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 636, - "end": 637, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 640, - "end": 642, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 644, - "end": 650, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 644, - "end": 650, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 644, - "end": 645, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 648, - "end": 650, - "ctxt": 0 - }, - "value": 20.0, - "raw": "20" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 611, - "end": 701, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 652, - "end": 701, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 658, - "end": 664, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 658, - "end": 663, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 669, - "end": 681, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 675, - "end": 680, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 675, - "end": 676, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 679, - "end": 680, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 686, - "end": 699, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 686, - "end": 698, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.ts b/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.ts deleted file mode 100644 index 6c9fadd1ac1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/functionWithUseStrictAndSimpleParameterList_es2016.ts +++ /dev/null @@ -1,50 +0,0 @@ -// @target: es2016 - -function a(a = 10) { - "use strict"; -} - -export var foo = 10; -function b(a = 10) { -} - -function container() { - "use strict"; - function f(a = 10) { - } -} - -function rest(...args: any[]) { - 'use strict'; -} - -function rest1(a = 1, ...args) { - 'use strict'; -} - -function paramDefault(param = 1) { - 'use strict'; -} - -function objectBindingPattern({foo}: any) { - 'use strict'; -} - -function arrayBindingPattern([foo]: any[]) { - 'use strict'; -} - -function manyParameter(a = 10, b = 20) { - "use strict"; -} - -function manyPrologue(a = 10, b = 20) { - "foo"; - "use strict"; -} - -function invalidPrologue(a = 10, b = 20) { - "foo"; - const c = 1; - "use strict"; -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.json b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.json deleted file mode 100644 index 45768b90567..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 38, - "end": 56, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 39, - "end": 48, - "ctxt": 0 - }, - "value": "generator", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 56, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 55, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.ts b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.ts deleted file mode 100644 index a438eae06a6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext1.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare class C { - *generator(): any; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.json b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.json deleted file mode 100644 index f752f49d5f9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 68, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 16, - "end": 68, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 33, - "end": 68, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "value": "generator", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 39, - "end": 66, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 60, - "end": 65, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.ts b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.ts deleted file mode 100644 index 4721ddc72e3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext2.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare module M { - function *generator(): any; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.json b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.json deleted file mode 100644 index 45768b90567..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 38, - "end": 56, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 39, - "end": 48, - "ctxt": 0 - }, - "value": "generator", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 56, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 55, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.ts b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.ts deleted file mode 100644 index a438eae06a6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext3.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare class C { - *generator(): any; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.json b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.json deleted file mode 100644 index f752f49d5f9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 68, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 16, - "end": 68, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 33, - "end": 68, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "value": "generator", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 39, - "end": 66, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 60, - "end": 65, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.ts b/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.ts deleted file mode 100644 index 4721ddc72e3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorInAmbientContext4.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare module M { - function *generator(): any; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.json b/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.json deleted file mode 100644 index c6cbebad6ba..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 157, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 16, - "end": 157, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 25, - "end": 157, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 43, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 43, - "end": 52, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 44, - "end": 52, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 46, - "end": 52, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 31, - "end": 69, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 68, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 55, - "end": 68, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 55, - "end": 63, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 63, - "end": 68, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 64, - "end": 67, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 84, - "end": 85, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 86, - "end": 95, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 86, - "end": 95, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 87, - "end": 95, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 89, - "end": 95, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 74, - "end": 112, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 96, - "end": 111, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 98, - "end": 111, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 98, - "end": 106, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 106, - "end": 111, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 107, - "end": 110, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 127, - "end": 128, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 129, - "end": 135, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 129, - "end": 135, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 130, - "end": 135, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 117, - "end": 155, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 151, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 138, - "end": 151, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 138, - "end": 146, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 146, - "end": 151, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.ts b/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.ts deleted file mode 100644 index 3e64865029c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads1.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -module M { - function* f(s: string): Iterable; - function* f(s: number): Iterable; - function* f(s: any): Iterable { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.json b/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.json deleted file mode 100644 index c51393ab14a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 162, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 16, - "end": 162, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 33, - "end": 162, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 51, - "end": 60, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 51, - "end": 60, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 52, - "end": 60, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 54, - "end": 60, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 39, - "end": 77, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 61, - "end": 76, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 63, - "end": 76, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 63, - "end": 71, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 71, - "end": 76, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 92, - "end": 93, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 94, - "end": 103, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 94, - "end": 103, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 97, - "end": 103, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 82, - "end": 120, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 104, - "end": 119, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 106, - "end": 119, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 106, - "end": 114, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 114, - "end": 119, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 115, - "end": 118, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 140, - "end": 143, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 125, - "end": 160, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 144, - "end": 159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 146, - "end": 159, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 154, - "end": 159, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.ts b/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.ts deleted file mode 100644 index b805be61461..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads2.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -declare module M { - function* f(s: string): Iterable; - function* f(s: number): Iterable; - function* f(s: any): Iterable; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.json b/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.json deleted file mode 100644 index d921daccfb5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.json +++ /dev/null @@ -1,403 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 129, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 129, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 59, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 33, - "end": 42, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 33, - "end": 42, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 34, - "end": 42, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 36, - "end": 42, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 59, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 43, - "end": 58, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 45, - "end": 58, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 45, - "end": 53, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 53, - "end": 58, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 64, - "end": 93, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 67, - "end": 76, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 67, - "end": 76, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 68, - "end": 76, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 70, - "end": 76, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 64, - "end": 93, - "ctxt": 0 - }, - "body": null, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 77, - "end": 92, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 79, - "end": 92, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 79, - "end": 87, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 87, - "end": 92, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 88, - "end": 91, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 98, - "end": 127, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 101, - "end": 107, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 102, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 98, - "end": 127, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 124, - "end": 127, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 108, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 110, - "end": 123, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 110, - "end": 118, - "ctxt": 0 - }, - "value": "Iterable", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 118, - "end": 123, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.ts b/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.ts deleted file mode 100644 index 150c2832da0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorOverloads3.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -class C { - *f(s: string): Iterable; - *f(s: number): Iterable; - *f(s: any): Iterable { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.json deleted file mode 100644 index 496ecd1b4f8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 67, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 30, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 29, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 29, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 23, - "end": 29, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 31, - "end": 67, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 35, - "end": 64, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 50, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 38, - "end": 50, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 44, - "end": 50, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 53, - "end": 64, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "Identifier", - "span": { - "start": 59, - "end": 64, - "ctxt": 0 - }, - "value": "yield", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.ts deleted file mode 100644 index 7b89362c1d0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck32.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -var s: string; -var f: () => number = () => yield s; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.json deleted file mode 100644 index cbaf000b726..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 150, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 25, - "end": 34, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 16, - "end": 67, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 67, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 49, - "end": 65, - "ctxt": 0 - }, - "argument": { - "type": "ArrowFunctionExpression", - "span": { - "start": 56, - "end": 64, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 61, - "end": 64, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 78, - "end": 79, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 68, - "end": 150, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 82, - "end": 150, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 88, - "end": 148, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 88, - "end": 107, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 89, - "end": 107, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 89, - "end": 98, - "ctxt": 0 - }, - "value": "decorator", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "YieldExpression", - "span": { - "start": 99, - "end": 106, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "delegate": false - } - } - ], - "typeArguments": null - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 130, - "end": 142, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 134, - "end": 141, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.ts deleted file mode 100644 index 1ce91b92b92..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck39.ts +++ /dev/null @@ -1,10 +0,0 @@ -//@target: ES6 -function decorator(x: any) { - return y => { }; -} -function* g() { - @decorator(yield 0) - class C { - x = yield 0; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.json deleted file mode 100644 index 375274e580f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 75, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 16, - "end": 75, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 75, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 42, - "end": 43, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 36, - "end": 72, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 54, - "end": 66, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 54, - "end": 55, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 64, - "end": 65, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 72, - "end": 73, - "ctxt": 0 - } - } - ] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.ts deleted file mode 100644 index d93509dec2a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck57.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -function* g() { - class C { - x = yield 0; - }; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.json deleted file mode 100644 index 664562310a8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 82, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 16, - "end": 82, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 82, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 42, - "end": 43, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 36, - "end": 79, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 54, - "end": 73, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "YieldExpression", - "span": { - "start": 65, - "end": 72, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 71, - "end": 72, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "delegate": false - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - } - } - ] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.ts deleted file mode 100644 index 97903c536fa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck58.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -function* g() { - class C { - static x = yield 0; - }; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.json deleted file mode 100644 index aa513711d28..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 90, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 16, - "end": 90, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 90, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 42, - "end": 43, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 36, - "end": 87, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 54, - "end": 81, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 54, - "end": 65, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 56, - "end": 64, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 62, - "end": 64, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "delegate": false - } - } - ], - "span": { - "start": 54, - "end": 81, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 78, - "end": 81, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - } - } - ] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.ts deleted file mode 100644 index e778fe97a1f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck59.ts +++ /dev/null @@ -1,7 +0,0 @@ -//@target: ES6 -function* g() { - class C { - @(yield "") - m() { } - }; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.json b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.json deleted file mode 100644 index 8923c883839..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 31, - "end": 65, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 37, - "end": 62, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 37, - "end": 47, - "ctxt": 0 - }, - "expression": { - "type": "YieldExpression", - "span": { - "start": 39, - "end": 46, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "delegate": false - } - } - ], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - } - } - ] - }, - "generator": true, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.ts deleted file mode 100644 index 386e335e829..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck61.ts +++ /dev/null @@ -1,5 +0,0 @@ -//@target: ES6 -function * g() { - @(yield 0) - class C {}; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck62.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck62.ts index 02e990b6305..dcf031fc001 100644 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck62.ts +++ b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck62.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: es6 // @noImplicitAny: true diff --git a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck63.ts b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck63.ts index 02acf964849..3f0fd6376a0 100644 --- a/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck63.ts +++ b/crates/swc_ecma_parser/tests/tsc/generatorTypeCheck63.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: es6 // @noImplicitAny: true diff --git a/crates/swc_ecma_parser/tests/tsc/genericCallWithTupleType.ts b/crates/swc_ecma_parser/tests/tsc/genericCallWithTupleType.ts index f21f558525a..60198e1c510 100644 --- a/crates/swc_ecma_parser/tests/tsc/genericCallWithTupleType.ts +++ b/crates/swc_ecma_parser/tests/tsc/genericCallWithTupleType.ts @@ -1,4 +1,4 @@ -interface I { +interface I { tuple1: [T, U]; } diff --git a/crates/swc_ecma_parser/tests/tsc/genericClassExpressionInFunction.ts b/crates/swc_ecma_parser/tests/tsc/genericClassExpressionInFunction.ts index 36a92e6981c..a202d4aec11 100644 --- a/crates/swc_ecma_parser/tests/tsc/genericClassExpressionInFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/genericClassExpressionInFunction.ts @@ -1,4 +1,4 @@ -class A { +class A { genericVar: T } function B1() { diff --git a/crates/swc_ecma_parser/tests/tsc/getSetAccessorContextualTyping.ts b/crates/swc_ecma_parser/tests/tsc/getSetAccessorContextualTyping.ts index 86575042706..97eec92760d 100644 --- a/crates/swc_ecma_parser/tests/tsc/getSetAccessorContextualTyping.ts +++ b/crates/swc_ecma_parser/tests/tsc/getSetAccessorContextualTyping.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // In the body of a get accessor with no return type annotation, // if a matching set accessor exists and that set accessor has a parameter type annotation, // return expressions are contextually typed by the type given in the set accessor's parameter type annotation. diff --git a/crates/swc_ecma_parser/tests/tsc/globalAugmentationModuleResolution.ts b/crates/swc_ecma_parser/tests/tsc/globalAugmentationModuleResolution.ts index 231dcf2920e..9d9d5704278 100644 --- a/crates/swc_ecma_parser/tests/tsc/globalAugmentationModuleResolution.ts +++ b/crates/swc_ecma_parser/tests/tsc/globalAugmentationModuleResolution.ts @@ -1,4 +1,4 @@ -// @traceResolution: true +// @traceResolution: true // @fileName: a.ts export { }; diff --git a/crates/swc_ecma_parser/tests/tsc/importAssertion1.json b/crates/swc_ecma_parser/tests/tsc/importAssertion1.json deleted file mode 100644 index c60dfe93fd1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importAssertion1.json +++ /dev/null @@ -1,1636 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 99, - "end": 860, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 99, - "end": 118, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 106, - "end": 118, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 112, - "end": 117, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 113, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 119, - "end": 138, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 126, - "end": 138, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 132, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 136, - "end": 137, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 159, - "end": 195, - "ctxt": 0 - }, - "specifiers": [], - "source": { - "type": "StringLiteral", - "span": { - "start": 166, - "end": 171, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - }, - "typeOnly": false, - "asserts": { - "type": "ObjectExpression", - "span": { - "start": 179, - "end": 195, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 181, - "end": 185, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 196, - "end": 248, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 217, - "end": 222, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - }, - "typeOnly": false, - "asserts": { - "type": "ObjectExpression", - "span": { - "start": 230, - "end": 248, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "value": "type", - "raw": "\"type\"" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 240, - "end": 246, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 249, - "end": 299, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 256, - "end": 264, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - }, - "typeOnly": false, - "asserts": { - "type": "ObjectExpression", - "span": { - "start": 283, - "end": 299, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 285, - "end": 289, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 291, - "end": 297, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 300, - "end": 302, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 300, - "end": 301, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 303, - "end": 305, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 306, - "end": 312, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 306, - "end": 311, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 306, - "end": 309, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 313, - "end": 319, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 313, - "end": 318, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 313, - "end": 316, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 340, - "end": 376, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 361, - "end": 366, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - }, - "typeOnly": false, - "asserts": { - "type": "ObjectExpression", - "span": { - "start": 374, - "end": 376, - "ctxt": 0 - }, - "properties": [] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 377, - "end": 447, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 386, - "end": 392, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 391, - "end": 392, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "imported": { - "type": "Identifier", - "span": { - "start": 386, - "end": 387, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 394, - "end": 400, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 399, - "end": 400, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "imported": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 408, - "end": 413, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - }, - "typeOnly": false, - "asserts": { - "type": "ObjectExpression", - "span": { - "start": 421, - "end": 447, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 423, - "end": 424, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 426, - "end": 429, - "ctxt": 0 - }, - "value": "a", - "raw": "\"a\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 431, - "end": 432, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 434, - "end": 437, - "ctxt": 0 - }, - "value": "b", - "raw": "\"b\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 439, - "end": 440, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 442, - "end": 445, - "ctxt": 0 - }, - "value": "c", - "raw": "\"c\"" - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 448, - "end": 450, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 451, - "end": 453, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 454, - "end": 456, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 457, - "end": 459, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 457, - "end": 458, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 480, - "end": 503, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 486, - "end": 503, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 486, - "end": 487, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 490, - "end": 503, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 490, - "end": 496, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 497, - "end": 502, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 504, - "end": 557, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 510, - "end": 557, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 510, - "end": 511, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 514, - "end": 557, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 514, - "end": 520, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 521, - "end": 526, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 528, - "end": 556, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 530, - "end": 536, - "ctxt": 0 - }, - "value": "assert", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 538, - "end": 554, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 540, - "end": 544, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 546, - "end": 552, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 558, - "end": 626, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 564, - "end": 626, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 564, - "end": 565, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 568, - "end": 626, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 568, - "end": 574, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 575, - "end": 580, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 582, - "end": 625, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 584, - "end": 590, - "ctxt": 0 - }, - "value": "assert", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 592, - "end": 623, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 594, - "end": 598, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 600, - "end": 606, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 608, - "end": 613, - "ctxt": 0 - }, - "value": "ttype", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 615, - "end": 621, - "ctxt": 0 - }, - "value": "typo", - "raw": "\"typo\"" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 627, - "end": 666, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 633, - "end": 666, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 633, - "end": 634, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 637, - "end": 666, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 637, - "end": 643, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 644, - "end": 649, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 651, - "end": 665, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 653, - "end": 659, - "ctxt": 0 - }, - "value": "assert", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 661, - "end": 663, - "ctxt": 0 - }, - "properties": [] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 667, - "end": 695, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 673, - "end": 695, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 673, - "end": 675, - "ctxt": 0 - }, - "value": "dd", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 678, - "end": 695, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 678, - "end": 684, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 685, - "end": 690, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 692, - "end": 694, - "ctxt": 0 - }, - "properties": [] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 713, - "end": 716, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 696, - "end": 724, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 718, - "end": 723, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 720, - "end": 723, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 725, - "end": 755, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 731, - "end": 755, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 731, - "end": 732, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 735, - "end": 755, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 735, - "end": 741, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 742, - "end": 747, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 749, - "end": 754, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 749, - "end": 752, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 756, - "end": 774, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 762, - "end": 774, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 762, - "end": 763, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 766, - "end": 774, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 766, - "end": 772, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 775, - "end": 806, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 781, - "end": 806, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 781, - "end": 782, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 785, - "end": 806, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 785, - "end": 791, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 792, - "end": 797, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 799, - "end": 801, - "ctxt": 0 - }, - "properties": [] - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 803, - "end": 805, - "ctxt": 0 - }, - "properties": [] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 807, - "end": 860, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 813, - "end": 860, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 813, - "end": 814, - "ctxt": 0 - }, - "value": "h", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 817, - "end": 860, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 817, - "end": 823, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 824, - "end": 829, - "ctxt": 0 - }, - "value": "./0", - "raw": "'./0'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 831, - "end": 858, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 833, - "end": 839, - "ctxt": 0 - }, - "value": "assert", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 841, - "end": 857, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 843, - "end": 847, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 849, - "end": 855, - "ctxt": 0 - }, - "value": "json", - "raw": "\"json\"" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/importAssertion1.ts b/crates/swc_ecma_parser/tests/tsc/importAssertion1.ts deleted file mode 100644 index 024da6c951f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importAssertion1.ts +++ /dev/null @@ -1,37 +0,0 @@ -// @declaration: true -// @target: es2015 -// @module: es2015, commonjs, esnext - -// @filename: 0.ts -export const a = 1; -export const b = 2; - -// @filename: 1.ts -import './0' assert { type: "json" } -import { a, b } from './0' assert { "type": "json" } -import * as foo from './0' assert { type: "json" } -a; -b; -foo.a; -foo.b; - -// @filename: 2.ts -import { a, b } from './0' assert {} -import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } -a; -b; -c; -d; - -// @filename: 3.ts -const a = import('./0') -const b = import('./0', { assert: { type: "json" } }) -const c = import('./0', { assert: { type: "json", ttype: "typo" } }) -const d = import('./0', { assert: {} }) -const dd = import('./0', {}) -declare function foo(): any; -const e = import('./0', foo()) -const f = import() -const g = import('./0', {}, {}) -const h = import('./0', { assert: { type: "json" }},) - diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression1ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression1ES2020.ts index ae39121399b..8b2cfd3c15b 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression1ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression1ES2020.ts @@ -1,4 +1,4 @@ -// @module: es2020 +// @module: es2020 // @target: es2020 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression2ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression2ES2020.ts index 958eef22d60..1657581306a 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression2ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression2ES2020.ts @@ -1,4 +1,4 @@ -// @module: es2020 +// @module: es2020 // @target: es2020 // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression3ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression3ES2020.ts index 54d3934bd90..fbd71113dc6 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression3ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression3ES2020.ts @@ -1,4 +1,4 @@ -// @module: es2020 +// @module: es2020 // @target: es2020 // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression4ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression4ES2020.ts index 694168fd64b..91047c6115c 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression4ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression4ES2020.ts @@ -1,4 +1,4 @@ -// @lib: es2020 +// @lib: es2020 // @module: es2020 // @target: es2020 // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression5ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression5ES2020.ts index f0404baa7e3..188b529d2e4 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression5ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression5ES2020.ts @@ -1,4 +1,4 @@ -// @module: es2020 +// @module: es2020 // @target: es2020 // @strictNullChecks: true // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpression6ES2020.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpression6ES2020.ts index a8e4b460f2a..b8b8162e0ac 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpression6ES2020.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpression6ES2020.ts @@ -1,4 +1,4 @@ -// @module: es2020 +// @module: es2020 // @target: es2020 // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5AMD.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5AMD.ts index b5f871ea490..e7bcbda5f83 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5AMD.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5AMD.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: es5 // @lib: es6 // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5CJS.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5CJS.ts index b834c8119f6..d8bbe9f1fb3 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5CJS.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5CJS.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: es5 // @lib: es6 // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5System.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5System.ts index ba2d165fa12..fa5879aef33 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5System.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5System.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: es5 // @lib: es6 // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5UMD.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5UMD.ts index e0b2a329a2c..d9ae71b2d77 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5UMD.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES5UMD.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: es5 // @lib: es6 // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6AMD.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6AMD.ts index e8934df58fa..84129044da3 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6AMD.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6AMD.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: es6 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6CJS.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6CJS.ts index 5509c48c016..a82d694f44e 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6CJS.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6CJS.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: es6 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6System.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6System.ts index 0c272a00340..0aa9d1b517d 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6System.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6System.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: es6 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6UMD.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6UMD.ts index c2a7b96a64d..ec6a8905624 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6UMD.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionES6UMD.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: es6 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.json b/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.json deleted file mode 100644 index 2d25f167f21..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 64, - "end": 278, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 81, - "end": 93, - "ctxt": 0 - }, - "value": "getSpecifier", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 64, - "end": 104, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 97, - "end": 103, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 105, - "end": 137, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 117, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 117, - "end": 127, - "ctxt": 0 - }, - "value": "whatToLoad", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 136, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 136, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 139, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 143, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 143, - "end": 144, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 147, - "end": 154, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "./0", - "raw": "\"./0\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 156, - "end": 182, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 156, - "end": 181, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 156, - "end": 162, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": { - "start": 163, - "end": 166, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 166, - "end": 180, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 167, - "end": 179, - "ctxt": 0 - }, - "value": "PathModule", - "raw": "\"PathModule\"" - } - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 184, - "end": 206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 188, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 188, - "end": 190, - "ctxt": 0 - }, - "value": "p1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 193, - "end": 205, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 207, - "end": 227, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 213, - "end": 226, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 213, - "end": 215, - "ctxt": 0 - }, - "value": "p2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 218, - "end": 226, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 218, - "end": 224, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 228, - "end": 278, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 234, - "end": 277, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 234, - "end": 236, - "ctxt": 0 - }, - "value": "p4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 239, - "end": 277, - "ctxt": 0 - }, - "callee": { - "type": "Import", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 246, - "end": 260, - "ctxt": 0 - }, - "value": "pathToModule", - "raw": "\"pathToModule\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 262, - "end": 276, - "ctxt": 0 - }, - "value": "secondModule", - "raw": "\"secondModule\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.ts deleted file mode 100644 index ded4ce6a101..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionGrammarError.ts +++ /dev/null @@ -1,13 +0,0 @@ -// @module: commonjs -// @target: es6 -// @noImplicitAny: false - -declare function getSpecifier(): string; -declare var whatToLoad: boolean; - -var a = ["./0"]; -import(...["PathModule"]); - -var p1 = import(...a); -const p2 = import(); -const p4 = import("pathToModule", "secondModule"); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD1.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD1.ts index 27096225137..6a1d90bd1c9 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD1.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD1.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: esnext // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD2.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD2.ts index b779f232371..a4028f1df6c 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD2.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD2.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD3.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD3.ts index 60826bbcdc8..0def31dbb27 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD3.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD3.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD4.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD4.ts index 215cec206af..d4ec8b0f473 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD4.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInAMD4.ts @@ -1,4 +1,4 @@ -// @module: amd +// @module: amd // @target: esnext // @useDefineForClassFields: false diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS1.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS1.ts index 09ee52478e5..84ad81b79b9 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS1.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS1.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: esnext // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS2.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS2.ts index 134ed9219bb..2e079cc588e 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS2.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS2.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: esnext // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS3.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS3.ts index 343d84c4a82..908484f8fc6 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS3.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS3.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS4.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS4.ts index 8c48050e7f8..eb759bfeea0 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS4.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS4.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS5.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS5.ts index 290372ab551..1dc81899a64 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS5.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS5.ts @@ -1,4 +1,4 @@ -// @module: commonjs +// @module: commonjs // @target: esnext // @useDefineForClassFields: false diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem1.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem1.ts index 71e39a2567a..8ab6aedea01 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem1.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem1.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: esnext // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem2.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem2.ts index 51ca79972f1..875338c6659 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem2.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem2.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem3.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem3.ts index 9ca3a2f4859..d5353fa5209 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem3.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem3.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem4.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem4.ts index b02938d44c4..2eff91de188 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem4.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInSystem4.ts @@ -1,4 +1,4 @@ -// @module: system +// @module: system // @target: esnext // @useDefineForClassFields: false diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD1.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD1.ts index 7c029413ca1..756ccd87ab9 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD1.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD1.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: esnext // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD2.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD2.ts index 06dd7488456..ba8035e4910 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD2.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD2.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD3.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD3.ts index 9a844bdaf1d..29a3f95fd9d 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD3.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD3.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: esnext // @filename: 0.ts export class B { diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD4.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD4.ts index 09d44de0429..aabd2a1b875 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD4.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD4.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: esnext // @useDefineForClassFields: false // @filename: 0.ts diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD5.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD5.ts index 663af4f83e3..9bf52bbb065 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD5.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionInUMD5.ts @@ -1,4 +1,4 @@ -// @module: umd +// @module: umd // @target: es2015 // @filename: 0.ts export function foo() { return "foo"; } diff --git a/crates/swc_ecma_parser/tests/tsc/importCallExpressionNoModuleKindSpecified.ts b/crates/swc_ecma_parser/tests/tsc/importCallExpressionNoModuleKindSpecified.ts index fabe41c4829..c26c91555fa 100644 --- a/crates/swc_ecma_parser/tests/tsc/importCallExpressionNoModuleKindSpecified.ts +++ b/crates/swc_ecma_parser/tests/tsc/importCallExpressionNoModuleKindSpecified.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 // @filename: 0.ts export class B { print() { return "I am B"} diff --git a/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.json b/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.json new file mode 100644 index 00000000000..5ce9538806f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.json @@ -0,0 +1,289 @@ +{ + "type": "Module", + "span": { + "start": 23, + "end": 245, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 23, + "end": 60, + "ctxt": 0 + }, + "declaration": { + "type": "TsEnumDeclaration", + "span": { + "start": 30, + "end": 60, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 41, + "end": 45, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 50, + "end": 57, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 50, + "end": 53, + "ctxt": 0 + }, + "value": "One", + "optional": false + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 56, + "end": 57, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 85, + "end": 115, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 94, + "end": 98, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 94, + "end": 98, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 106, + "end": 114, + "ctxt": 0 + }, + "value": "./enum", + "raw": "\"./enum\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 116, + "end": 162, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 126, + "end": 130, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 131, + "end": 162, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 135, + "end": 160, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 142, + "end": 160, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 147, + "end": 150, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 153, + "end": 159, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 163, + "end": 179, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 172, + "end": 176, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 172, + "end": 176, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 204, + "end": 235, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 213, + "end": 217, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 213, + "end": 217, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 225, + "end": 234, + "ctxt": 0 + }, + "value": "./merge", + "raw": "\"./merge\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 236, + "end": 245, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 236, + "end": 244, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 236, + "end": 240, + "ctxt": 0 + }, + "value": "Enum", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 241, + "end": 244, + "ctxt": 0 + }, + "value": "One", + "optional": false + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.ts b/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.ts new file mode 100644 index 00000000000..9884a7615a3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importElisionConstEnumMerge1.ts @@ -0,0 +1,15 @@ +// @Filename: enum.ts +export const enum Enum { + One = 1, +} + +// @Filename: merge.ts +import { Enum } from "./enum"; +namespace Enum { + export type Foo = number; +} +export { Enum }; + +// @Filename: index.ts +import { Enum } from "./merge"; +Enum.One; diff --git a/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.json b/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.json new file mode 100644 index 00000000000..f1159ae134c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.json @@ -0,0 +1,444 @@ +{ + "type": "Module", + "span": { + "start": 72, + "end": 379, + "ctxt": 0 + }, + "body": [ + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 78, + "end": 79, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "span": { + "start": 72, + "end": 94, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 82, + "end": 92, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 82, + "end": 83, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 84, + "end": 92, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 86, + "end": 92, + "ctxt": 0 + }, + "kind": "string" + } + }, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": true + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 95, + "end": 106, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 104, + "end": 105, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 134, + "end": 143, + "ctxt": 0 + }, + "value": "SomeClass", + "optional": false + }, + "declare": false, + "span": { + "start": 128, + "end": 146, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 147, + "end": 166, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 156, + "end": 165, + "ctxt": 0 + }, + "value": "SomeClass", + "optional": false + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 188, + "end": 219, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": true, + "id": { + "type": "Identifier", + "span": { + "start": 200, + "end": 201, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 204, + "end": 218, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 212, + "end": 217, + "ctxt": 0 + }, + "value": "./a", + "raw": "'./a'" + } + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 226, + "end": 255, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 233, + "end": 237, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 240, + "end": 254, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 248, + "end": 253, + "ctxt": 0 + }, + "value": "./b", + "raw": "'./b'" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 265, + "end": 277, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 265, + "end": 276, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 265, + "end": 266, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 267, + "end": 276, + "ctxt": 0 + }, + "value": "prototype", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 287, + "end": 311, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 293, + "end": 310, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 293, + "end": 294, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 296, + "end": 297, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 296, + "end": 297, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + } + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 300, + "end": 310, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 302, + "end": 303, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 305, + "end": 308, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + } + } + ] + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 318, + "end": 328, + "ctxt": 0 + }, + "expression": { + "type": "UnaryExpression", + "span": { + "start": 318, + "end": 327, + "ctxt": 0 + }, + "operator": "void", + "argument": { + "type": "Identifier", + "span": { + "start": 323, + "end": 327, + "ctxt": 0 + }, + "value": "type", + "optional": false + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 335, + "end": 379, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 342, + "end": 379, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 356, + "end": 378, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 356, + "end": 368, + "ctxt": 0 + }, + "value": "AConstructor", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 368, + "end": 378, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 370, + "end": 378, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 377, + "end": 378, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeArguments": null + } + } + }, + "init": null, + "definite": false + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.ts b/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.ts new file mode 100644 index 00000000000..29870a78809 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importEqualsDeclaration.ts @@ -0,0 +1,19 @@ +// @noTypesAndSymbols: true +// @declaration: true + +// @Filename: /a.ts +class A { a!: string } +export = A; + +// @Filename: /b.ts +class SomeClass {} +export = SomeClass; + +// @Filename: /c.ts +import type A = require('./a'); // Ok +import type = require('./b'); // Ok + +A.prototype; // Error +const a: A = { a: 'a' }; // Ok +void type; // Ok +export declare const AConstructor: typeof A; // Ok diff --git a/crates/swc_ecma_parser/tests/tsc/importFromDot.json b/crates/swc_ecma_parser/tests/tsc/importFromDot.json new file mode 100644 index 00000000000..5575b8a8768 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importFromDot.json @@ -0,0 +1,173 @@ +{ + "type": "Module", + "span": { + "start": 42, + "end": 177, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 42, + "end": 65, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 49, + "end": 65, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 55, + "end": 64, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 55, + "end": 60, + "ctxt": 0 + }, + "value": "rootA", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 92, + "end": 118, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 99, + "end": 118, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 105, + "end": 117, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 105, + "end": 113, + "ctxt": 0 + }, + "value": "indexInA", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 116, + "end": 117, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 141, + "end": 177, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 150, + "end": 158, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 150, + "end": 158, + "ctxt": 0 + }, + "value": "indexInA", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 160, + "end": 165, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 160, + "end": 165, + "ctxt": 0 + }, + "value": "rootA", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 173, + "end": 176, + "ctxt": 0 + }, + "value": ".", + "raw": "\".\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/importFromDot.ts b/crates/swc_ecma_parser/tests/tsc/importFromDot.ts new file mode 100644 index 00000000000..eb28f6943f6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importFromDot.ts @@ -0,0 +1,10 @@ +// @module: commonjs + +// @Filename: a.ts +export const rootA = 0; + +// @Filename: a/index.ts +export const indexInA = 0; + +// @Filename: a/b.ts +import { indexInA, rootA } from "."; diff --git a/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.json b/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.json deleted file mode 100644 index 0ef3f00a00d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 52, - "end": 158, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 52, - "end": 110, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 60, - "end": 66, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 67, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 69, - "end": 108, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 79, - "end": 89, - "ctxt": 0 - }, - "value": "ImportMeta", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 90, - "end": 108, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 91, - "end": 107, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 91, - "end": 94, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 97, - "end": 107, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 100, - "end": 107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 103, - "end": 107, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "EmptyStatement", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - } - }, - { - "type": "IfStatement", - "span": { - "start": 113, - "end": 158, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 117, - "end": 132, - "ctxt": 0 - }, - "object": { - "type": "MetaProperty", - "span": { - "start": 117, - "end": 128, - "ctxt": 0 - }, - "kind": "import.meta" - }, - "property": { - "type": "Identifier", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 134, - "end": 158, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 138, - "end": 156, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 138, - "end": 155, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 138, - "end": 153, - "ctxt": 0 - }, - "object": { - "type": "MetaProperty", - "span": { - "start": 138, - "end": 149, - "ctxt": 0 - }, - "kind": "import.meta" - }, - "property": { - "type": "Identifier", - "span": { - "start": 150, - "end": 153, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.ts b/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.ts deleted file mode 100644 index 4a855cff0c4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importMetaNarrowing.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @module: esnext,system,es2020 -// @strict: true - -declare global { interface ImportMeta {foo?: () => void} }; - -if (import.meta.foo) { - import.meta.foo(); -} diff --git a/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.json b/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.json new file mode 100644 index 00000000000..e56b8e15f0a --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.json @@ -0,0 +1,91 @@ +{ + "type": "Module", + "span": { + "start": 76, + "end": 149, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 76, + "end": 97, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 83, + "end": 97, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 93, + "end": 94, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 95, + "end": 97, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 120, + "end": 149, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 129, + "end": 135, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 134, + "end": 135, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 143, + "end": 148, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.ts b/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.ts new file mode 100644 index 00000000000..e2c2d8411f2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importSpecifiers_js.ts @@ -0,0 +1,9 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: ./a.ts +export interface A {} + +// @Filename: ./a.js +import { type A } from "./a"; diff --git a/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.json b/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.json deleted file mode 100644 index 876d933d508..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.json +++ /dev/null @@ -1,674 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 60, - "end": 406, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 60, - "end": 99, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 67, - "end": 99, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 77, - "end": 80, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 81, - "end": 99, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 87, - "end": 97, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 88, - "end": 96, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 90, - "end": 96, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 121, - "end": 160, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 128, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 142, - "end": 160, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 149, - "end": 157, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 151, - "end": 157, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 184, - "end": 289, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 200, - "end": 210, - "ctxt": 0 - }, - "value": "getFooFrom", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 236, - "end": 240, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 236, - "end": 240, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 240, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 191, - "end": 289, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 257, - "end": 289, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 263, - "end": 287, - "ctxt": 0 - }, - "argument": { - "type": "TsAsExpression", - "span": { - "start": 270, - "end": 286, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 270, - "end": 279, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 210, - "end": 235, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 211, - "end": 234, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsUnionType", - "span": { - "start": 221, - "end": 234, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 221, - "end": 226, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 221, - "end": 226, - "ctxt": 0 - }, - "value": "./a", - "raw": "\"./a\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 229, - "end": 234, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 229, - "end": 234, - "ctxt": 0 - }, - "value": "./b", - "raw": "\"./b\"" - } - } - ] - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 241, - "end": 256, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsImportType", - "span": { - "start": 243, - "end": 256, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "qualifier": { - "type": "Identifier", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeArguments": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 291, - "end": 406, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 307, - "end": 322, - "ctxt": 0 - }, - "value": "getFooValueFrom", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 349, - "end": 352, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 351, - "end": 352, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 351, - "end": 352, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 298, - "end": 406, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 374, - "end": 406, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 380, - "end": 404, - "ctxt": 0 - }, - "argument": { - "type": "TsAsExpression", - "span": { - "start": 387, - "end": 403, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 387, - "end": 396, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 322, - "end": 347, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 323, - "end": 346, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 324, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsUnionType", - "span": { - "start": 333, - "end": 346, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 333, - "end": 338, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 333, - "end": 338, - "ctxt": 0 - }, - "value": "./a", - "raw": "\"./a\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "value": "./b", - "raw": "\"./b\"" - } - } - ] - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 353, - "end": 373, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsIndexedAccessType", - "span": { - "start": 355, - "end": 373, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsImportType", - "span": { - "start": 355, - "end": 368, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 362, - "end": 363, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "qualifier": { - "type": "Identifier", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeArguments": null - }, - "indexType": { - "type": "TsLiteralType", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "value": "a", - "raw": "\"a\"" - } - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.ts b/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.ts deleted file mode 100644 index 4bf27bb0782..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/importTypeGeneric.ts +++ /dev/null @@ -1,18 +0,0 @@ -// @declaration: true -// @target: es6 -// @filename: a.d.ts -export interface Foo { - a: string; -} -// @filename: b.d.ts -export interface Foo { - a: number; -} -// @filename: usage.ts -export function getFooFrom(v: T): import(T).Foo { - return undefined as any; -} - -export function getFooValueFrom(v: T): import(T).Foo["a"] { - return undefined as any; -} diff --git a/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.json b/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.json new file mode 100644 index 00000000000..9bc0acf8ff2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.json @@ -0,0 +1,539 @@ +{ + "type": "Module", + "span": { + "start": 106, + "end": 521, + "ctxt": 0 + }, + "body": [ + { + "type": "TsModuleDeclaration", + "span": { + "start": 106, + "end": 287, + "ctxt": 0 + }, + "declare": true, + "global": false, + "id": { + "type": "StringLiteral", + "span": { + "start": 121, + "end": 125, + "ctxt": 0 + }, + "value": "fs", + "raw": "\"fs\"" + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 126, + "end": 287, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 130, + "end": 166, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 137, + "end": 166, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 147, + "end": 163, + "ctxt": 0 + }, + "value": "WriteFileOptions", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 164, + "end": 166, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 169, + "end": 285, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 185, + "end": 194, + "ctxt": 0 + }, + "value": "writeFile", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 195, + "end": 207, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 195, + "end": 207, + "ctxt": 0 + }, + "value": "path", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 199, + "end": 207, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 201, + "end": 207, + "ctxt": 0 + }, + "kind": "string" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 209, + "end": 218, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 209, + "end": 218, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 213, + "end": 218, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 215, + "end": 218, + "ctxt": 0 + }, + "kind": "any" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 220, + "end": 245, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 220, + "end": 245, + "ctxt": 0 + }, + "value": "options", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 227, + "end": 245, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 229, + "end": 245, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 229, + "end": 245, + "ctxt": 0 + }, + "value": "WriteFileOptions", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 247, + "end": 277, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 247, + "end": 277, + "ctxt": 0 + }, + "value": "callback", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 255, + "end": 277, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 257, + "end": 277, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 258, + "end": 268, + "ctxt": 0 + }, + "value": "err", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 261, + "end": 268, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 263, + "end": 268, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 263, + "end": 268, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 270, + "end": 277, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 273, + "end": 277, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 176, + "end": 285, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 278, + "end": 284, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 280, + "end": 284, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + ] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 313, + "end": 393, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 322, + "end": 331, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 322, + "end": 331, + "ctxt": 0 + }, + "value": "writeFile", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 333, + "end": 349, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 333, + "end": 349, + "ctxt": 0 + }, + "value": "WriteFileOptions", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 351, + "end": 380, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 371, + "end": 380, + "ctxt": 0 + }, + "value": "OtherName", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 351, + "end": 367, + "ctxt": 0 + }, + "value": "WriteFileOptions", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 388, + "end": 392, + "ctxt": 0 + }, + "value": "fs", + "raw": "\"fs\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 435, + "end": 456, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 444, + "end": 453, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 444, + "end": 453, + "ctxt": 0 + }, + "value": "JSDocType", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 457, + "end": 492, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 466, + "end": 489, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 466, + "end": 475, + "ctxt": 0 + }, + "value": "JSDocType", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 479, + "end": 489, + "ctxt": 0 + }, + "value": "ThisIsFine", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 493, + "end": 521, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 502, + "end": 518, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 502, + "end": 518, + "ctxt": 0 + }, + "value": "WriteFileOptions", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.ts b/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.ts new file mode 100644 index 00000000000..857e5a28ed2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/importingExportingTypes.ts @@ -0,0 +1,18 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /node_modules/@types/node/index.d.ts +declare module "fs" { + export interface WriteFileOptions {} + export function writeFile(path: string, data: any, options: WriteFileOptions, callback: (err: Error) => void): void; +} + +// @Filename: /index.js +import { writeFile, WriteFileOptions, WriteFileOptions as OtherName } from "fs"; + +/** @typedef {{ x: any }} JSDocType */ + +export { JSDocType }; +export { JSDocType as ThisIsFine }; +export { WriteFileOptions }; diff --git a/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.json b/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.json deleted file mode 100644 index 347c3df416f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.json +++ /dev/null @@ -1,2086 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 947, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsEnumDeclaration", - "span": { - "start": 14, - "end": 26, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 28, - "end": 39, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 33, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 173, - "end": 189, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 177, - "end": 188, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 177, - "end": 179, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 188, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 188, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 190, - "end": 203, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 194, - "end": 202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 202, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 204, - "end": 215, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 208, - "end": 214, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 208, - "end": 210, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 214, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 212, - "end": 214, - "ctxt": 0 - }, - "members": [] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 216, - "end": 226, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 220, - "end": 225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 220, - "end": 222, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 222, - "end": 225, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 227, - "end": 248, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 231, - "end": 247, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 231, - "end": 233, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 233, - "end": 247, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 235, - "end": 247, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 241, - "end": 247, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 249, - "end": 261, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 253, - "end": 260, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 255, - "end": 260, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 257, - "end": 260, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 257, - "end": 260, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 263, - "end": 281, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 267, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 273, - "end": 280, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 273, - "end": 275, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 279, - "end": 280, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 282, - "end": 300, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 286, - "end": 299, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 292, - "end": 299, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 292, - "end": 294, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 301, - "end": 319, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 305, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 311, - "end": 318, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 311, - "end": 313, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 338, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 324, - "end": 337, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 330, - "end": 337, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 330, - "end": 332, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 336, - "end": 337, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 339, - "end": 359, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 343, - "end": 358, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 343, - "end": 346, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 349, - "end": 358, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "NullLiteral", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 360, - "end": 385, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 364, - "end": 384, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 364, - "end": 367, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 370, - "end": 384, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 370, - "end": 379, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 383, - "end": 384, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 386, - "end": 405, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 390, - "end": 404, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 396, - "end": 404, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "MemberExpression", - "span": { - "start": 396, - "end": 399, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 396, - "end": 397, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 403, - "end": 404, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 406, - "end": 427, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 410, - "end": 426, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 410, - "end": 413, - "ctxt": 0 - }, - "value": "ra8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 416, - "end": 426, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "BooleanLiteral", - "span": { - "start": 416, - "end": 421, - "ctxt": 0 - }, - "value": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 425, - "end": 426, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 428, - "end": 446, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 432, - "end": 445, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 432, - "end": 435, - "ctxt": 0 - }, - "value": "ra9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 438, - "end": 445, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "ObjectExpression", - "span": { - "start": 438, - "end": 440, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 444, - "end": 445, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 447, - "end": 466, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 451, - "end": 465, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 451, - "end": 455, - "ctxt": 0 - }, - "value": "ra10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 458, - "end": 465, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 458, - "end": 460, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 467, - "end": 486, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 471, - "end": 485, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 471, - "end": 475, - "ctxt": 0 - }, - "value": "ra11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 478, - "end": 485, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 478, - "end": 480, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 607, - "end": 622, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 611, - "end": 621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 611, - "end": 613, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 613, - "end": 621, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 615, - "end": 621, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 623, - "end": 639, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 627, - "end": 638, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 627, - "end": 629, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 629, - "end": 638, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 631, - "end": 638, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 640, - "end": 655, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 644, - "end": 654, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 644, - "end": 646, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 646, - "end": 654, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 648, - "end": 654, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 656, - "end": 669, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 660, - "end": 668, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 660, - "end": 662, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 662, - "end": 668, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 664, - "end": 668, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 670, - "end": 694, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 674, - "end": 693, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 674, - "end": 676, - "ctxt": 0 - }, - "value": "b5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 676, - "end": 693, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 678, - "end": 693, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 678, - "end": 684, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 687, - "end": 693, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 696, - "end": 714, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 700, - "end": 713, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 700, - "end": 703, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 706, - "end": 713, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 706, - "end": 707, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 711, - "end": 713, - "ctxt": 0 - }, - "value": "b1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 715, - "end": 733, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 719, - "end": 732, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 719, - "end": 722, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 725, - "end": 732, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 730, - "end": 732, - "ctxt": 0 - }, - "value": "b2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 734, - "end": 752, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 738, - "end": 751, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 738, - "end": 741, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 744, - "end": 751, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 744, - "end": 745, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 749, - "end": 751, - "ctxt": 0 - }, - "value": "b3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 753, - "end": 771, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 757, - "end": 770, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 757, - "end": 760, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 763, - "end": 770, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 763, - "end": 764, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 768, - "end": 770, - "ctxt": 0 - }, - "value": "b4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 772, - "end": 790, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 776, - "end": 789, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 776, - "end": 779, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 782, - "end": 789, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 782, - "end": 783, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 787, - "end": 789, - "ctxt": 0 - }, - "value": "b5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 791, - "end": 808, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 795, - "end": 807, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 795, - "end": 798, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 801, - "end": 807, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 801, - "end": 802, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 806, - "end": 807, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 809, - "end": 830, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 813, - "end": 829, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 813, - "end": 816, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 819, - "end": 829, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 819, - "end": 820, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 824, - "end": 829, - "ctxt": 0 - }, - "value": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 831, - "end": 849, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 835, - "end": 848, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 835, - "end": 838, - "ctxt": 0 - }, - "value": "rb8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 841, - "end": 848, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 841, - "end": 842, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 846, - "end": 848, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 850, - "end": 870, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 854, - "end": 869, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 854, - "end": 857, - "ctxt": 0 - }, - "value": "rb9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 860, - "end": 869, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 860, - "end": 861, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 865, - "end": 869, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 871, - "end": 897, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 875, - "end": 896, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 875, - "end": 879, - "ctxt": 0 - }, - "value": "rb10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 882, - "end": 896, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "Identifier", - "span": { - "start": 882, - "end": 883, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 887, - "end": 896, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 928, - "end": 947, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 932, - "end": 946, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 932, - "end": 935, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 938, - "end": 946, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "ObjectExpression", - "span": { - "start": 938, - "end": 940, - "ctxt": 0 - }, - "properties": [] - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 944, - "end": 946, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.ts b/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.ts deleted file mode 100644 index 3087a728f10..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inOperatorWithInvalidOperands.ts +++ /dev/null @@ -1,47 +0,0 @@ -class Foo {} -enum E { a } - -var x: any; - -// invalid left operands -// the left operand is required to be of type Any, the String primitive type, or the Number primitive type -var a1: boolean; -var a2: void; -var a3: {}; -var a4: E; -var a5: Foo | string; -var a6: Foo; - -var ra1 = a1 in x; -var ra2 = a2 in x; -var ra3 = a3 in x; -var ra4 = a4 in x; -var ra5 = null in x; -var ra6 = undefined in x; -var ra7 = E.a in x; -var ra8 = false in x; -var ra9 = {} in x; -var ra10 = a5 in x; -var ra11 = a6 in x; - -// invalid right operands -// the right operand is required to be of type Any, an object type, or a type parameter type -var b1: number; -var b2: boolean; -var b3: string; -var b4: void; -var b5: string | number; - -var rb1 = x in b1; -var rb2 = x in b2; -var rb3 = x in b3; -var rb4 = x in b4; -var rb5 = x in b5; -var rb6 = x in 0; -var rb7 = x in false; -var rb8 = x in ''; -var rb9 = x in null; -var rb10 = x in undefined; - -// both operands are invalid -var rc1 = {} in ''; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.json deleted file mode 100644 index 95915039122..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.json +++ /dev/null @@ -1,2794 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 28, - "end": 1482, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 28, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 36, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 43, - "end": 68, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 47, - "end": 67, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 47, - "end": 51, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 53, - "end": 58, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 61, - "end": 67, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 87, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 87, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 77, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 79, - "end": 87, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 82, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 85, - "end": 87, - "ctxt": 0 - }, - "members": [] - } - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 88, - "end": 123, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 92, - "end": 122, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 92, - "end": 96, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 99, - "end": 122, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 104, - "end": 106, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 108, - "end": 109, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 111, - "end": 120, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 117, - "end": 120, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 133, - "end": 136, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 124, - "end": 172, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 172, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 150, - "end": 156, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 154, - "end": 155, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 154, - "end": 155, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 161, - "end": 170, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 140, - "end": 143, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 179, - "end": 180, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 173, - "end": 266, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 187, - "end": 201, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 195, - "end": 200, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 206, - "end": 264, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 206, - "end": 264, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 224, - "end": 264, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 238, - "end": 239, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 238, - "end": 239, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 256, - "end": 257, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 218, - "end": 223, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 220, - "end": 223, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 267, - "end": 302, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 274, - "end": 275, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 276, - "end": 302, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 282, - "end": 300, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 289, - "end": 300, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 293, - "end": 299, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 294, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 299, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 296, - "end": 299, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 303, - "end": 322, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 307, - "end": 321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 307, - "end": 311, - "ctxt": 0 - }, - "value": "objA", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 318, - "end": 319, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 340, - "end": 369, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 344, - "end": 368, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 344, - "end": 359, - "ctxt": 0 - }, - "value": "ResultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 362, - "end": 368, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 364, - "end": 368, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 370, - "end": 396, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 374, - "end": 395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 374, - "end": 389, - "ctxt": 0 - }, - "value": "ResultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 392, - "end": 395, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 397, - "end": 423, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 401, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 401, - "end": 416, - "ctxt": 0 - }, - "value": "ResultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 419, - "end": 422, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 424, - "end": 452, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 428, - "end": 451, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 428, - "end": 443, - "ctxt": 0 - }, - "value": "ResultIsNumber4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 446, - "end": 451, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 448, - "end": 451, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 453, - "end": 482, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 457, - "end": 481, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 457, - "end": 472, - "ctxt": 0 - }, - "value": "ResultIsNumber5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 475, - "end": 481, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 477, - "end": 481, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 484, - "end": 513, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 488, - "end": 512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 488, - "end": 503, - "ctxt": 0 - }, - "value": "ResultIsNumber6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 506, - "end": 512, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 506, - "end": 510, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 514, - "end": 540, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 518, - "end": 539, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 518, - "end": 533, - "ctxt": 0 - }, - "value": "ResultIsNumber7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 536, - "end": 539, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 541, - "end": 567, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 545, - "end": 566, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 545, - "end": 560, - "ctxt": 0 - }, - "value": "ResultIsNumber8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 563, - "end": 566, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 563, - "end": 564, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 568, - "end": 596, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 572, - "end": 595, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 572, - "end": 587, - "ctxt": 0 - }, - "value": "ResultIsNumber9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 590, - "end": 595, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 590, - "end": 593, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 597, - "end": 627, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 601, - "end": 626, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 601, - "end": 617, - "ctxt": 0 - }, - "value": "ResultIsNumber10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 620, - "end": 626, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 620, - "end": 624, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 649, - "end": 677, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 653, - "end": 676, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 653, - "end": 669, - "ctxt": 0 - }, - "value": "ResultIsNumber11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 672, - "end": 676, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 674, - "end": 676, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 678, - "end": 708, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 682, - "end": 707, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 682, - "end": 698, - "ctxt": 0 - }, - "value": "ResultIsNumber12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 701, - "end": 707, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "NullLiteral", - "span": { - "start": 703, - "end": 707, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 709, - "end": 744, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 713, - "end": 743, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 713, - "end": 729, - "ctxt": 0 - }, - "value": "ResultIsNumber13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 732, - "end": 743, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 734, - "end": 743, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 746, - "end": 776, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 750, - "end": 775, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 750, - "end": 766, - "ctxt": 0 - }, - "value": "ResultIsNumber14", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 769, - "end": 775, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "NullLiteral", - "span": { - "start": 769, - "end": 773, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 777, - "end": 805, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 781, - "end": 804, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 781, - "end": 797, - "ctxt": 0 - }, - "value": "ResultIsNumber15", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 800, - "end": 804, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 800, - "end": 802, - "ctxt": 0 - }, - "properties": [] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 806, - "end": 841, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 810, - "end": 840, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 810, - "end": 826, - "ctxt": 0 - }, - "value": "ResultIsNumber16", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 829, - "end": 840, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 829, - "end": 838, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 867, - "end": 898, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 871, - "end": 897, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 871, - "end": 887, - "ctxt": 0 - }, - "value": "ResultIsNumber17", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 890, - "end": 897, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "CallExpression", - "span": { - "start": 892, - "end": 897, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 892, - "end": 895, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 899, - "end": 932, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 903, - "end": 931, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 903, - "end": 919, - "ctxt": 0 - }, - "value": "ResultIsNumber18", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 922, - "end": 931, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "CallExpression", - "span": { - "start": 924, - "end": 931, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 924, - "end": 929, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 924, - "end": 925, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 926, - "end": 929, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 933, - "end": 977, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 937, - "end": 976, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 937, - "end": 953, - "ctxt": 0 - }, - "value": "ResultIsNumber19", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 956, - "end": 976, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 958, - "end": 976, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 959, - "end": 975, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 959, - "end": 963, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 966, - "end": 975, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 978, - "end": 1017, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 982, - "end": 1016, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 982, - "end": 998, - "ctxt": 0 - }, - "value": "ResultIsNumber20", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1001, - "end": 1016, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1003, - "end": 1016, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1004, - "end": 1015, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1004, - "end": 1008, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1011, - "end": 1015, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1018, - "end": 1067, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1022, - "end": 1066, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1038, - "ctxt": 0 - }, - "value": "ResultIsNumber21", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1041, - "end": 1066, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1043, - "end": 1066, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1044, - "end": 1065, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1044, - "end": 1053, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1056, - "end": 1065, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1068, - "end": 1100, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1072, - "end": 1099, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1072, - "end": 1088, - "ctxt": 0 - }, - "value": "ResultIsNumber22", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1091, - "end": 1099, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1093, - "end": 1099, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1093, - "end": 1097, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1098, - "end": 1099, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1101, - "end": 1133, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1105, - "end": 1132, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1105, - "end": 1121, - "ctxt": 0 - }, - "value": "ResultIsNumber23", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1124, - "end": 1132, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1126, - "end": 1132, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1126, - "end": 1130, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1131, - "end": 1132, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1135, - "end": 1166, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1139, - "end": 1165, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1139, - "end": 1155, - "ctxt": 0 - }, - "value": "ResultIsNumber24", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1158, - "end": 1165, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "CallExpression", - "span": { - "start": 1158, - "end": 1163, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1158, - "end": 1161, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1167, - "end": 1200, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1171, - "end": 1199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1171, - "end": 1187, - "ctxt": 0 - }, - "value": "ResultIsNumber25", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1190, - "end": 1199, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "CallExpression", - "span": { - "start": 1190, - "end": 1197, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1190, - "end": 1195, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1190, - "end": 1191, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1192, - "end": 1195, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1201, - "end": 1245, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1205, - "end": 1244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1205, - "end": 1221, - "ctxt": 0 - }, - "value": "ResultIsNumber26", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1224, - "end": 1244, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1224, - "end": 1242, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1225, - "end": 1241, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1225, - "end": 1229, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1232, - "end": 1241, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1246, - "end": 1285, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1250, - "end": 1284, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1250, - "end": 1266, - "ctxt": 0 - }, - "value": "ResultIsNumber27", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1269, - "end": 1284, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1269, - "end": 1282, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1270, - "end": 1281, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 1270, - "end": 1274, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1277, - "end": 1281, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1286, - "end": 1335, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1290, - "end": 1334, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1290, - "end": 1306, - "ctxt": 0 - }, - "value": "ResultIsNumber28", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1309, - "end": 1334, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1309, - "end": 1332, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1310, - "end": 1331, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1310, - "end": 1319, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1322, - "end": 1331, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1336, - "end": 1368, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1340, - "end": 1367, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1340, - "end": 1356, - "ctxt": 0 - }, - "value": "ResultIsNumber29", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1359, - "end": 1367, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1359, - "end": 1365, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1359, - "end": 1363, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1364, - "end": 1365, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1369, - "end": 1401, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1373, - "end": 1400, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1373, - "end": 1389, - "ctxt": 0 - }, - "value": "ResultIsNumber30", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 1392, - "end": 1400, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1392, - "end": 1398, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1392, - "end": 1396, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1397, - "end": 1398, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1432, - "end": 1439, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1432, - "end": 1438, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1438, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1441, - "end": 1448, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1441, - "end": 1447, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1441, - "end": 1445, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1450, - "end": 1459, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1450, - "end": 1458, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1452, - "end": 1458, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1452, - "end": 1456, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1460, - "end": 1469, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1460, - "end": 1468, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1462, - "end": 1468, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 1462, - "end": 1466, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1470, - "end": 1482, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1470, - "end": 1481, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 1472, - "end": 1481, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "span": { - "start": 1472, - "end": 1479, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1472, - "end": 1476, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1476, - "end": 1479, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1477, - "end": 1478, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.ts deleted file mode 100644 index 397024d45d6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/incrementOperatorWithAnyOtherTypeInvalidOperations.ts +++ /dev/null @@ -1,69 +0,0 @@ -// ++ operator on any type -var ANY1: any; -var ANY2: any[] = [1, 2]; - -var obj: () => {} -var obj1 = { x: "", y: () => { } }; -function foo(): any { - var a; - return a; -} -class A { - public a: any; - static foo(): any { - var a; - return a; - } -} -module M { - export var n: any; -} -var objA = new A(); - -// any type var -var ResultIsNumber1 = ++ANY2; -var ResultIsNumber2 = ++A; -var ResultIsNumber3 = ++M; -var ResultIsNumber4 = ++obj; -var ResultIsNumber5 = ++obj1; - -var ResultIsNumber6 = ANY2++; -var ResultIsNumber7 = A++; -var ResultIsNumber8 = M++; -var ResultIsNumber9 = obj++; -var ResultIsNumber10 = obj1++; - -// any type literal -var ResultIsNumber11 = ++{}; -var ResultIsNumber12 = ++null; -var ResultIsNumber13 = ++undefined; - -var ResultIsNumber14 = null++; -var ResultIsNumber15 = {}++; -var ResultIsNumber16 = undefined++; - -// any type expressions -var ResultIsNumber17 = ++foo(); -var ResultIsNumber18 = ++A.foo(); -var ResultIsNumber19 = ++(null + undefined); -var ResultIsNumber20 = ++(null + null); -var ResultIsNumber21 = ++(undefined + undefined); -var ResultIsNumber22 = ++obj1.x; -var ResultIsNumber23 = ++obj1.y; - -var ResultIsNumber24 = foo()++; -var ResultIsNumber25 = A.foo()++; -var ResultIsNumber26 = (null + undefined)++; -var ResultIsNumber27 = (null + null)++; -var ResultIsNumber28 = (undefined + undefined)++; -var ResultIsNumber29 = obj1.x++; -var ResultIsNumber30 = obj1.y++; - -// miss assignment operators -++ANY2; - -ANY2++; - -++ANY1++; -++ANY2++; -++ANY2[0]++; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/indexerWithTuple.ts b/crates/swc_ecma_parser/tests/tsc/indexerWithTuple.ts index 12adcaf3589..eea0cf52aed 100644 --- a/crates/swc_ecma_parser/tests/tsc/indexerWithTuple.ts +++ b/crates/swc_ecma_parser/tests/tsc/indexerWithTuple.ts @@ -1,4 +1,4 @@ -var strNumTuple: [string, number] = ["foo", 10]; +var strNumTuple: [string, number] = ["foo", 10]; var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; var unionTuple1: [number, string| number] = [10, "foo"]; var unionTuple2: [boolean, string| number] = [true, "foo"]; diff --git a/crates/swc_ecma_parser/tests/tsc/inferThis.json b/crates/swc_ecma_parser/tests/tsc/inferThis.json new file mode 100644 index 00000000000..ab916e58aea --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferThis.json @@ -0,0 +1,400 @@ +{ + "type": "Module", + "span": { + "start": 75, + "end": 390, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 75, + "end": 317, + "ctxt": 0 + }, + "declaration": { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 88, + "end": 89, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "declare": false, + "span": { + "start": 82, + "end": 317, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassMethod", + "span": { + "start": 167, + "end": 206, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 174, + "end": 175, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 167, + "end": 206, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 178, + "end": 206, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 188, + "end": 200, + "ctxt": 0 + }, + "argument": { + "type": "ThisExpression", + "span": { + "start": 195, + "end": 199, + "ctxt": 0 + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": true, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + }, + { + "type": "ClassMethod", + "span": { + "start": 283, + "end": 315, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 283, + "end": 284, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "function": { + "params": [], + "decorators": [], + "span": { + "start": 283, + "end": 315, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 287, + "end": 315, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 297, + "end": 309, + "ctxt": 0 + }, + "argument": { + "type": "ThisExpression", + "span": { + "start": 304, + "end": 308, + "ctxt": 0 + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + "kind": "method", + "isStatic": false, + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 319, + "end": 335, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 325, + "end": 334, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 325, + "end": 326, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 329, + "end": 334, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 329, + "end": 332, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 329, + "end": 330, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 331, + "end": 332, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 336, + "end": 338, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 336, + "end": 337, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 352, + "end": 370, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 358, + "end": 369, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 358, + "end": 359, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 362, + "end": 369, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 366, + "end": 367, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 371, + "end": 387, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 377, + "end": 386, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 377, + "end": 378, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 381, + "end": 386, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 381, + "end": 384, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 381, + "end": 382, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 383, + "end": 384, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 388, + "end": 390, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 388, + "end": 389, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/inferThis.ts b/crates/swc_ecma_parser/tests/tsc/inferThis.ts new file mode 100644 index 00000000000..09204fc72b6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferThis.ts @@ -0,0 +1,31 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @filename: /a.js + +export class C { + /** + * @template T + * @this {T} + * @return {T} + */ + static a() { + return this; + } + + /** + * @template T + * @this {T} + * @return {T} + */ + b() { + return this; + } +} + +const a = C.a(); +a; // typeof C + +const c = new C(); +const b = c.b(); +b; // C diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.json b/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.json new file mode 100644 index 00000000000..1c11da87c1e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.json @@ -0,0 +1,157 @@ +{ + "type": "Script", + "span": { + "start": 24, + "end": 85, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 24, + "end": 85, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 29, + "end": 33, + "ctxt": 0 + }, + "value": "Test", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 33, + "end": 36, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 34, + "end": 35, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 34, + "end": 35, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 39, + "end": 84, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 39, + "end": 40, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 39, + "end": 40, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsInferType", + "span": { + "start": 49, + "end": 66, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 55, + "end": 56, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 55, + "end": 56, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 65, + "end": 66, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 65, + "end": 66, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "typeParams": null + }, + "default": null + } + }, + "trueType": { + "type": "TsKeywordType", + "span": { + "start": 69, + "end": 75, + "ctxt": 0 + }, + "kind": "number" + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 78, + "end": 84, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.ts b/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.ts new file mode 100644 index 00000000000..d03e6537a67 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesInvalidExtendsDeclaration.ts @@ -0,0 +1,3 @@ +// @declaration: true + +type Test = T extends infer A extends B ? number : string; diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.json b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.json new file mode 100644 index 00000000000..21cd948cb05 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.json @@ -0,0 +1,13038 @@ +{ + "type": "Script", + "span": { + "start": 67, + "end": 5759, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 67, + "end": 218, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 72, + "end": 74, + "ctxt": 0 + }, + "value": "X1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 74, + "end": 91, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 75, + "end": 90, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 75, + "end": 76, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsArrayType", + "span": { + "start": 85, + "end": 90, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 85, + "end": 88, + "ctxt": 0 + }, + "kind": "any" + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 98, + "end": 217, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTupleType", + "span": { + "start": 108, + "end": 132, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 109, + "end": 131, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsInferType", + "span": { + "start": 109, + "end": 131, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 115, + "end": 116, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 115, + "end": 116, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 125, + "end": 131, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 135, + "end": 148, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 136, + "end": 144, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 136, + "end": 144, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 136, + "end": 144, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 155, + "end": 217, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 155, + "end": 156, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 155, + "end": 156, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTupleType", + "span": { + "start": 165, + "end": 189, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 166, + "end": 188, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsInferType", + "span": { + "start": 166, + "end": 188, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 172, + "end": 173, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 172, + "end": 173, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 182, + "end": 188, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 192, + "end": 205, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 193, + "end": 201, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 193, + "end": 201, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 193, + "end": 201, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 203, + "end": 204, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 203, + "end": 204, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 203, + "end": 204, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 212, + "end": 217, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 220, + "end": 243, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 225, + "end": 230, + "ctxt": 0 + }, + "value": "X1_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 233, + "end": 242, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 233, + "end": 235, + "ctxt": 0 + }, + "value": "X1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 235, + "end": 242, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTupleType", + "span": { + "start": 236, + "end": 241, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 237, + "end": 240, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 237, + "end": 240, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 237, + "end": 240, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 263, + "end": 284, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 268, + "end": 273, + "ctxt": 0 + }, + "value": "X1_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 276, + "end": 283, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 276, + "end": 278, + "ctxt": 0 + }, + "value": "X1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 278, + "end": 283, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTupleType", + "span": { + "start": 279, + "end": 282, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 280, + "end": 281, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 280, + "end": 281, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 280, + "end": 281, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 302, + "end": 328, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 307, + "end": 312, + "ctxt": 0 + }, + "value": "X1_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 315, + "end": 327, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 315, + "end": 317, + "ctxt": 0 + }, + "value": "X1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 317, + "end": 327, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTupleType", + "span": { + "start": 318, + "end": 326, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 319, + "end": 325, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsKeywordType", + "span": { + "start": 319, + "end": 325, + "ctxt": 0 + }, + "kind": "object" + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 360, + "end": 552, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 365, + "end": 367, + "ctxt": 0 + }, + "value": "X2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 367, + "end": 403, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 368, + "end": 402, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 368, + "end": 369, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsFunctionType", + "span": { + "start": 378, + "end": 402, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 379, + "end": 393, + "ctxt": 0 + }, + "rest": { + "start": 379, + "end": 382, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 382, + "end": 386, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 386, + "end": 393, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 388, + "end": 393, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 388, + "end": 391, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 395, + "end": 402, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 398, + "end": 402, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 410, + "end": 551, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 410, + "end": 411, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 410, + "end": 411, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsFunctionType", + "span": { + "start": 420, + "end": 455, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 421, + "end": 446, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 422, + "end": 446, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 424, + "end": 446, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 430, + "end": 431, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 430, + "end": 431, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 440, + "end": 446, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 448, + "end": 455, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 451, + "end": 455, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 458, + "end": 471, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 459, + "end": 467, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 459, + "end": 467, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 459, + "end": 467, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 469, + "end": 470, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 469, + "end": 470, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 469, + "end": 470, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 478, + "end": 551, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 478, + "end": 479, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 478, + "end": 479, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsFunctionType", + "span": { + "start": 488, + "end": 523, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 489, + "end": 514, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 490, + "end": 514, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 492, + "end": 514, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 498, + "end": 499, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 498, + "end": 499, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 508, + "end": 514, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 516, + "end": 523, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 519, + "end": 523, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 526, + "end": 539, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 527, + "end": 535, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 527, + "end": 535, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 527, + "end": 535, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 537, + "end": 538, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 537, + "end": 538, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 537, + "end": 538, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 546, + "end": 551, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 554, + "end": 588, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 559, + "end": 564, + "ctxt": 0 + }, + "value": "X2_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 567, + "end": 587, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 567, + "end": 569, + "ctxt": 0 + }, + "value": "X2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 569, + "end": 587, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 570, + "end": 586, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 571, + "end": 577, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 572, + "end": 577, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 574, + "end": 577, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 574, + "end": 577, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 579, + "end": 586, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 582, + "end": 586, + "ctxt": 0 + }, + "kind": "void" + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 608, + "end": 640, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 613, + "end": 618, + "ctxt": 0 + }, + "value": "X2_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 621, + "end": 639, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 621, + "end": 623, + "ctxt": 0 + }, + "value": "X2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 623, + "end": 639, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 624, + "end": 638, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 625, + "end": 629, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 626, + "end": 629, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 628, + "end": 629, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 628, + "end": 629, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 631, + "end": 638, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 634, + "end": 638, + "ctxt": 0 + }, + "kind": "void" + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 658, + "end": 695, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 663, + "end": 668, + "ctxt": 0 + }, + "value": "X2_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 671, + "end": 694, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 671, + "end": 673, + "ctxt": 0 + }, + "value": "X2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 673, + "end": 694, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 674, + "end": 693, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 675, + "end": 684, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 676, + "end": 684, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 678, + "end": 684, + "ctxt": 0 + }, + "kind": "object" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 686, + "end": 693, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 689, + "end": 693, + "ctxt": 0 + }, + "kind": "void" + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 730, + "end": 939, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 735, + "end": 737, + "ctxt": 0 + }, + "value": "X3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 737, + "end": 772, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 738, + "end": 771, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 738, + "end": 739, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsFunctionType", + "span": { + "start": 748, + "end": 771, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 749, + "end": 763, + "ctxt": 0 + }, + "rest": { + "start": 749, + "end": 752, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 752, + "end": 756, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 756, + "end": 763, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 758, + "end": 763, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 758, + "end": 761, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 765, + "end": 771, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 768, + "end": 771, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 779, + "end": 938, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 779, + "end": 780, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 779, + "end": 780, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsFunctionType", + "span": { + "start": 789, + "end": 833, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 790, + "end": 804, + "ctxt": 0 + }, + "rest": { + "start": 790, + "end": 793, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 793, + "end": 797, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 797, + "end": 804, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 799, + "end": 804, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 799, + "end": 802, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 806, + "end": 833, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 809, + "end": 833, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 810, + "end": 832, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 816, + "end": 817, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 816, + "end": 817, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 826, + "end": 832, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 836, + "end": 849, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 837, + "end": 845, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 837, + "end": 845, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 837, + "end": 845, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 847, + "end": 848, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 847, + "end": 848, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 847, + "end": 848, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 856, + "end": 938, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 856, + "end": 857, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 856, + "end": 857, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsFunctionType", + "span": { + "start": 866, + "end": 910, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 867, + "end": 881, + "ctxt": 0 + }, + "rest": { + "start": 867, + "end": 870, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 870, + "end": 874, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 874, + "end": 881, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 876, + "end": 881, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 876, + "end": 879, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 883, + "end": 910, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 886, + "end": 910, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 887, + "end": 909, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 893, + "end": 894, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 893, + "end": 894, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 903, + "end": 909, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 913, + "end": 926, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 914, + "end": 922, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 914, + "end": 922, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 914, + "end": 922, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 924, + "end": 925, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 924, + "end": 925, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 924, + "end": 925, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 933, + "end": 938, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 941, + "end": 968, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 946, + "end": 951, + "ctxt": 0 + }, + "value": "X3_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 954, + "end": 967, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 954, + "end": 956, + "ctxt": 0 + }, + "value": "X3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 956, + "end": 967, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 957, + "end": 966, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 960, + "end": 966, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 963, + "end": 966, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 963, + "end": 966, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 988, + "end": 1013, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 993, + "end": 998, + "ctxt": 0 + }, + "value": "X3_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1001, + "end": 1012, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1001, + "end": 1003, + "ctxt": 0 + }, + "value": "X3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1003, + "end": 1012, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 1004, + "end": 1011, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1007, + "end": 1011, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 1010, + "end": 1011, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 1010, + "end": 1011, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1031, + "end": 1061, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1036, + "end": 1041, + "ctxt": 0 + }, + "value": "X3_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1044, + "end": 1060, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1044, + "end": 1046, + "ctxt": 0 + }, + "value": "X3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1046, + "end": 1060, + "ctxt": 0 + }, + "params": [ + { + "type": "TsFunctionType", + "span": { + "start": 1047, + "end": 1059, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1050, + "end": 1059, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1053, + "end": 1059, + "ctxt": 0 + }, + "kind": "object" + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1098, + "end": 1333, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1103, + "end": 1105, + "ctxt": 0 + }, + "value": "X4", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1105, + "end": 1144, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1106, + "end": 1143, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1106, + "end": 1107, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsConstructorType", + "span": { + "start": 1116, + "end": 1143, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 1121, + "end": 1135, + "ctxt": 0 + }, + "rest": { + "start": 1121, + "end": 1124, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 1124, + "end": 1128, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1128, + "end": 1135, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 1130, + "end": 1135, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 1130, + "end": 1133, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1137, + "end": 1143, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1140, + "end": 1143, + "ctxt": 0 + }, + "kind": "any" + } + }, + "isAbstract": false + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1151, + "end": 1332, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1151, + "end": 1152, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1151, + "end": 1152, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsConstructorType", + "span": { + "start": 1161, + "end": 1216, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 1166, + "end": 1180, + "ctxt": 0 + }, + "rest": { + "start": 1166, + "end": 1169, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 1169, + "end": 1173, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1173, + "end": 1180, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 1175, + "end": 1180, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 1175, + "end": 1178, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1182, + "end": 1216, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 1185, + "end": 1216, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 1186, + "end": 1215, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1192, + "end": 1193, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1192, + "end": 1193, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeLiteral", + "span": { + "start": 1202, + "end": 1215, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1204, + "end": 1213, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1204, + "end": 1205, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1205, + "end": 1213, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1207, + "end": 1213, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + }, + "default": null + } + } + } + }, + "isAbstract": false + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 1219, + "end": 1232, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 1220, + "end": 1228, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 1220, + "end": 1228, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1220, + "end": 1228, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 1230, + "end": 1231, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 1230, + "end": 1231, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1230, + "end": 1231, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 1239, + "end": 1332, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1239, + "end": 1240, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1239, + "end": 1240, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsConstructorType", + "span": { + "start": 1249, + "end": 1304, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 1254, + "end": 1268, + "ctxt": 0 + }, + "rest": { + "start": 1254, + "end": 1257, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 1257, + "end": 1261, + "ctxt": 0 + }, + "value": "args", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1261, + "end": 1268, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 1263, + "end": 1268, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 1263, + "end": 1266, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1270, + "end": 1304, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 1273, + "end": 1304, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 1274, + "end": 1303, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1280, + "end": 1281, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1280, + "end": 1281, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeLiteral", + "span": { + "start": 1290, + "end": 1303, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1292, + "end": 1301, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1292, + "end": 1293, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1293, + "end": 1301, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1295, + "end": 1301, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + } + ] + }, + "default": null + } + } + } + }, + "isAbstract": false + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 1307, + "end": 1320, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 1308, + "end": 1316, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 1308, + "end": 1316, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1308, + "end": 1316, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 1318, + "end": 1319, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 1318, + "end": 1319, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1318, + "end": 1319, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1327, + "end": 1332, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1335, + "end": 1373, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1340, + "end": 1345, + "ctxt": 0 + }, + "value": "X4_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1348, + "end": 1372, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1348, + "end": 1350, + "ctxt": 0 + }, + "value": "X4", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1350, + "end": 1372, + "ctxt": 0 + }, + "params": [ + { + "type": "TsConstructorType", + "span": { + "start": 1351, + "end": 1371, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1358, + "end": 1371, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1361, + "end": 1371, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1363, + "end": 1369, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1363, + "end": 1364, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1364, + "end": 1369, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 1366, + "end": 1369, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1366, + "end": 1369, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + } + ] + } + }, + "isAbstract": false + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1400, + "end": 1436, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1405, + "end": 1410, + "ctxt": 0 + }, + "value": "X4_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1413, + "end": 1435, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1413, + "end": 1415, + "ctxt": 0 + }, + "value": "X4", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1415, + "end": 1435, + "ctxt": 0 + }, + "params": [ + { + "type": "TsConstructorType", + "span": { + "start": 1416, + "end": 1434, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1423, + "end": 1434, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1426, + "end": 1434, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1428, + "end": 1432, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1428, + "end": 1429, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1429, + "end": 1432, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 1431, + "end": 1432, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 1431, + "end": 1432, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + } + ] + } + }, + "isAbstract": false + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1461, + "end": 1502, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1466, + "end": 1471, + "ctxt": 0 + }, + "value": "X4_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1474, + "end": 1501, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1474, + "end": 1476, + "ctxt": 0 + }, + "value": "X4", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1476, + "end": 1501, + "ctxt": 0 + }, + "params": [ + { + "type": "TsConstructorType", + "span": { + "start": 1477, + "end": 1500, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1484, + "end": 1500, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1487, + "end": 1500, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1489, + "end": 1498, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1489, + "end": 1490, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1490, + "end": 1498, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1492, + "end": 1498, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + } + ] + } + }, + "isAbstract": false + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1539, + "end": 1690, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1544, + "end": 1546, + "ctxt": 0 + }, + "value": "X5", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1546, + "end": 1549, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1547, + "end": 1548, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1547, + "end": 1548, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1556, + "end": 1689, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1556, + "end": 1557, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1556, + "end": 1557, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 1566, + "end": 1597, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1566, + "end": 1573, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1573, + "end": 1597, + "ctxt": 0 + }, + "params": [ + { + "type": "TsInferType", + "span": { + "start": 1574, + "end": 1596, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1580, + "end": 1581, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1580, + "end": 1581, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1590, + "end": 1596, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + ] + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 1600, + "end": 1613, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 1601, + "end": 1609, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 1601, + "end": 1609, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1601, + "end": 1609, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 1611, + "end": 1612, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 1611, + "end": 1612, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1611, + "end": 1612, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 1620, + "end": 1689, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1620, + "end": 1621, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1620, + "end": 1621, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 1630, + "end": 1661, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1630, + "end": 1637, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1637, + "end": 1661, + "ctxt": 0 + }, + "params": [ + { + "type": "TsInferType", + "span": { + "start": 1638, + "end": 1660, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1644, + "end": 1645, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1644, + "end": 1645, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1654, + "end": 1660, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ] + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 1664, + "end": 1677, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 1665, + "end": 1673, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 1665, + "end": 1673, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1665, + "end": 1673, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 1675, + "end": 1676, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 1675, + "end": 1676, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1675, + "end": 1676, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1684, + "end": 1689, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1692, + "end": 1728, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1697, + "end": 1702, + "ctxt": 0 + }, + "value": "X5_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1705, + "end": 1727, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1705, + "end": 1707, + "ctxt": 0 + }, + "value": "X5", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1707, + "end": 1727, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1708, + "end": 1726, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1708, + "end": 1715, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1715, + "end": 1726, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 1716, + "end": 1725, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 1716, + "end": 1719, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1716, + "end": 1719, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 1722, + "end": 1725, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1722, + "end": 1725, + "ctxt": 0 + }, + "value": "b", + "raw": "\"b\"" + } + } + ] + } + ] + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1754, + "end": 1786, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1759, + "end": 1764, + "ctxt": 0 + }, + "value": "X5_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1767, + "end": 1785, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1767, + "end": 1769, + "ctxt": 0 + }, + "value": "X5", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1769, + "end": 1785, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1770, + "end": 1784, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1770, + "end": 1777, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1777, + "end": 1784, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 1778, + "end": 1783, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 1778, + "end": 1779, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 1778, + "end": 1779, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 1782, + "end": 1783, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 1782, + "end": 1783, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + } + ] + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1808, + "end": 1842, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1813, + "end": 1818, + "ctxt": 0 + }, + "value": "X5_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1821, + "end": 1841, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1821, + "end": 1823, + "ctxt": 0 + }, + "value": "X5", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1823, + "end": 1841, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1824, + "end": 1840, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1824, + "end": 1831, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1831, + "end": 1840, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 1832, + "end": 1839, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 1832, + "end": 1834, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 1832, + "end": 1834, + "ctxt": 0 + }, + "value": [ + 1, + [ + 1 + ] + ], + "raw": "1n" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 1837, + "end": 1839, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 1837, + "end": 1839, + "ctxt": 0 + }, + "value": [ + 1, + [ + 2 + ] + ], + "raw": "2n" + } + } + ] + } + ] + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1879, + "end": 2026, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1884, + "end": 1886, + "ctxt": 0 + }, + "value": "X6", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1886, + "end": 1889, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1887, + "end": 1888, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1887, + "end": 1888, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1896, + "end": 2025, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1896, + "end": 1897, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1896, + "end": 1897, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 1906, + "end": 1935, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1908, + "end": 1933, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1908, + "end": 1909, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1909, + "end": 1933, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 1911, + "end": 1933, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1917, + "end": 1918, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1917, + "end": 1918, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1927, + "end": 1933, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 1938, + "end": 1951, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 1939, + "end": 1947, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 1939, + "end": 1947, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1939, + "end": 1947, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 1949, + "end": 1950, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 1949, + "end": 1950, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1949, + "end": 1950, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 1958, + "end": 2025, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 1958, + "end": 1959, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1958, + "end": 1959, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 1968, + "end": 1997, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1970, + "end": 1995, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1970, + "end": 1971, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1971, + "end": 1995, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 1973, + "end": 1995, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1979, + "end": 1980, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1979, + "end": 1980, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1989, + "end": 1995, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 2000, + "end": 2013, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 2001, + "end": 2009, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 2001, + "end": 2009, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2001, + "end": 2009, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 2011, + "end": 2012, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 2011, + "end": 2012, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2011, + "end": 2012, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2020, + "end": 2025, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2028, + "end": 2056, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2033, + "end": 2038, + "ctxt": 0 + }, + "value": "X6_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2041, + "end": 2055, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2041, + "end": 2043, + "ctxt": 0 + }, + "value": "X6", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2043, + "end": 2055, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2044, + "end": 2054, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2046, + "end": 2052, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2046, + "end": 2047, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2047, + "end": 2052, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2049, + "end": 2052, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2049, + "end": 2052, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2076, + "end": 2102, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2081, + "end": 2086, + "ctxt": 0 + }, + "value": "X6_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2089, + "end": 2101, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2089, + "end": 2091, + "ctxt": 0 + }, + "value": "X6", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2091, + "end": 2101, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2092, + "end": 2100, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2094, + "end": 2098, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2094, + "end": 2095, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2095, + "end": 2098, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2097, + "end": 2098, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2097, + "end": 2098, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2120, + "end": 2151, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2125, + "end": 2130, + "ctxt": 0 + }, + "value": "X6_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2133, + "end": 2150, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2133, + "end": 2135, + "ctxt": 0 + }, + "value": "X6", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2135, + "end": 2150, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2136, + "end": 2149, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2138, + "end": 2147, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2138, + "end": 2139, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2139, + "end": 2147, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2141, + "end": 2147, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2198, + "end": 2399, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2203, + "end": 2205, + "ctxt": 0 + }, + "value": "X7", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2205, + "end": 2208, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2206, + "end": 2207, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2206, + "end": 2207, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2215, + "end": 2398, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2215, + "end": 2216, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2215, + "end": 2216, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 2225, + "end": 2281, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2227, + "end": 2253, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2227, + "end": 2228, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2228, + "end": 2252, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2230, + "end": 2252, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2236, + "end": 2237, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2236, + "end": 2237, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2246, + "end": 2252, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2254, + "end": 2279, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2254, + "end": 2255, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2255, + "end": 2279, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2257, + "end": 2279, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2263, + "end": 2264, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2263, + "end": 2264, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2273, + "end": 2279, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 2284, + "end": 2297, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 2285, + "end": 2293, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 2285, + "end": 2293, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2285, + "end": 2293, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 2295, + "end": 2296, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 2295, + "end": 2296, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2295, + "end": 2296, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 2304, + "end": 2398, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2304, + "end": 2305, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2304, + "end": 2305, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 2314, + "end": 2370, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2316, + "end": 2342, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2316, + "end": 2317, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2317, + "end": 2341, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2319, + "end": 2341, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2325, + "end": 2326, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2325, + "end": 2326, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2335, + "end": 2341, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2343, + "end": 2368, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2343, + "end": 2344, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2344, + "end": 2368, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2346, + "end": 2368, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2352, + "end": 2353, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2352, + "end": 2353, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2362, + "end": 2368, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 2373, + "end": 2386, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 2374, + "end": 2382, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 2374, + "end": 2382, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2374, + "end": 2382, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 2384, + "end": 2385, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 2384, + "end": 2385, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2384, + "end": 2385, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2393, + "end": 2398, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2401, + "end": 2437, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2406, + "end": 2411, + "ctxt": 0 + }, + "value": "X7_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2414, + "end": 2436, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2414, + "end": 2416, + "ctxt": 0 + }, + "value": "X7", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2416, + "end": 2436, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2417, + "end": 2435, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2419, + "end": 2426, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2419, + "end": 2420, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2420, + "end": 2425, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2422, + "end": 2425, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2422, + "end": 2425, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2427, + "end": 2433, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2427, + "end": 2428, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2428, + "end": 2433, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2430, + "end": 2433, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2430, + "end": 2433, + "ctxt": 0 + }, + "value": "b", + "raw": "\"b\"" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2463, + "end": 2495, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2468, + "end": 2473, + "ctxt": 0 + }, + "value": "X7_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2476, + "end": 2494, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2476, + "end": 2478, + "ctxt": 0 + }, + "value": "X7", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2478, + "end": 2494, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2479, + "end": 2493, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2481, + "end": 2486, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2481, + "end": 2482, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2482, + "end": 2485, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2484, + "end": 2485, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2484, + "end": 2485, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2487, + "end": 2491, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2487, + "end": 2488, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2488, + "end": 2491, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2490, + "end": 2491, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2490, + "end": 2491, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2517, + "end": 2559, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2522, + "end": 2527, + "ctxt": 0 + }, + "value": "X7_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2530, + "end": 2558, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2530, + "end": 2532, + "ctxt": 0 + }, + "value": "X7", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2532, + "end": 2558, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2533, + "end": 2557, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2535, + "end": 2545, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2535, + "end": 2536, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2536, + "end": 2544, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2538, + "end": 2544, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2546, + "end": 2555, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2546, + "end": 2547, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2547, + "end": 2555, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2549, + "end": 2555, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2569, + "end": 2603, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2574, + "end": 2579, + "ctxt": 0 + }, + "value": "X7_T4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2582, + "end": 2602, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2582, + "end": 2584, + "ctxt": 0 + }, + "value": "X7", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2584, + "end": 2602, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2585, + "end": 2601, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2587, + "end": 2594, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2587, + "end": 2588, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2588, + "end": 2593, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2590, + "end": 2593, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2590, + "end": 2593, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2595, + "end": 2599, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2595, + "end": 2596, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2596, + "end": 2599, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2598, + "end": 2599, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2598, + "end": 2599, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2695, + "end": 2866, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2700, + "end": 2702, + "ctxt": 0 + }, + "value": "X8", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2702, + "end": 2705, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2703, + "end": 2704, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2703, + "end": 2704, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2712, + "end": 2865, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2712, + "end": 2713, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2712, + "end": 2713, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 2722, + "end": 2763, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2724, + "end": 2750, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2724, + "end": 2725, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2725, + "end": 2749, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2727, + "end": 2749, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2733, + "end": 2734, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2733, + "end": 2734, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2743, + "end": 2749, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2751, + "end": 2761, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2751, + "end": 2752, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2752, + "end": 2761, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2754, + "end": 2761, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2760, + "end": 2761, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2760, + "end": 2761, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 2766, + "end": 2779, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 2767, + "end": 2775, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 2767, + "end": 2775, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2767, + "end": 2775, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 2777, + "end": 2778, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 2777, + "end": 2778, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2777, + "end": 2778, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 2786, + "end": 2865, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2786, + "end": 2787, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2786, + "end": 2787, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 2796, + "end": 2837, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2798, + "end": 2824, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2798, + "end": 2799, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2799, + "end": 2823, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2801, + "end": 2823, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2807, + "end": 2808, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2807, + "end": 2808, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2817, + "end": 2823, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2825, + "end": 2835, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2825, + "end": 2826, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2826, + "end": 2835, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 2828, + "end": 2835, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2834, + "end": 2835, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2834, + "end": 2835, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 2840, + "end": 2853, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 2841, + "end": 2849, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 2841, + "end": 2849, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2841, + "end": 2849, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 2851, + "end": 2852, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 2851, + "end": 2852, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2851, + "end": 2852, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2860, + "end": 2865, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2868, + "end": 2904, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2873, + "end": 2878, + "ctxt": 0 + }, + "value": "X8_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2881, + "end": 2903, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2881, + "end": 2883, + "ctxt": 0 + }, + "value": "X8", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2883, + "end": 2903, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2884, + "end": 2902, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2886, + "end": 2893, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2886, + "end": 2887, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2887, + "end": 2892, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2889, + "end": 2892, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2889, + "end": 2892, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2894, + "end": 2900, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2894, + "end": 2895, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2895, + "end": 2900, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2897, + "end": 2900, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2897, + "end": 2900, + "ctxt": 0 + }, + "value": "b", + "raw": "\"b\"" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2930, + "end": 2962, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2935, + "end": 2940, + "ctxt": 0 + }, + "value": "X8_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2943, + "end": 2961, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2943, + "end": 2945, + "ctxt": 0 + }, + "value": "X8", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2945, + "end": 2961, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2946, + "end": 2960, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2948, + "end": 2953, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2948, + "end": 2949, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2949, + "end": 2952, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2951, + "end": 2952, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2951, + "end": 2952, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2954, + "end": 2958, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2954, + "end": 2955, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2955, + "end": 2958, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2957, + "end": 2958, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 2957, + "end": 2958, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2984, + "end": 3026, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2989, + "end": 2994, + "ctxt": 0 + }, + "value": "X8_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2997, + "end": 3025, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2997, + "end": 2999, + "ctxt": 0 + }, + "value": "X8", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2999, + "end": 3025, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3000, + "end": 3024, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3002, + "end": 3012, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3002, + "end": 3003, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3003, + "end": 3011, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3005, + "end": 3011, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3013, + "end": 3022, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3013, + "end": 3014, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3014, + "end": 3022, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3016, + "end": 3022, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3036, + "end": 3070, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3041, + "end": 3046, + "ctxt": 0 + }, + "value": "X8_T4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3049, + "end": 3069, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3049, + "end": 3051, + "ctxt": 0 + }, + "value": "X8", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3051, + "end": 3069, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3052, + "end": 3068, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3054, + "end": 3061, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3054, + "end": 3055, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3055, + "end": 3060, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3057, + "end": 3060, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3057, + "end": 3060, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3062, + "end": 3066, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3062, + "end": 3063, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3063, + "end": 3066, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3065, + "end": 3066, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3065, + "end": 3066, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3161, + "end": 3332, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3166, + "end": 3168, + "ctxt": 0 + }, + "value": "X9", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3168, + "end": 3171, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3169, + "end": 3170, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3169, + "end": 3170, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3178, + "end": 3331, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3178, + "end": 3179, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3178, + "end": 3179, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 3188, + "end": 3229, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3190, + "end": 3201, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3190, + "end": 3191, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3191, + "end": 3200, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3193, + "end": 3200, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3199, + "end": 3200, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3199, + "end": 3200, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3202, + "end": 3227, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3202, + "end": 3203, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3203, + "end": 3227, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3205, + "end": 3227, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3211, + "end": 3212, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3211, + "end": 3212, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 3221, + "end": 3227, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 3232, + "end": 3245, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 3233, + "end": 3241, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 3233, + "end": 3241, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3233, + "end": 3241, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 3243, + "end": 3244, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 3243, + "end": 3244, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3243, + "end": 3244, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 3252, + "end": 3331, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3252, + "end": 3253, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3252, + "end": 3253, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 3262, + "end": 3303, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3264, + "end": 3275, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3264, + "end": 3265, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3265, + "end": 3274, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3267, + "end": 3274, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3273, + "end": 3274, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3273, + "end": 3274, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3276, + "end": 3301, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3276, + "end": 3277, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3277, + "end": 3301, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3279, + "end": 3301, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3285, + "end": 3286, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3285, + "end": 3286, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 3295, + "end": 3301, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 3306, + "end": 3319, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 3307, + "end": 3315, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsLiteralType", + "span": { + "start": 3307, + "end": 3315, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3307, + "end": 3315, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 3317, + "end": 3318, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 3317, + "end": 3318, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3317, + "end": 3318, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3326, + "end": 3331, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3334, + "end": 3370, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3339, + "end": 3344, + "ctxt": 0 + }, + "value": "X9_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3347, + "end": 3369, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3347, + "end": 3349, + "ctxt": 0 + }, + "value": "X9", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3349, + "end": 3369, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3350, + "end": 3368, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3352, + "end": 3359, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3352, + "end": 3353, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3353, + "end": 3358, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3355, + "end": 3358, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3355, + "end": 3358, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3360, + "end": 3366, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3360, + "end": 3361, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3361, + "end": 3366, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3363, + "end": 3366, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3363, + "end": 3366, + "ctxt": 0 + }, + "value": "b", + "raw": "\"b\"" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3396, + "end": 3428, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3401, + "end": 3406, + "ctxt": 0 + }, + "value": "X9_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3409, + "end": 3427, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3409, + "end": 3411, + "ctxt": 0 + }, + "value": "X9", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3411, + "end": 3427, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3412, + "end": 3426, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3414, + "end": 3419, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3414, + "end": 3415, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3415, + "end": 3418, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3417, + "end": 3418, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3417, + "end": 3418, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3420, + "end": 3424, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3420, + "end": 3421, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3421, + "end": 3424, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3423, + "end": 3424, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3423, + "end": 3424, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3450, + "end": 3492, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3455, + "end": 3460, + "ctxt": 0 + }, + "value": "X9_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3463, + "end": 3491, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3463, + "end": 3465, + "ctxt": 0 + }, + "value": "X9", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3465, + "end": 3491, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3466, + "end": 3490, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3468, + "end": 3478, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3468, + "end": 3469, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3469, + "end": 3477, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3471, + "end": 3477, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3479, + "end": 3488, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3479, + "end": 3480, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3480, + "end": 3488, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3482, + "end": 3488, + "ctxt": 0 + }, + "kind": "object" + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3502, + "end": 3536, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3507, + "end": 3512, + "ctxt": 0 + }, + "value": "X9_T4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3515, + "end": 3535, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3515, + "end": 3517, + "ctxt": 0 + }, + "value": "X9", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3517, + "end": 3535, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3518, + "end": 3534, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3520, + "end": 3527, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3520, + "end": 3521, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3521, + "end": 3526, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3523, + "end": 3526, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3523, + "end": 3526, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3528, + "end": 3532, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3528, + "end": 3529, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3529, + "end": 3532, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3531, + "end": 3532, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3531, + "end": 3532, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "typeParams": null + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3598, + "end": 3663, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3603, + "end": 3606, + "ctxt": 0 + }, + "value": "X10", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3606, + "end": 3609, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3607, + "end": 3608, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3607, + "end": 3608, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3612, + "end": 3662, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3612, + "end": 3613, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3612, + "end": 3613, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 3622, + "end": 3654, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3623, + "end": 3653, + "ctxt": 0 + }, + "checkType": { + "type": "TsInferType", + "span": { + "start": 3623, + "end": 3630, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3629, + "end": 3630, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3629, + "end": 3630, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + }, + "extendsType": { + "type": "TsKeywordType", + "span": { + "start": 3639, + "end": 3645, + "ctxt": 0 + }, + "kind": "number" + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3648, + "end": 3649, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3648, + "end": 3649, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3652, + "end": 3653, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3652, + "end": 3653, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3657, + "end": 3658, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3657, + "end": 3658, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3661, + "end": 3662, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3661, + "end": 3662, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3693, + "end": 3740, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3698, + "end": 3704, + "ctxt": 0 + }, + "value": "X10_Y1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3704, + "end": 3707, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3705, + "end": 3706, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3705, + "end": 3706, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3710, + "end": 3739, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3710, + "end": 3713, + "ctxt": 0 + }, + "value": "X10", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3713, + "end": 3739, + "ctxt": 0 + }, + "params": [ + { + "type": "TsConditionalType", + "span": { + "start": 3714, + "end": 3738, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3714, + "end": 3715, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3714, + "end": 3715, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsKeywordType", + "span": { + "start": 3724, + "end": 3730, + "ctxt": 0 + }, + "kind": "number" + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3733, + "end": 3734, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3733, + "end": 3734, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3737, + "end": 3738, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3737, + "end": 3738, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3741, + "end": 3773, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3746, + "end": 3755, + "ctxt": 0 + }, + "value": "X10_T1_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3758, + "end": 3772, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3758, + "end": 3764, + "ctxt": 0 + }, + "value": "X10_Y1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3764, + "end": 3772, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 3765, + "end": 3771, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3775, + "end": 3842, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3780, + "end": 3783, + "ctxt": 0 + }, + "value": "X11", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3783, + "end": 3786, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3784, + "end": 3785, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3784, + "end": 3785, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3789, + "end": 3841, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3789, + "end": 3790, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3789, + "end": 3790, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 3799, + "end": 3833, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3800, + "end": 3832, + "ctxt": 0 + }, + "checkType": { + "type": "TsParenthesizedType", + "span": { + "start": 3800, + "end": 3809, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3801, + "end": 3808, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3807, + "end": 3808, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3807, + "end": 3808, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "extendsType": { + "type": "TsKeywordType", + "span": { + "start": 3818, + "end": 3824, + "ctxt": 0 + }, + "kind": "number" + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3827, + "end": 3828, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3827, + "end": 3828, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3831, + "end": 3832, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3831, + "end": 3832, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3836, + "end": 3837, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3836, + "end": 3837, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3840, + "end": 3841, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3840, + "end": 3841, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3872, + "end": 3929, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3877, + "end": 3880, + "ctxt": 0 + }, + "value": "X12", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3880, + "end": 3883, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3881, + "end": 3882, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3881, + "end": 3882, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3886, + "end": 3928, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3886, + "end": 3887, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3886, + "end": 3887, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 3896, + "end": 3920, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 3897, + "end": 3919, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3903, + "end": 3904, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3903, + "end": 3904, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 3913, + "end": 3919, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 3923, + "end": 3924, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3923, + "end": 3924, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 3927, + "end": 3928, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3927, + "end": 3928, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3982, + "end": 4037, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3987, + "end": 3990, + "ctxt": 0 + }, + "value": "X13", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3990, + "end": 3993, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3991, + "end": 3992, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3991, + "end": 3992, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3996, + "end": 4036, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 3996, + "end": 3997, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3996, + "end": 3997, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsInferType", + "span": { + "start": 4006, + "end": 4028, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4012, + "end": 4013, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4012, + "end": 4013, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 4022, + "end": 4028, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4031, + "end": 4032, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4031, + "end": 4032, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4035, + "end": 4036, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4035, + "end": 4036, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4122, + "end": 4183, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4127, + "end": 4130, + "ctxt": 0 + }, + "value": "X14", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4130, + "end": 4133, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4131, + "end": 4132, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4131, + "end": 4132, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4136, + "end": 4182, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4136, + "end": 4137, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4136, + "end": 4137, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeOperator", + "span": { + "start": 4146, + "end": 4174, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 4152, + "end": 4174, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4158, + "end": 4159, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4158, + "end": 4159, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 4168, + "end": 4174, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4177, + "end": 4178, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4177, + "end": 4178, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4181, + "end": 4182, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4181, + "end": 4182, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4287, + "end": 4366, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4292, + "end": 4295, + "ctxt": 0 + }, + "value": "X15", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4295, + "end": 4298, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4296, + "end": 4297, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4296, + "end": 4297, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4301, + "end": 4365, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4301, + "end": 4302, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4301, + "end": 4302, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsMappedType", + "span": { + "start": 4311, + "end": 4357, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4314, + "end": 4350, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4314, + "end": 4315, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsConditionalType", + "span": { + "start": 4319, + "end": 4350, + "ctxt": 0 + }, + "checkType": { + "type": "TsInferType", + "span": { + "start": 4319, + "end": 4326, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4325, + "end": 4326, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4325, + "end": 4326, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + }, + "extendsType": { + "type": "TsTypeOperator", + "span": { + "start": 4335, + "end": 4342, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4341, + "end": 4342, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4341, + "end": 4342, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4345, + "end": 4346, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4345, + "end": 4346, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4349, + "end": 4350, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4349, + "end": 4350, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 4353, + "end": 4354, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4353, + "end": 4354, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4360, + "end": 4361, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4360, + "end": 4361, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4364, + "end": 4365, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4364, + "end": 4365, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4396, + "end": 4467, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4401, + "end": 4404, + "ctxt": 0 + }, + "value": "X16", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4404, + "end": 4407, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4405, + "end": 4406, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4405, + "end": 4406, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4410, + "end": 4466, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4410, + "end": 4411, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4410, + "end": 4411, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsMappedType", + "span": { + "start": 4420, + "end": 4458, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4423, + "end": 4451, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4423, + "end": 4424, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsInferType", + "span": { + "start": 4428, + "end": 4451, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4434, + "end": 4435, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4434, + "end": 4435, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 4444, + "end": 4451, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4450, + "end": 4451, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4450, + "end": 4451, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 4454, + "end": 4455, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4454, + "end": 4455, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4461, + "end": 4462, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4461, + "end": 4462, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4465, + "end": 4466, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4465, + "end": 4466, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4520, + "end": 4604, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4525, + "end": 4528, + "ctxt": 0 + }, + "value": "X17", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4528, + "end": 4531, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4529, + "end": 4530, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4529, + "end": 4530, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4534, + "end": 4603, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4534, + "end": 4535, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4534, + "end": 4535, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsMappedType", + "span": { + "start": 4544, + "end": 4595, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4547, + "end": 4559, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4547, + "end": 4548, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 4552, + "end": 4559, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4558, + "end": 4559, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4558, + "end": 4559, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": { + "type": "TsConditionalType", + "span": { + "start": 4563, + "end": 4588, + "ctxt": 0 + }, + "checkType": { + "type": "TsInferType", + "span": { + "start": 4563, + "end": 4570, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4569, + "end": 4570, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4569, + "end": 4570, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 4579, + "end": 4580, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4579, + "end": 4580, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4583, + "end": 4584, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4583, + "end": 4584, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4587, + "end": 4588, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4587, + "end": 4588, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 4591, + "end": 4592, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4591, + "end": 4592, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4598, + "end": 4599, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4598, + "end": 4599, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4602, + "end": 4603, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4602, + "end": 4603, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4634, + "end": 4710, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4639, + "end": 4642, + "ctxt": 0 + }, + "value": "X18", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4642, + "end": 4645, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4643, + "end": 4644, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4643, + "end": 4644, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4648, + "end": 4709, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4648, + "end": 4649, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4648, + "end": 4649, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsMappedType", + "span": { + "start": 4658, + "end": 4701, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4661, + "end": 4673, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4661, + "end": 4662, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 4666, + "end": 4673, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4672, + "end": 4673, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4672, + "end": 4673, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": { + "type": "TsInferType", + "span": { + "start": 4677, + "end": 4694, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4683, + "end": 4684, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4683, + "end": 4684, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 4693, + "end": 4694, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4693, + "end": 4694, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + }, + "default": null + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 4697, + "end": 4698, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4697, + "end": 4698, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 4704, + "end": 4705, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4704, + "end": 4705, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 4708, + "end": 4709, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4708, + "end": 4709, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4764, + "end": 4854, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4769, + "end": 4772, + "ctxt": 0 + }, + "value": "X19", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4772, + "end": 4799, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4773, + "end": 4798, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4773, + "end": 4774, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4783, + "end": 4798, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4783, + "end": 4789, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4792, + "end": 4798, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4802, + "end": 4853, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4802, + "end": 4803, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4802, + "end": 4803, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 4812, + "end": 4836, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 4813, + "end": 4835, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4819, + "end": 4820, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4819, + "end": 4820, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 4829, + "end": 4835, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 4839, + "end": 4845, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 4840, + "end": 4841, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 4840, + "end": 4841, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4840, + "end": 4841, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 4843, + "end": 4844, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 4843, + "end": 4844, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4843, + "end": 4844, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4848, + "end": 4853, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4855, + "end": 4878, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4860, + "end": 4866, + "ctxt": 0 + }, + "value": "X19_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4869, + "end": 4877, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4869, + "end": 4872, + "ctxt": 0 + }, + "value": "X19", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4872, + "end": 4877, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 4873, + "end": 4876, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4873, + "end": 4876, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4888, + "end": 4909, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4893, + "end": 4899, + "ctxt": 0 + }, + "value": "X19_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4902, + "end": 4908, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4902, + "end": 4905, + "ctxt": 0 + }, + "value": "X19", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4905, + "end": 4908, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 4906, + "end": 4907, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4906, + "end": 4907, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4920, + "end": 4947, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4925, + "end": 4931, + "ctxt": 0 + }, + "value": "X19_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4934, + "end": 4946, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4934, + "end": 4937, + "ctxt": 0 + }, + "value": "X19", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4937, + "end": 4946, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 4938, + "end": 4945, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 4938, + "end": 4939, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 4938, + "end": 4939, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 4942, + "end": 4945, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4942, + "end": 4945, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4959, + "end": 5068, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4964, + "end": 4967, + "ctxt": 0 + }, + "value": "X20", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4967, + "end": 4970, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4968, + "end": 4969, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4968, + "end": 4969, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4973, + "end": 5067, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 4973, + "end": 4974, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4973, + "end": 4974, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 4983, + "end": 5007, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 4984, + "end": 5006, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4990, + "end": 4991, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4990, + "end": 4991, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 5000, + "end": 5006, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "trueType": { + "type": "TsConditionalType", + "span": { + "start": 5010, + "end": 5059, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5010, + "end": 5011, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5010, + "end": 5011, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 5020, + "end": 5039, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 5021, + "end": 5038, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5027, + "end": 5028, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5027, + "end": 5028, + "ctxt": 0 + }, + "value": "V", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 5037, + "end": 5038, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5037, + "end": 5038, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 5042, + "end": 5051, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 5043, + "end": 5044, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 5043, + "end": 5044, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5043, + "end": 5044, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 5046, + "end": 5047, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 5046, + "end": 5047, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5046, + "end": 5047, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 5049, + "end": 5050, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 5049, + "end": 5050, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5049, + "end": 5050, + "ctxt": 0 + }, + "value": "V", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5054, + "end": 5059, + "ctxt": 0 + }, + "kind": "never" + } + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5062, + "end": 5067, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5069, + "end": 5096, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5074, + "end": 5080, + "ctxt": 0 + }, + "value": "X20_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5083, + "end": 5095, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5083, + "end": 5086, + "ctxt": 0 + }, + "value": "X20", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5086, + "end": 5095, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 5087, + "end": 5094, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5087, + "end": 5088, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5087, + "end": 5088, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5091, + "end": 5094, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5091, + "end": 5094, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5111, + "end": 5190, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5116, + "end": 5119, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5119, + "end": 5140, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5120, + "end": 5121, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5120, + "end": 5121, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 5123, + "end": 5139, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5123, + "end": 5124, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 5133, + "end": 5139, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5143, + "end": 5189, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5143, + "end": 5144, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5143, + "end": 5144, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsParenthesizedType", + "span": { + "start": 5153, + "end": 5172, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 5154, + "end": 5171, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5160, + "end": 5161, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5160, + "end": 5161, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 5170, + "end": 5171, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5170, + "end": 5171, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 5175, + "end": 5181, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 5176, + "end": 5177, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 5176, + "end": 5177, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5176, + "end": 5177, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 5179, + "end": 5180, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 5179, + "end": 5180, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5179, + "end": 5180, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5184, + "end": 5189, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5191, + "end": 5215, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5196, + "end": 5202, + "ctxt": 0 + }, + "value": "X21_T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5205, + "end": 5214, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5205, + "end": 5208, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5208, + "end": 5214, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 5209, + "end": 5210, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5209, + "end": 5210, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5212, + "end": 5213, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5212, + "end": 5213, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5226, + "end": 5256, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5231, + "end": 5237, + "ctxt": 0 + }, + "value": "X21_T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5240, + "end": 5255, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5240, + "end": 5243, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5243, + "end": 5255, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 5244, + "end": 5251, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5244, + "end": 5245, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5244, + "end": 5245, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5248, + "end": 5251, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5248, + "end": 5251, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + ] + }, + { + "type": "TsLiteralType", + "span": { + "start": 5253, + "end": 5254, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5253, + "end": 5254, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5267, + "end": 5295, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5272, + "end": 5278, + "ctxt": 0 + }, + "value": "X21_T3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5281, + "end": 5294, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5281, + "end": 5284, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5284, + "end": 5294, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 5285, + "end": 5290, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5285, + "end": 5286, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5285, + "end": 5286, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5289, + "end": 5290, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5289, + "end": 5290, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + }, + { + "type": "TsLiteralType", + "span": { + "start": 5292, + "end": 5293, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5292, + "end": 5293, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5306, + "end": 5338, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5311, + "end": 5317, + "ctxt": 0 + }, + "value": "X21_T4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5320, + "end": 5337, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5320, + "end": 5323, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5323, + "end": 5337, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 5324, + "end": 5329, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5324, + "end": 5325, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5324, + "end": 5325, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5328, + "end": 5329, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5328, + "end": 5329, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + }, + { + "type": "TsUnionType", + "span": { + "start": 5331, + "end": 5336, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5331, + "end": 5332, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5331, + "end": 5332, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5335, + "end": 5336, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5335, + "end": 5336, + "ctxt": 0 + }, + "value": 3.0, + "raw": "3" + } + } + ] + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5349, + "end": 5377, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5354, + "end": 5360, + "ctxt": 0 + }, + "value": "X21_T5", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5363, + "end": 5376, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5363, + "end": 5366, + "ctxt": 0 + }, + "value": "X21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5366, + "end": 5376, + "ctxt": 0 + }, + "params": [ + { + "type": "TsUnionType", + "span": { + "start": 5367, + "end": 5372, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5367, + "end": 5368, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5367, + "end": 5368, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5371, + "end": 5372, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5371, + "end": 5372, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ] + }, + { + "type": "TsLiteralType", + "span": { + "start": 5374, + "end": 5375, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5374, + "end": 5375, + "ctxt": 0 + }, + "value": 3.0, + "raw": "3" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5405, + "end": 5509, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5410, + "end": 5418, + "ctxt": 0 + }, + "value": "IfEquals", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5418, + "end": 5430, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5419, + "end": 5420, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5419, + "end": 5420, + "ctxt": 0 + }, + "value": "X", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 5422, + "end": 5423, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5422, + "end": 5423, + "ctxt": 0 + }, + "value": "Y", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 5425, + "end": 5426, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5425, + "end": 5426, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 5428, + "end": 5429, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5428, + "end": 5429, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5433, + "end": 5508, + "ctxt": 0 + }, + "checkType": { + "type": "TsParenthesizedType", + "span": { + "start": 5433, + "end": 5463, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 5434, + "end": 5462, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5434, + "end": 5437, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5435, + "end": 5436, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5435, + "end": 5436, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5440, + "end": 5462, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5443, + "end": 5462, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5443, + "end": 5444, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5443, + "end": 5444, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 5453, + "end": 5454, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5453, + "end": 5454, + "ctxt": 0 + }, + "value": "X", + "optional": false + }, + "typeParams": null + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 5457, + "end": 5458, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5457, + "end": 5458, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 5461, + "end": 5462, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5461, + "end": 5462, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + } + } + } + }, + "extendsType": { + "type": "TsFunctionType", + "span": { + "start": 5472, + "end": 5500, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5472, + "end": 5475, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5473, + "end": 5474, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5473, + "end": 5474, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5478, + "end": 5500, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5481, + "end": 5500, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5481, + "end": 5482, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5481, + "end": 5482, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 5491, + "end": 5492, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5491, + "end": 5492, + "ctxt": 0 + }, + "value": "Y", + "optional": false + }, + "typeParams": null + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 5495, + "end": 5496, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5495, + "end": 5496, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 5499, + "end": 5500, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5499, + "end": 5500, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + } + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5503, + "end": 5504, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5503, + "end": 5504, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsTypeReference", + "span": { + "start": 5507, + "end": 5508, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5507, + "end": 5508, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 5511, + "end": 5581, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 5525, + "end": 5580, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 5525, + "end": 5527, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5527, + "end": 5580, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 5529, + "end": 5580, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5529, + "end": 5532, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5530, + "end": 5531, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5530, + "end": 5531, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5535, + "end": 5580, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 5538, + "end": 5580, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5539, + "end": 5579, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5539, + "end": 5540, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5539, + "end": 5540, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsInferType", + "span": { + "start": 5549, + "end": 5571, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5555, + "end": 5556, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5555, + "end": 5556, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 5565, + "end": 5571, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 5574, + "end": 5575, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5574, + "end": 5575, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 5578, + "end": 5579, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5578, + "end": 5579, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5591, + "end": 5593, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 5582, + "end": 5614, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5596, + "end": 5614, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5602, + "end": 5612, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 5609, + "end": 5611, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5616, + "end": 5656, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5621, + "end": 5633, + "ctxt": 0 + }, + "value": "ExpectNumber", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5633, + "end": 5651, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5634, + "end": 5650, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5634, + "end": 5635, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 5644, + "end": 5650, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5654, + "end": 5655, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5654, + "end": 5655, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 5657, + "end": 5726, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 5671, + "end": 5725, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 5671, + "end": 5673, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5673, + "end": 5725, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 5675, + "end": 5725, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5675, + "end": 5678, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5676, + "end": 5677, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5676, + "end": 5677, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5681, + "end": 5725, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 5684, + "end": 5725, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5685, + "end": 5724, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 5685, + "end": 5686, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5685, + "end": 5686, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 5695, + "end": 5716, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5695, + "end": 5707, + "ctxt": 0 + }, + "value": "ExpectNumber", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 5707, + "end": 5716, + "ctxt": 0 + }, + "params": [ + { + "type": "TsInferType", + "span": { + "start": 5708, + "end": 5715, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5714, + "end": 5715, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5714, + "end": 5715, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + ] + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 5719, + "end": 5720, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5719, + "end": 5720, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 5723, + "end": 5724, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5723, + "end": 5724, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + } + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5736, + "end": 5738, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 5727, + "end": 5759, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5741, + "end": 5759, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5747, + "end": 5757, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 5754, + "end": 5756, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.ts b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.ts new file mode 100644 index 00000000000..8db806906ea --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends1.ts @@ -0,0 +1,138 @@ +// @strict: true +// @declaration: true + +// infer to tuple element +type X1 = + T extends [infer U extends string] ? ["string", U] : + T extends [infer U extends number] ? ["number", U] : + never; + +type X1_T1 = X1<["a"]>; // ["string", "a"] +type X1_T2 = X1<[1]>; // ["number", 1] +type X1_T3 = X1<[object]>; // never + +// infer to argument +type X2 void> = + T extends (a: infer U extends string) => void ? ["string", U] : + T extends (a: infer U extends number) => void ? ["number", U] : + never; + +type X2_T1 = X2<(a: "a") => void>; // ["string", "a"] +type X2_T2 = X2<(a: 1) => void>; // ["number", 1] +type X2_T3 = X2<(a: object) => void>; // never + +// infer to return type +type X3 any> = + T extends (...args: any[]) => (infer U extends string) ? ["string", U] : + T extends (...args: any[]) => (infer U extends number) ? ["number", U] : + never; + +type X3_T1 = X3<() => "a">; // ["string", "a"] +type X3_T2 = X3<() => 1>; // ["number", 1] +type X3_T3 = X3<() => object>; // never + +// infer to instance type +type X4 any> = + T extends new (...args: any[]) => (infer U extends { a: string }) ? ["string", U] : + T extends new (...args: any[]) => (infer U extends { a: number }) ? ["number", U] : + never; + +type X4_T1 = X4 { a: "a" }>; // ["string", { a: "a" }] +type X4_T2 = X4 { a: 1 }>; // ["number", { a: 1 }] +type X4_T3 = X4 { a: object }>; // never + +// infer to type argument +type X5 = + T extends Promise ? ["string", U] : + T extends Promise ? ["number", U] : + never; + +type X5_T1 = X5>; // ["string", "a" | "b"] +type X5_T2 = X5>; // ["number", 1 | 2] +type X5_T3 = X5>; // never + +// infer to property type +type X6 = + T extends { a: infer U extends string } ? ["string", U] : + T extends { a: infer U extends number } ? ["number", U] : + never; + +type X6_T1 = X6<{ a: "a" }>; // ["string", "a"] +type X6_T2 = X6<{ a: 1 }>; // ["number", 1] +type X6_T3 = X6<{ a: object }>; // never + +// infer twice with same constraint +type X7 = + T extends { a: infer U extends string, b: infer U extends string } ? ["string", U] : + T extends { a: infer U extends number, b: infer U extends number } ? ["number", U] : + never; + +type X7_T1 = X7<{ a: "a", b: "b" }>; // ["string", "a" | "b"] +type X7_T2 = X7<{ a: 1, b: 2 }>; // ["number", 1 | 2] +type X7_T3 = X7<{ a: object, b: object }>; // never +type X7_T4 = X7<{ a: "a", b: 1 }>; // never + +// infer twice with missing second constraint (same behavior as class/interface) +type X8 = + T extends { a: infer U extends string, b: infer U } ? ["string", U] : + T extends { a: infer U extends number, b: infer U } ? ["number", U] : + never; + +type X8_T1 = X8<{ a: "a", b: "b" }>; // ["string", "a" | "b"] +type X8_T2 = X8<{ a: 1, b: 2 }>; // ["number", 1 | 2] +type X8_T3 = X8<{ a: object, b: object }>; // never +type X8_T4 = X8<{ a: "a", b: 1 }>; // never + +// infer twice with missing first constraint (same behavior as class/interface) +type X9 = + T extends { a: infer U, b: infer U extends string } ? ["string", U] : + T extends { a: infer U, b: infer U extends number } ? ["number", U] : + never; + +type X9_T1 = X9<{ a: "a", b: "b" }>; // ["string", "a" | "b"] +type X9_T2 = X9<{ a: 1, b: 2 }>; // ["number", 1 | 2] +type X9_T3 = X9<{ a: object, b: object }>; // never +type X9_T4 = X9<{ a: "a", b: 1 }>; // never + +// Speculative lookahead for `infer T extends U ?` +type X10 = T extends (infer U extends number ? 1 : 0) ? 1 : 0; // ok, parsed as conditional +type X10_Y1 = X10; +type X10_T1_T1 = X10_Y1; + +type X11 = T extends ((infer U) extends number ? 1 : 0) ? 1 : 0; // ok, parsed as conditional +type X12 = T extends (infer U extends number) ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) +type X13 = T extends infer U extends number ? 1 : 0; // ok, parsed as `infer..extends` (conditional types not allowed in 'extends type') +type X14 = T extends keyof infer U extends number ? 1 : 0; // ok, parsed as `infer..extends` (precedence wouldn't have parsed the `?` as part of a type operator) +type X15 = T extends { [P in infer U extends keyof T ? 1 : 0]: 1; } ? 1 : 0; // ok, parsed as conditional +type X16 = T extends { [P in infer U extends keyof T]: 1; } ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) +type X17 = T extends { [P in keyof T as infer U extends P ? 1 : 0]: 1; } ? 1 : 0; // ok, parsed as conditional +type X18 = T extends { [P in keyof T as infer U extends P]: 1; } ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) + +type X19 = T extends (infer U extends number) ? [T, U] : never; +type X19_T1 = X19<"a">; // never +type X19_T2 = X19<1>; // [1, 1] +type X19_T3 = X19<1 | "a">; // [1, 1] + +type X20 = T extends (infer U extends number) ? T extends (infer V extends U) ? [T, U, V] : never : never; +type X20_T1 = X20<1 | "a">; // [1, 1, 1] + +type X21 = T extends (infer U extends N) ? [T, U] : never; +type X21_T1 = X21<1, 1>; // [1, 1] +type X21_T2 = X21<1 | "a", 1>; // [1, 1] +type X21_T3 = X21<1 | 2, 1>; // [1, 1] +type X21_T4 = X21<1 | 2, 2 | 3>; // [2, 2] +type X21_T5 = X21<1 | 2, 3>; // never + +// from mongoose +type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; + +declare const x1: () => (T extends infer U extends number ? 1 : 0); +function f1() { + return x1; +} + +type ExpectNumber = T; +declare const x2: () => (T extends ExpectNumber ? 1 : 0); +function f2() { + return x2; +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.json b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.json new file mode 100644 index 00000000000..c459d38217f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.json @@ -0,0 +1,578 @@ +{ + "type": "Script", + "span": { + "start": 96, + "end": 346, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 96, + "end": 196, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 101, + "end": 103, + "ctxt": 0 + }, + "value": "X1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 103, + "end": 106, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 104, + "end": 105, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 104, + "end": 105, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 113, + "end": 195, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 113, + "end": 114, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 113, + "end": 114, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 123, + "end": 179, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 125, + "end": 151, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 125, + "end": 126, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 126, + "end": 150, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 128, + "end": 150, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 134, + "end": 135, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 134, + "end": 135, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 144, + "end": 150, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 152, + "end": 177, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 152, + "end": 153, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 153, + "end": 177, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 155, + "end": 177, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 161, + "end": 162, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 161, + "end": 162, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 171, + "end": 177, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 182, + "end": 183, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 182, + "end": 183, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 190, + "end": 195, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 261, + "end": 346, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 266, + "end": 268, + "ctxt": 0 + }, + "value": "X2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 268, + "end": 271, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 269, + "end": 270, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 269, + "end": 270, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 278, + "end": 345, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 278, + "end": 279, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 278, + "end": 279, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeLiteral", + "span": { + "start": 288, + "end": 324, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 290, + "end": 301, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 290, + "end": 291, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 291, + "end": 300, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 293, + "end": 300, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 299, + "end": 300, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 299, + "end": 300, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 302, + "end": 322, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 302, + "end": 303, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 303, + "end": 322, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsInferType", + "span": { + "start": 305, + "end": 322, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 311, + "end": 312, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 311, + "end": 312, + "ctxt": 0 + }, + "value": "V", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 321, + "end": 322, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 321, + "end": 322, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + }, + "typeParams": null + } + ] + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 327, + "end": 333, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 328, + "end": 329, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 328, + "end": 329, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 328, + "end": 329, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 331, + "end": 332, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeReference", + "span": { + "start": 331, + "end": 332, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 331, + "end": 332, + "ctxt": 0 + }, + "value": "V", + "optional": false + }, + "typeParams": null + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 340, + "end": 345, + "ctxt": 0 + }, + "kind": "never" + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.ts b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.ts new file mode 100644 index 00000000000..754dba2d3fd --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/inferTypesWithExtends2.ts @@ -0,0 +1,11 @@ +// @strict: true + +// infer twice with different constraints (same behavior as class/interface) +type X1 = + T extends { a: infer U extends string, b: infer U extends number } ? U : + never; + +// infer cannot reference type params in same 'extends' clause +type X2 = + T extends { a: infer U, b: infer V extends U } ? [U, V] : + never; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragma.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragma.json deleted file mode 100644 index 4084d871c56..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragma.json +++ /dev/null @@ -1,1223 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 68, - "end": 1402, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 68, - "end": 190, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 76, - "end": 82, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 83, - "end": 190, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 89, - "end": 188, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 99, - "end": 102, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 103, - "end": 188, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 113, - "end": 182, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 140, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 141, - "end": 182, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 156, - "end": 165, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 159, - "end": 165, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 166, - "end": 171, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 155, - "end": 172, - "ctxt": 0 - } - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 191, - "end": 217, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 198, - "end": 217, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 218, - "end": 246, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 234, - "end": 237, - "ctxt": 0 - }, - "value": "jsx", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 225, - "end": 246, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 241, - "end": 245, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 247, - "end": 280, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 263, - "end": 271, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 254, - "end": 280, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 273, - "end": 279, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 275, - "end": 279, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 347, - "end": 386, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 355, - "end": 356, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 355, - "end": 356, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 358, - "end": 366, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 358, - "end": 366, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 373, - "end": 385, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 387, - "end": 403, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 387, - "end": 403, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 387, - "end": 389, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 389, - "end": 400, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 389, - "end": 394, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 394, - "end": 400, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 396, - "end": 399, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 468, - "end": 499, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "value": "jsx", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 486, - "end": 498, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 500, - "end": 518, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 500, - "end": 518, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 500, - "end": 502, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 502, - "end": 515, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 507, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 502, - "end": 508, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 508, - "end": 515, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 510, - "end": 514, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 515, - "end": 518, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 599, - "end": 638, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 607, - "end": 608, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 607, - "end": 608, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 610, - "end": 618, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 610, - "end": 618, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 625, - "end": 637, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 639, - "end": 644, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 639, - "end": 644, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 639, - "end": 641, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 641, - "end": 644, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 723, - "end": 754, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 731, - "end": 734, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 731, - "end": 734, - "ctxt": 0 - }, - "value": "jsx", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 741, - "end": 753, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 755, - "end": 760, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 755, - "end": 760, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 755, - "end": 757, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 757, - "end": 760, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 848, - "end": 884, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 856, - "end": 864, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 856, - "end": 864, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 871, - "end": 883, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 885, - "end": 890, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 885, - "end": 890, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 885, - "end": 887, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 887, - "end": 890, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 976, - "end": 1004, - "ctxt": 0 - }, - "specifiers": [], - "source": { - "type": "StringLiteral", - "span": { - "start": 991, - "end": 1003, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1005, - "end": 1010, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 1005, - "end": 1010, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 1005, - "end": 1007, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 1007, - "end": 1010, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1089, - "end": 1128, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1097, - "end": 1098, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1098, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 1100, - "end": 1108, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1108, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1115, - "end": 1127, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1129, - "end": 1140, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1129, - "end": 1140, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1130, - "end": 1133, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1129, - "end": 1134, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1134, - "end": 1140, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1136, - "end": 1139, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1217, - "end": 1248, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1225, - "end": 1228, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1225, - "end": 1228, - "ctxt": 0 - }, - "value": "jsx", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1235, - "end": 1247, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1249, - "end": 1260, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1249, - "end": 1260, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1250, - "end": 1253, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1249, - "end": 1254, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1254, - "end": 1260, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1256, - "end": 1259, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1321, - "end": 1350, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1329, - "end": 1330, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1329, - "end": 1330, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1337, - "end": 1349, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1360, - "end": 1369, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1351, - "end": 1388, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1372, - "end": 1388, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1374, - "end": 1386, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 1381, - "end": 1385, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1389, - "end": 1402, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1389, - "end": 1402, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1390, - "end": 1399, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1389, - "end": 1402, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.json deleted file mode 100644 index bb82a9d7974..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxAndJsxFragPragmaOverridesCompilerOptions.json +++ /dev/null @@ -1,986 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 104, - "end": 906, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 104, - "end": 226, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 118, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 119, - "end": 226, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 125, - "end": 224, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 139, - "end": 224, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 218, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 176, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 177, - "end": 218, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 192, - "end": 201, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 193, - "end": 201, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 195, - "end": 201, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 202, - "end": 207, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 204, - "end": 207, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 191, - "end": 208, - "ctxt": 0 - } - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 227, - "end": 265, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 243, - "end": 256, - "ctxt": 0 - }, - "value": "createElement", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 234, - "end": 265, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 258, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 266, - "end": 299, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 282, - "end": 290, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 273, - "end": 299, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 292, - "end": 298, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 327, - "end": 353, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 334, - "end": 353, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 346, - "end": 352, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 354, - "end": 383, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 370, - "end": 374, - "ctxt": 0 - }, - "value": "Frag", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 361, - "end": 383, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 378, - "end": 382, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 413, - "end": 439, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 429, - "end": 430, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 420, - "end": 439, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 432, - "end": 438, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 434, - "end": 438, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 466, - "end": 514, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 474, - "end": 487, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 474, - "end": 487, - "ctxt": 0 - }, - "value": "createElement", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 489, - "end": 497, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 489, - "end": 497, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 504, - "end": 513, - "ctxt": 0 - }, - "value": "./react", - "raw": "\"./react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 515, - "end": 533, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 515, - "end": 533, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 515, - "end": 517, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 517, - "end": 530, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 518, - "end": 522, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 517, - "end": 523, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 523, - "end": 530, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 525, - "end": 529, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 530, - "end": 533, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 596, - "end": 629, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "value": "Frag", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 618, - "end": 628, - "ctxt": 0 - }, - "value": "./preact", - "raw": "\"./preact\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 630, - "end": 646, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 630, - "end": 646, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 630, - "end": 632, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 632, - "end": 643, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 633, - "end": 636, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 632, - "end": 637, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 637, - "end": 643, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 639, - "end": 642, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 643, - "end": 646, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 711, - "end": 740, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 719, - "end": 720, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 719, - "end": 720, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 727, - "end": 739, - "ctxt": 0 - }, - "value": "./snabbdom", - "raw": "\"./snabbdom\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 741, - "end": 757, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 741, - "end": 757, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 741, - "end": 743, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 743, - "end": 754, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 744, - "end": 747, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 743, - "end": 748, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 748, - "end": 754, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 750, - "end": 753, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 754, - "end": 757, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 826, - "end": 853, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 834, - "end": 835, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 834, - "end": 835, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 842, - "end": 852, - "ctxt": 0 - }, - "value": "./preact", - "raw": "\"./preact\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 854, - "end": 887, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 862, - "end": 870, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 862, - "end": 870, - "ctxt": 0 - }, - "value": "Fragment", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 877, - "end": 886, - "ctxt": 0 - }, - "value": "./react", - "raw": "\"./react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 888, - "end": 906, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 888, - "end": 906, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 888, - "end": 890, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 890, - "end": 903, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 891, - "end": 895, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 890, - "end": 896, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 896, - "end": 903, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 898, - "end": 902, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 903, - "end": 906, - "ctxt": 0 - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryDeclarationsLocalTypes.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryDeclarationsLocalTypes.json deleted file mode 100644 index 425280f5878..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryDeclarationsLocalTypes.json +++ /dev/null @@ -1,5489 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 2868, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 43, - "end": 524, - "ctxt": 0 - }, - "declaration": { - "type": "TsModuleDeclaration", - "span": { - "start": 50, - "end": 524, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 60, - "end": 63, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 64, - "end": 524, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 70, - "end": 522, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 80, - "end": 83, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 84, - "end": 522, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 94, - "end": 162, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 104, - "end": 121, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 122, - "end": 162, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 137, - "end": 146, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 138, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 140, - "end": 146, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 147, - "end": 151, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 149, - "end": 151, - "ctxt": 0 - }, - "members": [] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 136, - "end": 152, - "ctxt": 0 - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 171, - "end": 304, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 188, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 189, - "end": 304, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 213, - "ctxt": 0 - }, - "value": "__domBrand", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 233, - "end": 294, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 233, - "end": 238, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 238, - "end": 293, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 240, - "end": 293, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 258, - "end": 279, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 258, - "end": 266, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 267, - "end": 278, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 269, - "end": 276, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 269, - "end": 276, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 313, - "end": 394, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 323, - "end": 335, - "ctxt": 0 - }, - "value": "ElementClass", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 344, - "end": 351, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 344, - "end": 351, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 352, - "end": 394, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 366, - "end": 384, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 366, - "end": 372, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 374, - "end": 383, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 376, - "end": 383, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 376, - "end": 383, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 403, - "end": 454, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 413, - "end": 438, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 439, - "end": 454, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 441, - "end": 452, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 441, - "end": 446, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 446, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 448, - "end": 451, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 463, - "end": 516, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 473, - "end": 497, - "ctxt": 0 - }, - "value": "ElementChildrenAttribute", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 498, - "end": 516, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 500, - "end": 514, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 500, - "end": 508, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 508, - "end": 513, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 510, - "end": 513, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 525, - "end": 564, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 541, - "end": 544, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 532, - "end": 564, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 546, - "end": 563, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 548, - "end": 563, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 548, - "end": 551, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 552, - "end": 555, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 556, - "end": 563, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 594, - "end": 1081, - "ctxt": 0 - }, - "declaration": { - "type": "TsModuleDeclaration", - "span": { - "start": 601, - "end": 1081, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 611, - "end": 617, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 618, - "end": 1081, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 624, - "end": 1079, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 634, - "end": 637, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 638, - "end": 1079, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 648, - "end": 716, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 658, - "end": 675, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 676, - "end": 716, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 691, - "end": 700, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 692, - "end": 700, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 694, - "end": 700, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 701, - "end": 705, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 703, - "end": 705, - "ctxt": 0 - }, - "members": [] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 690, - "end": 706, - "ctxt": 0 - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 725, - "end": 861, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 735, - "end": 742, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 743, - "end": 861, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 757, - "end": 777, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 757, - "end": 770, - "ctxt": 0 - }, - "value": "__predomBrand", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 770, - "end": 776, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 772, - "end": 776, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 790, - "end": 851, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 790, - "end": 795, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 795, - "end": 850, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 797, - "end": 850, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 815, - "end": 836, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 815, - "end": 823, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 824, - "end": 835, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 826, - "end": 835, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 826, - "end": 833, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 826, - "end": 833, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 870, - "end": 951, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 880, - "end": 892, - "ctxt": 0 - }, - "value": "ElementClass", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 901, - "end": 908, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 901, - "end": 908, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 909, - "end": 951, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 923, - "end": 941, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 923, - "end": 929, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 931, - "end": 940, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 933, - "end": 940, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 933, - "end": 940, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 960, - "end": 1011, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 970, - "end": 995, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 996, - "end": 1011, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 998, - "end": 1009, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 998, - "end": 1003, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1003, - "end": 1008, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1005, - "end": 1008, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1020, - "end": 1073, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1030, - "end": 1054, - "ctxt": 0 - }, - "value": "ElementChildrenAttribute", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1055, - "end": 1073, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1057, - "end": 1071, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1057, - "end": 1065, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1065, - "end": 1070, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1067, - "end": 1070, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1082, - "end": 1127, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1098, - "end": 1104, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1089, - "end": 1127, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1106, - "end": 1126, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1108, - "end": 1126, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1108, - "end": 1114, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1115, - "end": 1118, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1126, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1175, - "end": 1211, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1184, - "end": 1190, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1184, - "end": 1190, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1198, - "end": 1211, - "ctxt": 0 - }, - "value": "./renderer2", - "hasEscape": false, - "kind": { - "type": "normal", - "containsQuote": true - } - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1213, - "end": 1377, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 1220, - "end": 1377, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1226, - "end": 1376, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1231, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1234, - "end": 1376, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1235, - "end": 1297, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1240, - "end": 1297, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1242, - "end": 1297, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1243, - "end": 1253, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1243, - "end": 1244, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1244, - "end": 1252, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1246, - "end": 1252, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1254, - "end": 1264, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1254, - "end": 1255, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1255, - "end": 1263, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1257, - "end": 1263, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1265, - "end": 1296, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1265, - "end": 1273, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1274, - "end": 1296, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 1276, - "end": 1296, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 1276, - "end": 1294, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1276, - "end": 1282, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1283, - "end": 1286, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1287, - "end": 1294, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 1302, - "end": 1376, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1303, - "end": 1304, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 1302, - "end": 1305, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 1305, - "end": 1314, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1306, - "end": 1313, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1306, - "end": 1311, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1312, - "end": 1313, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1314, - "end": 1317, - "ctxt": 0 - }, - "value": " + ", - "raw": " + " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1317, - "end": 1326, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1318, - "end": 1325, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1318, - "end": 1323, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1324, - "end": 1325, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1326, - "end": 1329, - "ctxt": 0 - }, - "value": " = ", - "raw": " = " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1329, - "end": 1348, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1330, - "end": 1347, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 1330, - "end": 1337, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1330, - "end": 1335, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1336, - "end": 1337, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1340, - "end": 1347, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1340, - "end": 1345, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1346, - "end": 1347, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 1348, - "end": 1372, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1352, - "end": 1371, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1352, - "end": 1362, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1352, - "end": 1356, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1357, - "end": 1362, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1363, - "end": 1371, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1372, - "end": 1376, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1374, - "end": 1375, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1379, - "end": 1716, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1392, - "end": 1399, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1386, - "end": 1716, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1436, - "end": 1457, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1436, - "end": 1449, - "ctxt": 0 - }, - "value": "__predomBrand", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1450, - "end": 1456, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1452, - "end": 1456, - "ctxt": 0 - }, - "kind": "void" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "Constructor", - "span": { - "start": 1462, - "end": 1547, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1462, - "end": 1473, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 1474, - "end": 1543, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 1481, - "end": 1543, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1486, - "end": 1543, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1488, - "end": 1543, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1489, - "end": 1499, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1489, - "end": 1490, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1490, - "end": 1498, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1492, - "end": 1498, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1500, - "end": 1510, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1500, - "end": 1501, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1501, - "end": 1509, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1503, - "end": 1509, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1511, - "end": 1542, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1511, - "end": 1519, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1520, - "end": 1542, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 1522, - "end": 1542, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 1522, - "end": 1540, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1522, - "end": 1528, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1529, - "end": 1532, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1533, - "end": 1540, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1545, - "end": 1547, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1552, - "end": 1714, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1552, - "end": 1558, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1552, - "end": 1714, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1561, - "end": 1714, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1571, - "end": 1708, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 1578, - "end": 1707, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1579, - "end": 1580, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 1578, - "end": 1581, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1581, - "end": 1594, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1594, - "end": 1608, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1595, - "end": 1607, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1595, - "end": 1605, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1595, - "end": 1599, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1600, - "end": 1605, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1606, - "end": 1607, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1608, - "end": 1611, - "ctxt": 0 - }, - "value": " + ", - "raw": " + " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1611, - "end": 1625, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1612, - "end": 1624, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1612, - "end": 1622, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1612, - "end": 1616, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1617, - "end": 1622, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1624, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1625, - "end": 1628, - "ctxt": 0 - }, - "value": " = ", - "raw": " = " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1628, - "end": 1657, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1629, - "end": 1656, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 1629, - "end": 1641, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1629, - "end": 1639, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1629, - "end": 1633, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1634, - "end": 1639, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1640, - "end": 1641, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 1644, - "end": 1656, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1644, - "end": 1654, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1644, - "end": 1648, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1649, - "end": 1654, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1655, - "end": 1656, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1657, - "end": 1670, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 1670, - "end": 1694, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1674, - "end": 1693, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1674, - "end": 1684, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1674, - "end": 1678, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1679, - "end": 1684, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1685, - "end": 1693, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1694, - "end": 1703, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1703, - "end": 1707, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1705, - "end": 1706, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1411, - "end": 1429, - "ctxt": 0 - }, - "expression": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1411, - "end": 1417, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1418, - "end": 1421, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1422, - "end": 1429, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeArguments": null - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 1717, - "end": 1810, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 1724, - "end": 1810, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1730, - "end": 1810, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1730, - "end": 1734, - "ctxt": 0 - }, - "value": "tree", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1737, - "end": 1810, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1738, - "end": 1743, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false - }, - "span": { - "start": 1737, - "end": 1756, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1744, - "end": 1749, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1744, - "end": 1745, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1746, - "end": 1749, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1747, - "end": 1748, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1750, - "end": 1755, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1750, - "end": 1751, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1752, - "end": 1755, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1753, - "end": 1754, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 1756, - "end": 1779, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1757, - "end": 1764, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 1756, - "end": 1779, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1765, - "end": 1770, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1765, - "end": 1766, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1767, - "end": 1770, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1768, - "end": 1769, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1771, - "end": 1776, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1772, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1773, - "end": 1776, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1774, - "end": 1775, - "ctxt": 0 - }, - "value": 4.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 1779, - "end": 1802, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1780, - "end": 1787, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 1779, - "end": 1802, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1788, - "end": 1793, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1788, - "end": 1789, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1790, - "end": 1793, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1791, - "end": 1792, - "ctxt": 0 - }, - "value": 5.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1794, - "end": 1799, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1794, - "end": 1795, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1796, - "end": 1799, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1797, - "end": 1798, - "ctxt": 0 - }, - "value": 6.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1802, - "end": 1810, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1804, - "end": 1809, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false - } - } - }, - "definite": false - } - ] - } - }, - { - "type": "ExportDefaultExpression", - "span": { - "start": 1812, - "end": 1834, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1827, - "end": 1834, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1828, - "end": 1829, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 1827, - "end": 1830, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1830, - "end": 1834, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1832, - "end": 1833, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1876, - "end": 1908, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1885, - "end": 1888, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1885, - "end": 1888, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1896, - "end": 1908, - "ctxt": 0 - }, - "value": "./renderer", - "hasEscape": false, - "kind": { - "type": "normal", - "containsQuote": true - } - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1909, - "end": 1971, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "span": { - "start": 1916, - "end": 1927, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1916, - "end": 1927, - "ctxt": 0 - }, - "value": "prerendered", - "optional": false - } - }, - { - "type": "ImportSpecifier", - "span": { - "start": 1930, - "end": 1935, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1930, - "end": 1935, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 1937, - "end": 1944, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1937, - "end": 1944, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 1946, - "end": 1950, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1946, - "end": 1950, - "ctxt": 0 - }, - "value": "tree", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1957, - "end": 1970, - "ctxt": 0 - }, - "value": "./component", - "hasEscape": false, - "kind": { - "type": "normal", - "containsQuote": true - } - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1972, - "end": 1995, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1976, - "end": 1994, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1980, - "ctxt": 0 - }, - "value": "elem", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 1983, - "end": 1994, - "ctxt": 0 - }, - "value": "prerendered", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1996, - "end": 2011, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1996, - "end": 2010, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1996, - "end": 2000, - "ctxt": 0 - }, - "value": "elem", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "JSXElement", - "span": { - "start": 2003, - "end": 2010, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2004, - "end": 2005, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 2003, - "end": 2006, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2006, - "end": 2010, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2008, - "end": 2009, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2048, - "end": 2195, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2054, - "end": 2194, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2054, - "end": 2060, - "ctxt": 0 - }, - "value": "DOMSFC", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 2063, - "end": 2194, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 2064, - "end": 2123, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2069, - "end": 2123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 2071, - "end": 2123, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 2072, - "end": 2082, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2072, - "end": 2073, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2073, - "end": 2081, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2075, - "end": 2081, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 2083, - "end": 2093, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2083, - "end": 2084, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2084, - "end": 2092, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2086, - "end": 2092, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 2094, - "end": 2122, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2094, - "end": 2102, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2103, - "end": 2122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 2105, - "end": 2122, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 2105, - "end": 2120, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 2105, - "end": 2108, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2109, - "end": 2112, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2113, - "end": 2120, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 2128, - "end": 2194, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2129, - "end": 2130, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 2128, - "end": 2131, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 2131, - "end": 2140, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2132, - "end": 2139, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2132, - "end": 2137, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2138, - "end": 2139, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 2140, - "end": 2143, - "ctxt": 0 - }, - "value": " + ", - "raw": " + " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2143, - "end": 2152, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2144, - "end": 2151, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2144, - "end": 2149, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2150, - "end": 2151, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 2152, - "end": 2155, - "ctxt": 0 - }, - "value": " = ", - "raw": " = " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2155, - "end": 2174, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 2156, - "end": 2173, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 2156, - "end": 2163, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2156, - "end": 2161, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2162, - "end": 2163, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 2166, - "end": 2173, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2166, - "end": 2171, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2172, - "end": 2173, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2174, - "end": 2190, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2175, - "end": 2189, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2175, - "end": 2180, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2181, - "end": 2189, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2190, - "end": 2194, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2192, - "end": 2193, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2203, - "end": 2211, - "ctxt": 0 - }, - "value": "DOMClass", - "optional": false - }, - "declare": false, - "span": { - "start": 2197, - "end": 2484, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2245, - "end": 2263, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2245, - "end": 2255, - "ctxt": 0 - }, - "value": "__domBrand", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2256, - "end": 2262, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2258, - "end": 2262, - "ctxt": 0 - }, - "kind": "void" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "Constructor", - "span": { - "start": 2268, - "end": 2350, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2268, - "end": 2279, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 2280, - "end": 2346, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 2287, - "end": 2346, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2292, - "end": 2346, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 2294, - "end": 2346, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 2295, - "end": 2305, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2295, - "end": 2296, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2296, - "end": 2304, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2298, - "end": 2304, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 2306, - "end": 2316, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2306, - "end": 2307, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2307, - "end": 2315, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2309, - "end": 2315, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 2317, - "end": 2345, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 2317, - "end": 2325, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2326, - "end": 2345, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 2328, - "end": 2345, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 2328, - "end": 2343, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 2328, - "end": 2331, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2332, - "end": 2335, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2336, - "end": 2343, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 2348, - "end": 2350, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 2355, - "end": 2482, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2355, - "end": 2361, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2355, - "end": 2482, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2364, - "end": 2482, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2374, - "end": 2476, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 2381, - "end": 2475, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2382, - "end": 2383, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 2381, - "end": 2384, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 2384, - "end": 2398, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2385, - "end": 2397, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2385, - "end": 2395, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2385, - "end": 2389, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2390, - "end": 2395, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2396, - "end": 2397, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 2398, - "end": 2401, - "ctxt": 0 - }, - "value": " + ", - "raw": " + " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2401, - "end": 2415, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2402, - "end": 2414, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2402, - "end": 2412, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2402, - "end": 2406, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2407, - "end": 2412, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2413, - "end": 2414, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 2415, - "end": 2418, - "ctxt": 0 - }, - "value": " = ", - "raw": " = " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2418, - "end": 2447, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 2419, - "end": 2446, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 2419, - "end": 2431, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2419, - "end": 2429, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2419, - "end": 2423, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2424, - "end": 2429, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2430, - "end": 2431, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 2434, - "end": 2446, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2434, - "end": 2444, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2434, - "end": 2438, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2439, - "end": 2444, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2445, - "end": 2446, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 2447, - "end": 2471, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2451, - "end": 2470, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2451, - "end": 2461, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 2451, - "end": 2455, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2456, - "end": 2461, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2462, - "end": 2470, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2471, - "end": 2475, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2473, - "end": 2474, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 2223, - "end": 2238, - "ctxt": 0 - }, - "expression": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 2223, - "end": 2226, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2227, - "end": 2230, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2231, - "end": 2238, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeArguments": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2530, - "end": 2621, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2536, - "end": 2621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2536, - "end": 2541, - "ctxt": 0 - }, - "value": "_tree", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2544, - "end": 2621, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2545, - "end": 2551, - "ctxt": 0 - }, - "value": "DOMSFC", - "optional": false - }, - "span": { - "start": 2544, - "end": 2564, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2552, - "end": 2557, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2552, - "end": 2553, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2554, - "end": 2557, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2555, - "end": 2556, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2558, - "end": 2563, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2558, - "end": 2559, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2560, - "end": 2563, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2561, - "end": 2562, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 2564, - "end": 2588, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2565, - "end": 2573, - "ctxt": 0 - }, - "value": "DOMClass", - "optional": false - }, - "span": { - "start": 2564, - "end": 2588, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2574, - "end": 2579, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2574, - "end": 2575, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2576, - "end": 2579, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2577, - "end": 2578, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2580, - "end": 2585, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2580, - "end": 2581, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2582, - "end": 2585, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2583, - "end": 2584, - "ctxt": 0 - }, - "value": 4.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 2588, - "end": 2612, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2589, - "end": 2597, - "ctxt": 0 - }, - "value": "DOMClass", - "optional": false - }, - "span": { - "start": 2588, - "end": 2612, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2598, - "end": 2603, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2598, - "end": 2599, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2600, - "end": 2603, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2601, - "end": 2602, - "ctxt": 0 - }, - "value": 5.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2604, - "end": 2609, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2604, - "end": 2605, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2606, - "end": 2609, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2607, - "end": 2608, - "ctxt": 0 - }, - "value": 6.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2612, - "end": 2621, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2614, - "end": 2620, - "ctxt": 0 - }, - "value": "DOMSFC", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2655, - "end": 2748, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2661, - "end": 2748, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2661, - "end": 2672, - "ctxt": 0 - }, - "value": "_brokenTree", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2675, - "end": 2748, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2676, - "end": 2681, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false - }, - "span": { - "start": 2675, - "end": 2694, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2682, - "end": 2687, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2682, - "end": 2683, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2684, - "end": 2687, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2685, - "end": 2686, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2688, - "end": 2693, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2688, - "end": 2689, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2690, - "end": 2693, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2691, - "end": 2692, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 2694, - "end": 2717, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2695, - "end": 2702, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 2694, - "end": 2717, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2703, - "end": 2708, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2703, - "end": 2704, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2705, - "end": 2708, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2706, - "end": 2707, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2709, - "end": 2714, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2709, - "end": 2710, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2711, - "end": 2714, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2712, - "end": 2713, - "ctxt": 0 - }, - "value": 4.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 2717, - "end": 2740, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2718, - "end": 2725, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 2717, - "end": 2740, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2726, - "end": 2731, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2726, - "end": 2727, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2728, - "end": 2731, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2729, - "end": 2730, - "ctxt": 0 - }, - "value": 5.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2732, - "end": 2737, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2732, - "end": 2733, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2734, - "end": 2737, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2735, - "end": 2736, - "ctxt": 0 - }, - "value": 6.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2740, - "end": 2748, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2742, - "end": 2747, - "ctxt": 0 - }, - "value": "MySFC", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2806, - "end": 2868, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2812, - "end": 2868, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2812, - "end": 2824, - "ctxt": 0 - }, - "value": "_brokenTree2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2827, - "end": 2868, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2828, - "end": 2834, - "ctxt": 0 - }, - "value": "DOMSFC", - "optional": false - }, - "span": { - "start": 2827, - "end": 2847, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2835, - "end": 2840, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2835, - "end": 2836, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2837, - "end": 2840, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2838, - "end": 2839, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2841, - "end": 2846, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2841, - "end": 2842, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2843, - "end": 2846, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2844, - "end": 2845, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 2847, - "end": 2853, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2848, - "end": 2852, - "ctxt": 0 - }, - "value": "tree", - "optional": false - } - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 2853, - "end": 2859, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2854, - "end": 2858, - "ctxt": 0 - }, - "value": "tree", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 2859, - "end": 2868, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2861, - "end": 2867, - "ctxt": 0 - }, - "value": "DOMSFC", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryLocalTypeGlobalFallback.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryLocalTypeGlobalFallback.json deleted file mode 100644 index 9af8feda13c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryLocalTypeGlobalFallback.json +++ /dev/null @@ -1,1402 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 1161, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 410, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 410, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 64, - "end": 408, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 78, - "end": 408, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 88, - "end": 156, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 98, - "end": 115, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 116, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 131, - "end": 140, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 132, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 141, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 143, - "end": 145, - "ctxt": 0 - }, - "members": [] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 165, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 182, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 183, - "end": 280, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 197, - "end": 214, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 207, - "ctxt": 0 - }, - "value": "__domBrand", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 207, - "end": 213, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 209, - "end": 213, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 227, - "end": 247, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 227, - "end": 235, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 246, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 237, - "end": 246, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 237, - "end": 244, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 237, - "end": 244, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 260, - "end": 270, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 260, - "end": 265, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 289, - "end": 340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 299, - "end": 324, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 325, - "end": 340, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 327, - "end": 338, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 327, - "end": 332, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 332, - "end": 337, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 334, - "end": 337, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 349, - "end": 402, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 359, - "end": 383, - "ctxt": 0 - }, - "value": "ElementChildrenAttribute", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 384, - "end": 402, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 386, - "end": 400, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 386, - "end": 394, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 394, - "end": 399, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 396, - "end": 399, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 411, - "end": 446, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 418, - "end": 446, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 432, - "end": 445, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 434, - "end": 445, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 434, - "end": 437, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 438, - "end": 445, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 476, - "end": 855, - "ctxt": 0 - }, - "declaration": { - "type": "TsModuleDeclaration", - "span": { - "start": 483, - "end": 855, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 493, - "end": 499, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 500, - "end": 855, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 506, - "end": 853, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 516, - "end": 519, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 520, - "end": 853, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 530, - "end": 598, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 540, - "end": 557, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 558, - "end": 598, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 573, - "end": 582, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 574, - "end": 582, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 576, - "end": 582, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 583, - "end": 587, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 585, - "end": 587, - "ctxt": 0 - }, - "members": [] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 572, - "end": 588, - "ctxt": 0 - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 607, - "end": 725, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 617, - "end": 624, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 625, - "end": 725, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 639, - "end": 659, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 639, - "end": 652, - "ctxt": 0 - }, - "value": "__predomBrand", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 652, - "end": 658, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 654, - "end": 658, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 672, - "end": 692, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 672, - "end": 680, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 680, - "end": 691, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 682, - "end": 691, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 682, - "end": 689, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 682, - "end": 689, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 705, - "end": 715, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 705, - "end": 710, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 710, - "end": 714, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 712, - "end": 714, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 734, - "end": 785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 744, - "end": 769, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 770, - "end": 785, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 772, - "end": 783, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 772, - "end": 777, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 777, - "end": 782, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 779, - "end": 782, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 794, - "end": 847, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 804, - "end": 828, - "ctxt": 0 - }, - "value": "ElementChildrenAttribute", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 829, - "end": 847, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 831, - "end": 845, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 831, - "end": 839, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 839, - "end": 844, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 841, - "end": 844, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 856, - "end": 901, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 872, - "end": 878, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 863, - "end": 901, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 880, - "end": 900, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 882, - "end": 900, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 882, - "end": 888, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 889, - "end": 892, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 893, - "end": 900, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 949, - "end": 985, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 958, - "end": 964, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 958, - "end": 964, - "ctxt": 0 - }, - "value": "predom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 972, - "end": 985, - "ctxt": 0 - }, - "value": "./renderer2", - "raw": "\"./renderer2\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDefaultExpression", - "span": { - "start": 986, - "end": 1008, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1001, - "end": 1008, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1002, - "end": 1003, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 1001, - "end": 1004, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1004, - "end": 1008, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1006, - "end": 1007, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1050, - "end": 1082, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 1059, - "end": 1062, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1059, - "end": 1062, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1070, - "end": 1082, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 1083, - "end": 1121, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "span": { - "start": 1090, - "end": 1101, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 1090, - "end": 1101, - "ctxt": 0 - }, - "value": "prerendered", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 1107, - "end": 1120, - "ctxt": 0 - }, - "value": "./component", - "raw": "\"./component\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1122, - "end": 1145, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1126, - "end": 1144, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1126, - "end": 1130, - "ctxt": 0 - }, - "value": "elem", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 1133, - "end": 1144, - "ctxt": 0 - }, - "value": "prerendered", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1146, - "end": 1161, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1146, - "end": 1160, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1146, - "end": 1150, - "ctxt": 0 - }, - "value": "elem", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "JSXElement", - "span": { - "start": 1153, - "end": 1160, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1154, - "end": 1155, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 1153, - "end": 1156, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1156, - "end": 1160, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1158, - "end": 1159, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryOverridesCompilerOption.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryOverridesCompilerOption.json deleted file mode 100644 index c63fd7eeeec..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryOverridesCompilerOption.json +++ /dev/null @@ -1,446 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 61, - "end": 378, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 61, - "end": 183, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 69, - "end": 75, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 183, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 82, - "end": 181, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 92, - "end": 95, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 96, - "end": 181, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 106, - "end": 175, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 116, - "end": 133, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 134, - "end": 175, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 149, - "end": 158, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 150, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 152, - "end": 158, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 159, - "end": 164, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 161, - "end": 164, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 148, - "end": 165, - "ctxt": 0 - } - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 184, - "end": 212, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 191, - "end": 212, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 205, - "end": 211, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 213, - "end": 233, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ExportSpecifier", - "span": { - "start": 222, - "end": 230, - "ctxt": 0 - }, - "orig": { - "type": "Identifier", - "span": { - "start": 222, - "end": 225, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "exported": { - "type": "Identifier", - "span": { - "start": 229, - "end": 230, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "isTypeOnly": false - } - ], - "source": null, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 275, - "end": 306, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 293, - "end": 305, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 307, - "end": 314, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 307, - "end": 314, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 310, - "end": 314, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 339, - "end": 370, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 348, - "end": 349, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 348, - "end": 349, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 357, - "end": 369, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 371, - "end": 378, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 371, - "end": 378, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 372, - "end": 373, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 371, - "end": 374, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 374, - "end": 378, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryWithFragmentIsError.json b/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryWithFragmentIsError.json deleted file mode 100644 index c6791c85989..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/inlineJsxFactoryWithFragmentIsError.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 427, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 165, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 165, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 64, - "end": 163, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 78, - "end": 163, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 88, - "end": 157, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 98, - "end": 115, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 116, - "end": 157, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 131, - "end": 140, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 132, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 141, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 130, - "end": 147, - "ctxt": 0 - } - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 166, - "end": 194, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 182, - "end": 185, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 173, - "end": 194, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 189, - "end": 193, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 195, - "end": 233, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 211, - "end": 224, - "ctxt": 0 - }, - "value": "createElement", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 202, - "end": 233, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 226, - "end": 232, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 228, - "end": 232, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 291, - "end": 327, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 298, - "end": 308, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 303, - "end": 308, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 314, - "end": 326, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 328, - "end": 340, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 328, - "end": 340, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 328, - "end": 330, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 330, - "end": 337, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 333, - "end": 337, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 335, - "end": 336, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 337, - "end": 340, - "ctxt": 0 - } - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 381, - "end": 414, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": "dom", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 401, - "end": 413, - "ctxt": 0 - }, - "value": "./renderer", - "raw": "\"./renderer\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 415, - "end": 427, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 415, - "end": 427, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 415, - "end": 417, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 417, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 419, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "span": { - "start": 417, - "end": 420, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 420, - "end": 424, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 423, - "ctxt": 0 - }, - "value": "h", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 424, - "end": 427, - "ctxt": 0 - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/intersectionAndUnionTypes.ts b/crates/swc_ecma_parser/tests/tsc/intersectionAndUnionTypes.ts index 8546e8e535d..d0ae6f2c37a 100644 --- a/crates/swc_ecma_parser/tests/tsc/intersectionAndUnionTypes.ts +++ b/crates/swc_ecma_parser/tests/tsc/intersectionAndUnionTypes.ts @@ -1,4 +1,4 @@ -interface A { a: string } +interface A { a: string } interface B { b: string } interface C { c: string } interface D { d: string } diff --git a/crates/swc_ecma_parser/tests/tsc/intersectionTypeEquivalence.ts b/crates/swc_ecma_parser/tests/tsc/intersectionTypeEquivalence.ts index 6e8b449baff..b757b2c7f81 100644 --- a/crates/swc_ecma_parser/tests/tsc/intersectionTypeEquivalence.ts +++ b/crates/swc_ecma_parser/tests/tsc/intersectionTypeEquivalence.ts @@ -1,4 +1,4 @@ -interface A { a: string } +interface A { a: string } interface B { b: string } interface C { c: string } diff --git a/crates/swc_ecma_parser/tests/tsc/intersectionTypeMembers.ts b/crates/swc_ecma_parser/tests/tsc/intersectionTypeMembers.ts index 8eb7d9f4840..3bace3eec8e 100644 --- a/crates/swc_ecma_parser/tests/tsc/intersectionTypeMembers.ts +++ b/crates/swc_ecma_parser/tests/tsc/intersectionTypeMembers.ts @@ -1,4 +1,4 @@ -// An intersection type has those members that are present in any of its constituent types, +// An intersection type has those members that are present in any of its constituent types, // with types that are intersections of the respective members in the constituent types interface A { a: string } diff --git a/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.json b/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.json new file mode 100644 index 00000000000..36347bc6150 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.json @@ -0,0 +1,9453 @@ +{ + "type": "Script", + "span": { + "start": 64, + "end": 4037, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 81, + "end": 87, + "ctxt": 0 + }, + "value": "callIt", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 91, + "end": 158, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 91, + "end": 158, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 94, + "end": 158, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 96, + "end": 158, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 102, + "end": 128, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 102, + "end": 109, + "ctxt": 0 + }, + "value": "produce", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 109, + "end": 127, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 111, + "end": 127, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 112, + "end": 121, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 113, + "end": 121, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 115, + "end": 121, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 123, + "end": 127, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 126, + "end": 127, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 126, + "end": 127, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 133, + "end": 156, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 133, + "end": 140, + "ctxt": 0 + }, + "value": "consume", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 140, + "end": 156, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 142, + "end": 156, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 143, + "end": 147, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 144, + "end": 147, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 146, + "end": 147, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 149, + "end": 156, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 152, + "end": 156, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 64, + "end": 166, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 87, + "end": 90, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 88, + "end": 89, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 88, + "end": 89, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 159, + "end": 165, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 161, + "end": 165, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 168, + "end": 232, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 168, + "end": 231, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 168, + "end": 174, + "ctxt": 0 + }, + "value": "callIt", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 175, + "end": 230, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 181, + "end": 188, + "ctxt": 0 + }, + "value": "produce", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 190, + "end": 197, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "NumericLiteral", + "span": { + "start": 196, + "end": 197, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 203, + "end": 210, + "ctxt": 0 + }, + "value": "consume", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 212, + "end": 228, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 212, + "end": 213, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 217, + "end": 228, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 217, + "end": 226, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 217, + "end": 218, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 219, + "end": 226, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 234, + "end": 299, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 234, + "end": 298, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 234, + "end": 240, + "ctxt": 0 + }, + "value": "callIt", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 241, + "end": 297, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 247, + "end": 254, + "ctxt": 0 + }, + "value": "produce", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 256, + "end": 263, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 256, + "end": 258, + "ctxt": 0 + }, + "value": "_a", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 262, + "end": 263, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 269, + "end": 276, + "ctxt": 0 + }, + "value": "consume", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 278, + "end": 294, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 278, + "end": 279, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 283, + "end": 294, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 283, + "end": 292, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 283, + "end": 284, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 285, + "end": 292, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 301, + "end": 384, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 301, + "end": 383, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 301, + "end": 307, + "ctxt": 0 + }, + "value": "callIt", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 308, + "end": 382, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 314, + "end": 321, + "ctxt": 0 + }, + "value": "produce", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 314, + "end": 349, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 324, + "end": 349, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 334, + "end": 343, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 355, + "end": 362, + "ctxt": 0 + }, + "value": "consume", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 364, + "end": 380, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 364, + "end": 365, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 369, + "end": 380, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 369, + "end": 378, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 369, + "end": 370, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 371, + "end": 378, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 403, + "end": 410, + "ctxt": 0 + }, + "value": "callItT", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 414, + "end": 453, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 414, + "end": 453, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 417, + "end": 453, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTupleType", + "span": { + "start": 419, + "end": 453, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 420, + "end": 436, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsFunctionType", + "span": { + "start": 420, + "end": 436, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 421, + "end": 430, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 422, + "end": 430, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 424, + "end": 430, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 432, + "end": 436, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 435, + "end": 436, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 435, + "end": 436, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 438, + "end": 452, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsFunctionType", + "span": { + "start": 438, + "end": 452, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 439, + "end": 443, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 440, + "end": 443, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 442, + "end": 443, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 442, + "end": 443, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 445, + "end": 452, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 448, + "end": 452, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 386, + "end": 461, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 410, + "end": 413, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 411, + "end": 412, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 411, + "end": 412, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 454, + "end": 460, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 456, + "end": 460, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 463, + "end": 500, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 463, + "end": 499, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 463, + "end": 470, + "ctxt": 0 + }, + "value": "callItT", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrayExpression", + "span": { + "start": 471, + "end": 498, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 472, + "end": 479, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "NumericLiteral", + "span": { + "start": 478, + "end": 479, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 481, + "end": 497, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 481, + "end": 482, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 486, + "end": 497, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 486, + "end": 495, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 486, + "end": 487, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 488, + "end": 495, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 501, + "end": 538, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 501, + "end": 537, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 501, + "end": 508, + "ctxt": 0 + }, + "value": "callItT", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrayExpression", + "span": { + "start": 509, + "end": 536, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 510, + "end": 517, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 510, + "end": 512, + "ctxt": 0 + }, + "value": "_a", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 516, + "end": 517, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 519, + "end": 535, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 519, + "end": 520, + "ctxt": 0 + }, + "value": "n", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 524, + "end": 535, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 524, + "end": 533, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 524, + "end": 525, + "ctxt": 0 + }, + "value": "n", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 526, + "end": 533, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 562, + "end": 684, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 572, + "end": 583, + "ctxt": 0 + }, + "value": "MyInterface", + "optional": false + }, + "declare": false, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 583, + "end": 586, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 584, + "end": 585, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 584, + "end": 585, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 587, + "end": 684, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 593, + "end": 635, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 593, + "end": 608, + "ctxt": 0 + }, + "value": "retrieveGeneric", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 608, + "end": 634, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 610, + "end": 634, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 611, + "end": 628, + "ctxt": 0 + }, + "value": "parameter", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 620, + "end": 628, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 622, + "end": 628, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 630, + "end": 634, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 633, + "end": 634, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 633, + "end": 634, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 640, + "end": 682, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 640, + "end": 658, + "ctxt": 0 + }, + "value": "operateWithGeneric", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 658, + "end": 682, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 660, + "end": 682, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 661, + "end": 671, + "ctxt": 0 + }, + "value": "generic", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 668, + "end": 671, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 670, + "end": 671, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 670, + "end": 671, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 673, + "end": 682, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 676, + "end": 682, + "ctxt": 0 + }, + "kind": "string" + } + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 686, + "end": 746, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 692, + "end": 745, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 692, + "end": 703, + "ctxt": 0 + }, + "value": "inferTypeFn", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 706, + "end": 745, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 710, + "end": 733, + "ctxt": 0 + }, + "value": "generic", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 717, + "end": 733, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 719, + "end": 733, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 719, + "end": 730, + "ctxt": 0 + }, + "value": "MyInterface", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 730, + "end": 733, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 731, + "end": 732, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 731, + "end": 732, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 738, + "end": 745, + "ctxt": 0 + }, + "value": "generic", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 706, + "end": 709, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 707, + "end": 708, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 707, + "end": 708, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 748, + "end": 873, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 754, + "end": 872, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 754, + "end": 763, + "ctxt": 0 + }, + "value": "myGeneric", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 766, + "end": 872, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 766, + "end": 777, + "ctxt": 0 + }, + "value": "inferTypeFn", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 778, + "end": 871, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 784, + "end": 799, + "ctxt": 0 + }, + "value": "retrieveGeneric", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 801, + "end": 815, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 801, + "end": 810, + "ctxt": 0 + }, + "value": "parameter", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 814, + "end": 815, + "ctxt": 0 + }, + "value": 5.0, + "raw": "5" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 821, + "end": 839, + "ctxt": 0 + }, + "value": "operateWithGeneric", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 841, + "end": 869, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 841, + "end": 848, + "ctxt": 0 + }, + "value": "generic", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 852, + "end": 869, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 852, + "end": 867, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 852, + "end": 859, + "ctxt": 0 + }, + "value": "generic", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 860, + "end": 867, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 901, + "end": 905, + "ctxt": 0 + }, + "value": "make", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 909, + "end": 953, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 909, + "end": 953, + "ctxt": 0 + }, + "value": "o", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 910, + "end": 953, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 912, + "end": 953, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 914, + "end": 927, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 914, + "end": 923, + "ctxt": 0 + }, + "value": "mutations", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 923, + "end": 926, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 925, + "end": 926, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 925, + "end": 926, + "ctxt": 0 + }, + "value": "M", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 929, + "end": 951, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 929, + "end": 935, + "ctxt": 0 + }, + "value": "action", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 935, + "end": 951, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 937, + "end": 951, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 938, + "end": 942, + "ctxt": 0 + }, + "value": "m", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 939, + "end": 942, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 941, + "end": 942, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 941, + "end": 942, + "ctxt": 0 + }, + "value": "M", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 944, + "end": 951, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 947, + "end": 951, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 892, + "end": 958, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 955, + "end": 958, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 905, + "end": 908, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 906, + "end": 907, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 906, + "end": 907, + "ctxt": 0 + }, + "value": "M", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 960, + "end": 1039, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 960, + "end": 1038, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 960, + "end": 964, + "ctxt": 0 + }, + "value": "make", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 965, + "end": 1037, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 970, + "end": 979, + "ctxt": 0 + }, + "value": "mutations", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 981, + "end": 1004, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 990, + "end": 993, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 990, + "end": 999, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 996, + "end": 999, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1009, + "end": 1015, + "ctxt": 0 + }, + "value": "action", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1017, + "end": 1035, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1018, + "end": 1019, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 1024, + "end": 1035, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1026, + "end": 1033, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1026, + "end": 1033, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1026, + "end": 1031, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1026, + "end": 1027, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1028, + "end": 1031, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1080, + "end": 1083, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1087, + "end": 1123, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1087, + "end": 1123, + "ctxt": 0 + }, + "value": "options", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1094, + "end": 1123, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1096, + "end": 1123, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1098, + "end": 1103, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1098, + "end": 1099, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1099, + "end": 1102, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1101, + "end": 1102, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1101, + "end": 1102, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 1104, + "end": 1121, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1104, + "end": 1105, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1105, + "end": 1121, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 1107, + "end": 1121, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1108, + "end": 1112, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1109, + "end": 1112, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1111, + "end": 1112, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1111, + "end": 1112, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1114, + "end": 1121, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1117, + "end": 1121, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1063, + "end": 1131, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1083, + "end": 1086, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1084, + "end": 1085, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1084, + "end": 1085, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 1124, + "end": 1130, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1126, + "end": 1130, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1133, + "end": 1183, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1133, + "end": 1182, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1133, + "end": 1136, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1137, + "end": 1181, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1143, + "end": 1144, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1146, + "end": 1165, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 1152, + "end": 1165, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1154, + "end": 1163, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 1161, + "end": 1163, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1171, + "end": 1172, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1173, + "end": 1174, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1173, + "end": 1174, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 1171, + "end": 1178, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1176, + "end": 1178, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1185, + "end": 1241, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1185, + "end": 1240, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1185, + "end": 1188, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1189, + "end": 1239, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1195, + "end": 1196, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "FunctionExpression", + "identifier": null, + "params": [], + "decorators": [], + "span": { + "start": 1198, + "end": 1223, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1210, + "end": 1223, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1212, + "end": 1221, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 1219, + "end": 1221, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1229, + "end": 1230, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1231, + "end": 1232, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1231, + "end": 1232, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 1229, + "end": 1236, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1234, + "end": 1236, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1243, + "end": 1288, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1243, + "end": 1287, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1243, + "end": 1246, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1247, + "end": 1286, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1253, + "end": 1254, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 1253, + "end": 1270, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1257, + "end": 1270, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1259, + "end": 1268, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 1266, + "end": 1268, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1276, + "end": 1277, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1278, + "end": 1279, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1278, + "end": 1279, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 1276, + "end": 1283, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1281, + "end": 1283, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1312, + "end": 1388, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1317, + "end": 1322, + "ctxt": 0 + }, + "value": "Chain", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1322, + "end": 1330, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1323, + "end": 1325, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1323, + "end": 1325, + "ctxt": 0 + }, + "value": "R1", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 1327, + "end": 1329, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1327, + "end": 1329, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1333, + "end": 1387, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 1339, + "end": 1347, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1339, + "end": 1340, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "params": [], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 1342, + "end": 1346, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1344, + "end": 1346, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1344, + "end": 1346, + "ctxt": 0 + }, + "value": "R1", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsMethodSignature", + "span": { + "start": 1352, + "end": 1365, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1352, + "end": 1353, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1354, + "end": 1359, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1355, + "end": 1359, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1357, + "end": 1359, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1357, + "end": 1359, + "ctxt": 0 + }, + "value": "R1", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 1360, + "end": 1364, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1362, + "end": 1364, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1362, + "end": 1364, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsMethodSignature", + "span": { + "start": 1370, + "end": 1385, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1370, + "end": 1371, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1372, + "end": 1377, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1373, + "end": 1377, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1375, + "end": 1377, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1375, + "end": 1377, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 1378, + "end": 1384, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1380, + "end": 1384, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1399, + "end": 1403, + "ctxt": 0 + }, + "value": "test", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1412, + "end": 1430, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1412, + "end": 1430, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1415, + "end": 1430, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1417, + "end": 1430, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1417, + "end": 1422, + "ctxt": 0 + }, + "value": "Chain", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1422, + "end": 1430, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1423, + "end": 1425, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1423, + "end": 1425, + "ctxt": 0 + }, + "value": "R1", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 1427, + "end": 1429, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1427, + "end": 1429, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1390, + "end": 1434, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1432, + "end": 1434, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1403, + "end": 1411, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1404, + "end": 1406, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1404, + "end": 1406, + "ctxt": 0 + }, + "value": "R1", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 1408, + "end": 1410, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1408, + "end": 1410, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1436, + "end": 1532, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1436, + "end": 1531, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1436, + "end": 1440, + "ctxt": 0 + }, + "value": "test", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1441, + "end": 1530, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1447, + "end": 1448, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1450, + "end": 1457, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "NumericLiteral", + "span": { + "start": 1456, + "end": 1457, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1463, + "end": 1464, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1466, + "end": 1476, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1467, + "end": 1468, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "StringLiteral", + "span": { + "start": 1473, + "end": 1476, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1482, + "end": 1483, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1485, + "end": 1528, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1486, + "end": 1487, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 1492, + "end": 1528, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1502, + "end": 1522, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1508, + "end": 1521, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1508, + "end": 1509, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1509, + "end": 1517, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1511, + "end": 1517, + "ctxt": 0 + }, + "kind": "string" + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 1520, + "end": 1521, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1534, + "end": 1628, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1534, + "end": 1627, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1534, + "end": 1538, + "ctxt": 0 + }, + "value": "test", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 1539, + "end": 1626, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1545, + "end": 1546, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1548, + "end": 1555, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "NumericLiteral", + "span": { + "start": 1554, + "end": 1555, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1561, + "end": 1562, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1564, + "end": 1572, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1565, + "end": 1566, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 1571, + "end": 1572, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 1578, + "end": 1579, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1581, + "end": 1624, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1582, + "end": 1583, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 1588, + "end": 1624, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1598, + "end": 1618, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1604, + "end": 1617, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1604, + "end": 1605, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1605, + "end": 1613, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1607, + "end": 1613, + "ctxt": 0 + }, + "kind": "number" + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 1616, + "end": 1617, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1658, + "end": 1665, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "declare": false, + "span": { + "start": 1652, + "end": 1700, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 1681, + "end": 1698, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1688, + "end": 1693, + "ctxt": 0 + }, + "value": "value", + "optional": true + }, + "value": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1694, + "end": 1697, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1696, + "end": 1697, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1696, + "end": 1697, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "isStatic": false, + "decorators": [], + "accessibility": "public", + "isAbstract": false, + "isOptional": true, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1665, + "end": 1674, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1666, + "end": 1673, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1666, + "end": 1667, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": { + "type": "TsKeywordType", + "span": { + "start": 1670, + "end": 1673, + "ctxt": 0 + }, + "kind": "any" + } + } + ] + }, + "superTypeParams": null, + "implements": [] + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1702, + "end": 1744, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1707, + "end": 1717, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1720, + "end": 1743, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1720, + "end": 1726, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1726, + "end": 1743, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1727, + "end": 1733, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 1735, + "end": 1742, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1735, + "end": 1742, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1745, + "end": 1848, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1750, + "end": 1756, + "ctxt": 0 + }, + "value": "Unwrap", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1756, + "end": 1778, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1757, + "end": 1777, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1757, + "end": 1758, + "ctxt": 0 + }, + "value": "D", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 1767, + "end": 1777, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1767, + "end": 1777, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 1781, + "end": 1847, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1788, + "end": 1800, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1788, + "end": 1789, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 1793, + "end": 1800, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1799, + "end": 1800, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1799, + "end": 1800, + "ctxt": 0 + }, + "value": "D", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1803, + "end": 1844, + "ctxt": 0 + }, + "checkType": { + "type": "TsIndexedAccessType", + "span": { + "start": 1803, + "end": 1807, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 1803, + "end": 1804, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1803, + "end": 1804, + "ctxt": 0 + }, + "value": "D", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 1805, + "end": 1806, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1805, + "end": 1806, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "extendsType": { + "type": "TsTypeReference", + "span": { + "start": 1816, + "end": 1832, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1816, + "end": 1823, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1823, + "end": 1832, + "ctxt": 0 + }, + "params": [ + { + "type": "TsInferType", + "span": { + "start": 1824, + "end": 1831, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1830, + "end": 1831, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1830, + "end": 1831, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1835, + "end": 1836, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1835, + "end": 1836, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1839, + "end": 1844, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1850, + "end": 2006, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1855, + "end": 1871, + "ctxt": 0 + }, + "value": "MappingComponent", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1871, + "end": 1915, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1872, + "end": 1892, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1872, + "end": 1873, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 1882, + "end": 1892, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1882, + "end": 1892, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 1894, + "end": 1914, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1894, + "end": 1895, + "ctxt": 0 + }, + "value": "O", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 1904, + "end": 1914, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1904, + "end": 1914, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1918, + "end": 2005, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 1924, + "end": 1959, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1924, + "end": 1929, + "ctxt": 0 + }, + "value": "setup", + "optional": false + }, + "computed": false, + "optional": false, + "params": [], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 1931, + "end": 1958, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 1933, + "end": 1958, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 1935, + "end": 1945, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1935, + "end": 1941, + "ctxt": 0 + }, + "value": "inputs", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1941, + "end": 1944, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1943, + "end": 1944, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1943, + "end": 1944, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 1946, + "end": 1956, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1946, + "end": 1953, + "ctxt": 0 + }, + "value": "outputs", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1953, + "end": 1956, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1955, + "end": 1956, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1955, + "end": 1956, + "ctxt": 0 + }, + "value": "O", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 1964, + "end": 2003, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 1964, + "end": 1967, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1968, + "end": 2002, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 1970, + "end": 2002, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1971, + "end": 1988, + "ctxt": 0 + }, + "value": "inputs", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1977, + "end": 1988, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1979, + "end": 1988, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1979, + "end": 1985, + "ctxt": 0 + }, + "value": "Unwrap", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1985, + "end": 1988, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1986, + "end": 1987, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1986, + "end": 1987, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1990, + "end": 2002, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1993, + "end": 2002, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1993, + "end": 1999, + "ctxt": 0 + }, + "value": "Unwrap", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1999, + "end": 2002, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 2000, + "end": 2001, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2000, + "end": 2001, + "ctxt": 0 + }, + "value": "O", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2025, + "end": 2047, + "ctxt": 0 + }, + "value": "createMappingComponent", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2092, + "end": 2119, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2092, + "end": 2119, + "ctxt": 0 + }, + "value": "def", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2095, + "end": 2119, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2097, + "end": 2119, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2097, + "end": 2113, + "ctxt": 0 + }, + "value": "MappingComponent", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2113, + "end": 2119, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 2114, + "end": 2115, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2114, + "end": 2115, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 2117, + "end": 2118, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2117, + "end": 2118, + "ctxt": 0 + }, + "value": "O", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2008, + "end": 2127, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2047, + "end": 2091, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2048, + "end": 2068, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2048, + "end": 2049, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 2058, + "end": 2068, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2058, + "end": 2068, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 2070, + "end": 2090, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2070, + "end": 2071, + "ctxt": 0 + }, + "value": "O", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 2080, + "end": 2090, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2080, + "end": 2090, + "ctxt": 0 + }, + "value": "WrappedMap", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 2120, + "end": 2126, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2122, + "end": 2126, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2129, + "end": 2591, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 2129, + "end": 2590, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2129, + "end": 2151, + "ctxt": 0 + }, + "value": "createMappingComponent", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 2152, + "end": 2589, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2158, + "end": 2163, + "ctxt": 0 + }, + "value": "setup", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 2158, + "end": 2451, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2166, + "end": 2451, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 2176, + "end": 2445, + "ctxt": 0 + }, + "argument": { + "type": "ObjectExpression", + "span": { + "start": 2183, + "end": 2444, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2197, + "end": 2203, + "ctxt": 0 + }, + "value": "inputs", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 2205, + "end": 2307, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2223, + "end": 2226, + "ctxt": 0 + }, + "value": "num", + "optional": false + }, + "value": { + "type": "NewExpression", + "span": { + "start": 2228, + "end": 2249, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2232, + "end": 2239, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "arguments": [], + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2239, + "end": 2247, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2240, + "end": 2246, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2267, + "end": 2270, + "ctxt": 0 + }, + "value": "str", + "optional": false + }, + "value": { + "type": "NewExpression", + "span": { + "start": 2272, + "end": 2293, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2276, + "end": 2283, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "arguments": [], + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2283, + "end": 2291, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2284, + "end": 2290, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + ] + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2321, + "end": 2328, + "ctxt": 0 + }, + "value": "outputs", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 2330, + "end": 2434, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2348, + "end": 2352, + "ctxt": 0 + }, + "value": "bool", + "optional": false + }, + "value": { + "type": "NewExpression", + "span": { + "start": 2354, + "end": 2376, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2358, + "end": 2365, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "arguments": [], + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2365, + "end": 2374, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2366, + "end": 2373, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2394, + "end": 2397, + "ctxt": 0 + }, + "value": "str", + "optional": false + }, + "value": { + "type": "NewExpression", + "span": { + "start": 2399, + "end": 2420, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2403, + "end": 2410, + "ctxt": 0 + }, + "value": "Wrapper", + "optional": false + }, + "arguments": [], + "typeArguments": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2410, + "end": 2418, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2411, + "end": 2417, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + ] + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2457, + "end": 2460, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2461, + "end": 2467, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2461, + "end": 2467, + "ctxt": 0 + }, + "value": "inputs", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 2457, + "end": 2587, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2469, + "end": 2587, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 2479, + "end": 2581, + "ctxt": 0 + }, + "argument": { + "type": "ObjectExpression", + "span": { + "start": 2486, + "end": 2581, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2500, + "end": 2504, + "ctxt": 0 + }, + "value": "bool", + "optional": false + }, + "value": { + "type": "MemberExpression", + "span": { + "start": 2506, + "end": 2524, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2506, + "end": 2512, + "ctxt": 0 + }, + "value": "inputs", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2513, + "end": 2524, + "ctxt": 0 + }, + "value": "nonexistent", + "optional": false + } + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2538, + "end": 2541, + "ctxt": 0 + }, + "value": "str", + "optional": false + }, + "value": { + "type": "MemberExpression", + "span": { + "start": 2543, + "end": 2553, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2543, + "end": 2549, + "ctxt": 0 + }, + "value": "inputs", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2550, + "end": 2553, + "ctxt": 0 + }, + "value": "num", + "optional": false + } + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2624, + "end": 2634, + "ctxt": 0 + }, + "value": "simplified", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2638, + "end": 2692, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2638, + "end": 2692, + "ctxt": 0 + }, + "value": "props", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2643, + "end": 2692, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 2645, + "end": 2692, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2647, + "end": 2666, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2647, + "end": 2656, + "ctxt": 0 + }, + "value": "generator", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2656, + "end": 2665, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2658, + "end": 2665, + "ctxt": 0 + }, + "params": [], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2661, + "end": 2665, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2664, + "end": 2665, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2664, + "end": 2665, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2667, + "end": 2690, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2667, + "end": 2675, + "ctxt": 0 + }, + "value": "receiver", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2675, + "end": 2690, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2677, + "end": 2690, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2678, + "end": 2682, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2679, + "end": 2682, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2681, + "end": 2682, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2681, + "end": 2682, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2684, + "end": 2690, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2687, + "end": 2690, + "ctxt": 0 + }, + "kind": "any" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2615, + "end": 2696, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2694, + "end": 2696, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2634, + "end": 2637, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2635, + "end": 2636, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2635, + "end": 2636, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2707, + "end": 2716, + "ctxt": 0 + }, + "value": "whatIWant", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2720, + "end": 2782, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2720, + "end": 2782, + "ctxt": 0 + }, + "value": "props", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2725, + "end": 2782, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 2727, + "end": 2782, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 2729, + "end": 2756, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2729, + "end": 2738, + "ctxt": 0 + }, + "value": "generator", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2738, + "end": 2755, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2740, + "end": 2755, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2741, + "end": 2749, + "ctxt": 0 + }, + "value": "bob", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2744, + "end": 2749, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2746, + "end": 2749, + "ctxt": 0 + }, + "kind": "any" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2751, + "end": 2755, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2754, + "end": 2755, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2754, + "end": 2755, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 2757, + "end": 2780, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 2757, + "end": 2765, + "ctxt": 0 + }, + "value": "receiver", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2765, + "end": 2780, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2767, + "end": 2780, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2768, + "end": 2772, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2769, + "end": 2772, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2771, + "end": 2772, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2771, + "end": 2772, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2774, + "end": 2780, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2777, + "end": 2780, + "ctxt": 0 + }, + "kind": "any" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2698, + "end": 2786, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2784, + "end": 2786, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2716, + "end": 2719, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2717, + "end": 2718, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2717, + "end": 2718, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2797, + "end": 2806, + "ctxt": 0 + }, + "value": "nonObject", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2810, + "end": 2836, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2810, + "end": 2836, + "ctxt": 0 + }, + "value": "generator", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2819, + "end": 2836, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2821, + "end": 2836, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2822, + "end": 2830, + "ctxt": 0 + }, + "value": "bob", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2825, + "end": 2830, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2827, + "end": 2830, + "ctxt": 0 + }, + "kind": "any" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2832, + "end": 2836, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2835, + "end": 2836, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2835, + "end": 2836, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2838, + "end": 2861, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2838, + "end": 2861, + "ctxt": 0 + }, + "value": "receiver", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2846, + "end": 2861, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2848, + "end": 2861, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2849, + "end": 2853, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2850, + "end": 2853, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2852, + "end": 2853, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2852, + "end": 2853, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2855, + "end": 2861, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2858, + "end": 2861, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2788, + "end": 2865, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2863, + "end": 2865, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2806, + "end": 2809, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2807, + "end": 2808, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2807, + "end": 2808, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2867, + "end": 2940, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 2867, + "end": 2940, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2867, + "end": 2877, + "ctxt": 0 + }, + "value": "simplified", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 2878, + "end": 2939, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2880, + "end": 2889, + "ctxt": 0 + }, + "value": "generator", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 2891, + "end": 2900, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "NumericLiteral", + "span": { + "start": 2897, + "end": 2900, + "ctxt": 0 + }, + "value": 123.0, + "raw": "123" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2902, + "end": 2910, + "ctxt": 0 + }, + "value": "receiver", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 2912, + "end": 2937, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2913, + "end": 2914, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 2919, + "end": 2937, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 2919, + "end": 2930, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2919, + "end": 2926, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2927, + "end": 2930, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 2931, + "end": 2936, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 2931, + "end": 2932, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 2935, + "end": 2936, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2941, + "end": 3024, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 2941, + "end": 3024, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 2941, + "end": 2950, + "ctxt": 0 + }, + "value": "whatIWant", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 2951, + "end": 3023, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2953, + "end": 2962, + "ctxt": 0 + }, + "value": "generator", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 2964, + "end": 2984, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2965, + "end": 2968, + "ctxt": 0 + }, + "value": "bob", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ConditionalExpression", + "span": { + "start": 2973, + "end": 2984, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 2973, + "end": 2976, + "ctxt": 0 + }, + "value": "bob", + "optional": false + }, + "consequent": { + "type": "NumericLiteral", + "span": { + "start": 2979, + "end": 2980, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "alternate": { + "type": "NumericLiteral", + "span": { + "start": 2983, + "end": 2984, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 2986, + "end": 2994, + "ctxt": 0 + }, + "value": "receiver", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 2996, + "end": 3021, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 2997, + "end": 2998, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 3003, + "end": 3021, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 3003, + "end": 3014, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 3003, + "end": 3010, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 3011, + "end": 3014, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 3015, + "end": 3020, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 3015, + "end": 3016, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 3019, + "end": 3020, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3025, + "end": 3083, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 3025, + "end": 3083, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3025, + "end": 3034, + "ctxt": 0 + }, + "value": "nonObject", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3035, + "end": 3055, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3036, + "end": 3039, + "ctxt": 0 + }, + "value": "bob", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ConditionalExpression", + "span": { + "start": 3044, + "end": 3055, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 3044, + "end": 3047, + "ctxt": 0 + }, + "value": "bob", + "optional": false + }, + "consequent": { + "type": "NumericLiteral", + "span": { + "start": 3050, + "end": 3051, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "alternate": { + "type": "NumericLiteral", + "span": { + "start": 3054, + "end": 3055, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3057, + "end": 3082, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3058, + "end": 3059, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 3064, + "end": 3082, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 3064, + "end": 3075, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 3064, + "end": 3071, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 3072, + "end": 3075, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "BinaryExpression", + "span": { + "start": 3076, + "end": 3081, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 3076, + "end": 3077, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 3080, + "end": 3081, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 3107, + "end": 3236, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 3117, + "end": 3121, + "ctxt": 0 + }, + "value": "Opts", + "optional": false + }, + "declare": false, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3121, + "end": 3146, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3122, + "end": 3129, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3122, + "end": 3129, + "ctxt": 0 + }, + "value": "TParams", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 3131, + "end": 3136, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3131, + "end": 3136, + "ctxt": 0 + }, + "value": "TDone", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 3138, + "end": 3145, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3138, + "end": 3145, + "ctxt": 0 + }, + "value": "TMapped", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 3147, + "end": 3236, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3153, + "end": 3200, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3153, + "end": 3158, + "ctxt": 0 + }, + "value": "fetch", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3158, + "end": 3199, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 3160, + "end": 3199, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3161, + "end": 3176, + "ctxt": 0 + }, + "value": "params", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3167, + "end": 3176, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3169, + "end": 3176, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3169, + "end": 3176, + "ctxt": 0 + }, + "value": "TParams", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 3178, + "end": 3189, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3181, + "end": 3189, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3183, + "end": 3189, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3191, + "end": 3199, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3194, + "end": 3199, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3194, + "end": 3199, + "ctxt": 0 + }, + "value": "TDone", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3205, + "end": 3234, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3205, + "end": 3208, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3208, + "end": 3234, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 3210, + "end": 3234, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3211, + "end": 3222, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3215, + "end": 3222, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3217, + "end": 3222, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3217, + "end": 3222, + "ctxt": 0 + }, + "value": "TDone", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3224, + "end": 3234, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3227, + "end": 3234, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3227, + "end": 3234, + "ctxt": 0 + }, + "value": "TMapped", + "optional": false + }, + "typeParams": null + } + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3247, + "end": 3254, + "ctxt": 0 + }, + "value": "example", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3280, + "end": 3318, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3280, + "end": 3318, + "ctxt": 0 + }, + "value": "options", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3287, + "end": 3318, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3289, + "end": 3318, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3289, + "end": 3293, + "ctxt": 0 + }, + "value": "Opts", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3293, + "end": 3318, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 3294, + "end": 3301, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3294, + "end": 3301, + "ctxt": 0 + }, + "value": "TParams", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 3303, + "end": 3308, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3303, + "end": 3308, + "ctxt": 0 + }, + "value": "TDone", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 3310, + "end": 3317, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3310, + "end": 3317, + "ctxt": 0 + }, + "value": "TMapped", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3238, + "end": 3444, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3320, + "end": 3444, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 3326, + "end": 3442, + "ctxt": 0 + }, + "argument": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3333, + "end": 3442, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3334, + "end": 3349, + "ctxt": 0 + }, + "value": "params", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3340, + "end": 3349, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3342, + "end": 3349, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3342, + "end": 3349, + "ctxt": 0 + }, + "value": "TParams", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 3354, + "end": 3442, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 3364, + "end": 3403, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 3370, + "end": 3403, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 3370, + "end": 3374, + "ctxt": 0 + }, + "value": "data", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 3377, + "end": 3403, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 3377, + "end": 3390, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 3377, + "end": 3384, + "ctxt": 0 + }, + "value": "options", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 3385, + "end": 3390, + "ctxt": 0 + }, + "value": "fetch", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3391, + "end": 3397, + "ctxt": 0 + }, + "value": "params", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 3399, + "end": 3402, + "ctxt": 0 + }, + "value": 123.0, + "raw": "123" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ReturnStatement", + "span": { + "start": 3412, + "end": 3436, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 3419, + "end": 3436, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 3419, + "end": 3430, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 3419, + "end": 3426, + "ctxt": 0 + }, + "value": "options", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 3427, + "end": 3430, + "ctxt": 0 + }, + "value": "map", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3431, + "end": 3435, + "ctxt": 0 + }, + "value": "data", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3254, + "end": 3279, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3255, + "end": 3262, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3255, + "end": 3262, + "ctxt": 0 + }, + "value": "TParams", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 3264, + "end": 3269, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3264, + "end": 3269, + "ctxt": 0 + }, + "value": "TDone", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 3271, + "end": 3278, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3271, + "end": 3278, + "ctxt": 0 + }, + "value": "TMapped", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 3446, + "end": 3498, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 3456, + "end": 3462, + "ctxt": 0 + }, + "value": "Params", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 3463, + "end": 3498, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3469, + "end": 3480, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3469, + "end": 3472, + "ctxt": 0 + }, + "value": "one", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3472, + "end": 3480, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3474, + "end": 3480, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3485, + "end": 3496, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3485, + "end": 3488, + "ctxt": 0 + }, + "value": "two", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3488, + "end": 3496, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3490, + "end": 3496, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3500, + "end": 3585, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 3500, + "end": 3584, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3500, + "end": 3507, + "ctxt": 0 + }, + "value": "example", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 3508, + "end": 3583, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3514, + "end": 3519, + "ctxt": 0 + }, + "value": "fetch", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3521, + "end": 3544, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3522, + "end": 3536, + "ctxt": 0 + }, + "value": "params", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3528, + "end": 3536, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3530, + "end": 3536, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3530, + "end": 3536, + "ctxt": 0 + }, + "value": "Params", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 3541, + "end": 3544, + "ctxt": 0 + }, + "value": 123.0, + "raw": "123" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3550, + "end": 3553, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3555, + "end": 3581, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3556, + "end": 3562, + "ctxt": 0 + }, + "value": "number", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 3567, + "end": 3581, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3567, + "end": 3573, + "ctxt": 0 + }, + "value": "String", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3574, + "end": 3580, + "ctxt": 0 + }, + "value": "number", + "optional": false + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3587, + "end": 3685, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 3587, + "end": 3684, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3587, + "end": 3594, + "ctxt": 0 + }, + "value": "example", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 3595, + "end": 3683, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3601, + "end": 3606, + "ctxt": 0 + }, + "value": "fetch", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3608, + "end": 3644, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3609, + "end": 3623, + "ctxt": 0 + }, + "value": "params", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3615, + "end": 3623, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3617, + "end": 3623, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3617, + "end": 3623, + "ctxt": 0 + }, + "value": "Params", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 3625, + "end": 3636, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3628, + "end": 3636, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3630, + "end": 3636, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 3641, + "end": 3644, + "ctxt": 0 + }, + "value": 123.0, + "raw": "123" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3650, + "end": 3653, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3655, + "end": 3681, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3656, + "end": 3662, + "ctxt": 0 + }, + "value": "number", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 3667, + "end": 3681, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3667, + "end": 3673, + "ctxt": 0 + }, + "value": "String", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3674, + "end": 3680, + "ctxt": 0 + }, + "value": "number", + "optional": false + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3687, + "end": 3777, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 3687, + "end": 3776, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3687, + "end": 3694, + "ctxt": 0 + }, + "value": "example", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 3695, + "end": 3775, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3701, + "end": 3706, + "ctxt": 0 + }, + "value": "fetch", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3708, + "end": 3736, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3709, + "end": 3723, + "ctxt": 0 + }, + "value": "params", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3715, + "end": 3723, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3717, + "end": 3723, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3717, + "end": 3723, + "ctxt": 0 + }, + "value": "Params", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 3725, + "end": 3728, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "NumericLiteral", + "span": { + "start": 3733, + "end": 3736, + "ctxt": 0 + }, + "value": 123.0, + "raw": "123" + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3742, + "end": 3745, + "ctxt": 0 + }, + "value": "map", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3747, + "end": 3773, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3748, + "end": 3754, + "ctxt": 0 + }, + "value": "number", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "CallExpression", + "span": { + "start": 3759, + "end": 3773, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3759, + "end": 3765, + "ctxt": 0 + }, + "value": "String", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3766, + "end": 3772, + "ctxt": 0 + }, + "value": "number", + "optional": false + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 3801, + "end": 3909, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 3815, + "end": 3909, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 3815, + "end": 3821, + "ctxt": 0 + }, + "value": "branch", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3821, + "end": 3909, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 3825, + "end": 3909, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3842, + "end": 3900, + "ctxt": 0 + }, + "value": "_", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3843, + "end": 3900, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 3845, + "end": 3900, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 3847, + "end": 3855, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3847, + "end": 3851, + "ctxt": 0 + }, + "value": "test", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3851, + "end": 3854, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3853, + "end": 3854, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3853, + "end": 3854, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3856, + "end": 3877, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3856, + "end": 3858, + "ctxt": 0 + }, + "value": "if", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3858, + "end": 3876, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 3860, + "end": 3876, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3861, + "end": 3865, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3862, + "end": 3865, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3864, + "end": 3865, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3864, + "end": 3865, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3867, + "end": 3876, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypePredicate", + "span": { + "start": 3870, + "end": 3876, + "ctxt": 0 + }, + "asserts": false, + "paramName": { + "type": "Identifier", + "span": { + "start": 3870, + "end": 3871, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3875, + "end": 3876, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3875, + "end": 3876, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3875, + "end": 3876, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + } + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 3878, + "end": 3898, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 3878, + "end": 3882, + "ctxt": 0 + }, + "value": "then", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3882, + "end": 3898, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 3884, + "end": 3898, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3885, + "end": 3889, + "ctxt": 0 + }, + "value": "u", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3886, + "end": 3889, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3888, + "end": 3889, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3888, + "end": 3889, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3891, + "end": 3898, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3894, + "end": 3898, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + "typeParams": null + } + ] + } + } + } + ], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3825, + "end": 3841, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3826, + "end": 3827, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3826, + "end": 3827, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + }, + { + "type": "TsTypeParameter", + "span": { + "start": 3829, + "end": 3840, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3829, + "end": 3830, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 3839, + "end": 3840, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3839, + "end": 3840, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3902, + "end": 3909, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3905, + "end": 3909, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 3911, + "end": 3937, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 3925, + "end": 3937, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 3925, + "end": 3926, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3926, + "end": 3937, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 3928, + "end": 3937, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 3928, + "end": 3931, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3928, + "end": 3931, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 3934, + "end": 3937, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3934, + "end": 3937, + "ctxt": 0 + }, + "value": "b", + "raw": "\"b\"" + } + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3939, + "end": 4037, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 3939, + "end": 4037, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3939, + "end": 3945, + "ctxt": 0 + }, + "value": "branch", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 3946, + "end": 4036, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3950, + "end": 3954, + "ctxt": 0 + }, + "value": "test", + "optional": false + }, + "value": { + "type": "Identifier", + "span": { + "start": 3956, + "end": 3957, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3961, + "end": 3963, + "ctxt": 0 + }, + "value": "if", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 3965, + "end": 3991, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 3966, + "end": 3967, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BinaryExpression", + "span": { + "start": 3982, + "end": 3991, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 3982, + "end": 3983, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3988, + "end": 3991, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 3968, + "end": 3978, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypePredicate", + "span": { + "start": 3970, + "end": 3978, + "ctxt": 0 + }, + "asserts": false, + "paramName": { + "type": "Identifier", + "span": { + "start": 3970, + "end": 3971, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3975, + "end": 3978, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 3975, + "end": 3978, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3975, + "end": 3978, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + } + } + } + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 3995, + "end": 3999, + "ctxt": 0 + }, + "value": "then", + "optional": false + }, + "value": { + "type": "ArrowFunctionExpression", + "span": { + "start": 4001, + "end": 4034, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 4001, + "end": 4002, + "ctxt": 0 + }, + "value": "u", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 4006, + "end": 4034, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 4012, + "end": 4030, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4016, + "end": 4030, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4016, + "end": 4021, + "ctxt": 0 + }, + "value": "test1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4021, + "end": 4026, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 4023, + "end": 4026, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4023, + "end": 4026, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 4029, + "end": 4030, + "ctxt": 0 + }, + "value": "u", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ] + } + } + ], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.ts b/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.ts new file mode 100644 index 00000000000..f17093702a9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.ts @@ -0,0 +1,201 @@ +// @strict: true +// @declaration: true + +// Repros from #47599 + +declare function callIt(obj: { + produce: (n: number) => T, + consume: (x: T) => void +}): void; + +callIt({ + produce: () => 0, + consume: n => n.toFixed() +}); + +callIt({ + produce: _a => 0, + consume: n => n.toFixed(), +}); + +callIt({ + produce() { + return 0; + }, + consume: n => n.toFixed() +}); + +declare function callItT(obj: [(n: number) => T, (x: T) => void]): void; + +callItT([() => 0, n => n.toFixed()]); +callItT([_a => 0, n => n.toFixed()]); + +// Repro from #25092 + +interface MyInterface { + retrieveGeneric: (parameter: string) => T, + operateWithGeneric: (generic: T) => string +} + +const inferTypeFn = (generic: MyInterface) => generic; + +const myGeneric = inferTypeFn({ + retrieveGeneric: parameter => 5, + operateWithGeneric: generic => generic.toFixed() +}); + +// Repro #38623 + +function make(o: { mutations: M, action: (m: M) => void }) { } + +make({ + mutations: { + foo() { } + }, + action: (a) => { a.foo() } +}); + +// Repro from #38845 + +declare function foo(options: { a: A, b: (a: A) => void }): void; + +foo({ + a: () => { return 42 }, + b(a) {}, +}); + +foo({ + a: function () { return 42 }, + b(a) {}, +}); + +foo({ + a() { return 42 }, + b(a) {}, +}); + +// Repro from #38872 + +type Chain = { + a(): R1, + b(a: R1): R2; + c(b: R2): void; +}; + +function test(foo: Chain) {} + +test({ + a: () => 0, + b: (a) => 'a', + c: (b) => { + const x: string = b; + } +}); + +test({ + a: () => 0, + b: (a) => a, + c: (b) => { + const x: number = b; + } +}); + +// Repro from #41712 + +class Wrapper { + public value?: T; +} + +type WrappedMap = Record; +type Unwrap = { + [K in keyof D]: D[K] extends Wrapper ? T : never; +}; + +type MappingComponent = { + setup(): { inputs: I; outputs: O }; + map?: (inputs: Unwrap) => Unwrap; +}; + +declare function createMappingComponent(def: MappingComponent): void; + +createMappingComponent({ + setup() { + return { + inputs: { + num: new Wrapper(), + str: new Wrapper() + }, + outputs: { + bool: new Wrapper(), + str: new Wrapper() + } + }; + }, + map(inputs) { + return { + bool: inputs.nonexistent, + str: inputs.num, // Causes error + } + } +}); + +// Repro from #48279 + +function simplified(props: { generator: () => T, receiver: (t: T) => any }) {} + +function whatIWant(props: { generator: (bob: any) => T, receiver: (t: T) => any }) {} + +function nonObject(generator: (bob: any) => T, receiver: (t: T) => any) {} + +simplified({ generator: () => 123, receiver: (t) => console.log(t + 2) }) +whatIWant({ generator: (bob) => bob ? 1 : 2, receiver: (t) => console.log(t + 2) }) +nonObject((bob) => bob ? 1 : 2, (t) => console.log(t + 2)) + +// Repro from #48466 + +interface Opts { + fetch: (params: TParams, foo: number) => TDone, + map: (data: TDone) => TMapped +} + +function example(options: Opts) { + return (params: TParams) => { + const data = options.fetch(params, 123) + return options.map(data) + } +} + +interface Params { + one: number + two: string +} + +example({ + fetch: (params: Params) => 123, + map: (number) => String(number) +}); + +example({ + fetch: (params: Params, foo: number) => 123, + map: (number) => String(number) +}); + +example({ + fetch: (params: Params, foo) => 123, + map: (number) => String(number) +}); + +// Repro from #45255 + +declare const branch: + (_: { test: T, if: (t: T) => t is U, then: (u: U) => void }) => void + +declare const x: "a" | "b" + +branch({ + test: x, + if: (t): t is "a" => t === "a", + then: u => { + let test1: "a" = u + } +}) diff --git a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.json b/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.json deleted file mode 100644 index ca2ff5f05be..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.json +++ /dev/null @@ -1,1072 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 577, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 38, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 23, - "end": 37, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "MetaProperty", - "span": { - "start": 27, - "end": 37, - "ctxt": 0 - }, - "kind": "new.target" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 39, - "end": 66, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 45, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 49, - "end": 65, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 55, - "end": 65, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 68, - "end": 411, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 82, - "end": 100, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 82, - "end": 94, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 83, - "end": 93, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 82, - "end": 100, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 109, - "end": 131, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 111, - "end": 129, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 118, - "end": 128, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 136, - "end": 166, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 136, - "end": 166, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 166, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 146, - "end": 164, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 153, - "end": 163, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 171, - "end": 199, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 171, - "end": 199, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 180, - "end": 199, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 182, - "end": 197, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 182, - "end": 196, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 186, - "end": 196, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 204, - "end": 225, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 205, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 208, - "end": 224, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 214, - "end": 224, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 231, - "end": 256, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 238, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 239, - "end": 249, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 231, - "end": 256, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 261, - "end": 294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 268, - "end": 269, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 261, - "end": 294, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 272, - "end": 294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 274, - "end": 292, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 281, - "end": 291, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 299, - "end": 336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 299, - "end": 336, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 314, - "end": 336, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 316, - "end": 334, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 323, - "end": 333, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 341, - "end": 376, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "value": "i", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 341, - "end": 376, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 357, - "end": 376, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 359, - "end": 374, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 359, - "end": 373, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 363, - "end": 373, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 381, - "end": 409, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 388, - "end": 389, - "ctxt": 0 - }, - "value": "j", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 392, - "end": 408, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 398, - "end": 408, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 577, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 419, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "O", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 423, - "end": 576, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 429, - "end": 441, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 430, - "end": 440, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "value": { - "type": "Identifier", - "span": { - "start": 443, - "end": 452, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 458, - "end": 459, - "ctxt": 0 - }, - "value": "k", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 458, - "end": 484, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 462, - "end": 484, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 464, - "end": 482, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 471, - "end": 481, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "GetterProperty", - "span": { - "start": 490, - "end": 520, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "l", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 498, - "end": 520, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 500, - "end": 518, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 507, - "end": 517, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 526, - "end": 554, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 530, - "end": 531, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 535, - "end": 554, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 537, - "end": 552, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 537, - "end": 551, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 537, - "end": 538, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 541, - "end": 551, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "MetaProperty", - "span": { - "start": 563, - "end": 573, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.ts b/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.ts deleted file mode 100644 index 4a30a47ec25..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es5.ts +++ /dev/null @@ -1,25 +0,0 @@ -// @target: es5 -const a = new.target; -const b = () => new.target; - -class C { - [new.target]() { } - c() { return new.target; } - get d() { return new.target; } - set e(_) { _ = new.target; } - f = () => new.target; - - static [new.target]() { } - static g() { return new.target; } - static get h() { return new.target; } - static set i(_) { _ = new.target; } - static j = () => new.target; -} - -const O = { - [new.target]: undefined, - k() { return new.target; }, - get l() { return new.target; }, - set m(_) { _ = new.target; }, - n: new.target, -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.json b/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.json deleted file mode 100644 index ca2ff5f05be..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.json +++ /dev/null @@ -1,1072 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 577, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 38, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 23, - "end": 37, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "MetaProperty", - "span": { - "start": 27, - "end": 37, - "ctxt": 0 - }, - "kind": "new.target" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 39, - "end": 66, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 45, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 49, - "end": 65, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 55, - "end": 65, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 68, - "end": 411, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 82, - "end": 100, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 82, - "end": 94, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 83, - "end": 93, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 82, - "end": 100, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 109, - "end": 131, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 111, - "end": 129, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 118, - "end": 128, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 136, - "end": 166, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 136, - "end": 166, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 166, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 146, - "end": 164, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 153, - "end": 163, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 171, - "end": 199, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 171, - "end": 199, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 180, - "end": 199, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 182, - "end": 197, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 182, - "end": 196, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 186, - "end": 196, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 204, - "end": 225, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 205, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 208, - "end": 224, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 214, - "end": 224, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 231, - "end": 256, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 238, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 239, - "end": 249, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 231, - "end": 256, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 261, - "end": 294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 268, - "end": 269, - "ctxt": 0 - }, - "value": "g", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 261, - "end": 294, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 272, - "end": 294, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 274, - "end": 292, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 281, - "end": 291, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 299, - "end": 336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 299, - "end": 336, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 314, - "end": 336, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 316, - "end": 334, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 323, - "end": 333, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 341, - "end": 376, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "value": "i", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 341, - "end": 376, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 357, - "end": 376, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 359, - "end": 374, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 359, - "end": 373, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 363, - "end": 373, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 381, - "end": 409, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 388, - "end": 389, - "ctxt": 0 - }, - "value": "j", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 392, - "end": 408, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "MetaProperty", - "span": { - "start": 398, - "end": 408, - "ctxt": 0 - }, - "kind": "new.target" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 577, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 419, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "O", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 423, - "end": 576, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 429, - "end": 441, - "ctxt": 0 - }, - "expression": { - "type": "MetaProperty", - "span": { - "start": 430, - "end": 440, - "ctxt": 0 - }, - "kind": "new.target" - } - }, - "value": { - "type": "Identifier", - "span": { - "start": 443, - "end": 452, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 458, - "end": 459, - "ctxt": 0 - }, - "value": "k", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 458, - "end": 484, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 462, - "end": 484, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 464, - "end": 482, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 471, - "end": 481, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "GetterProperty", - "span": { - "start": 490, - "end": 520, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "l", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 498, - "end": 520, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 500, - "end": 518, - "ctxt": 0 - }, - "argument": { - "type": "MetaProperty", - "span": { - "start": 507, - "end": 517, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 526, - "end": 554, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 530, - "end": 531, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 535, - "end": 554, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 537, - "end": 552, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 537, - "end": 551, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 537, - "end": 538, - "ctxt": 0 - }, - "value": "_", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "MetaProperty", - "span": { - "start": 541, - "end": 551, - "ctxt": 0 - }, - "kind": "new.target" - } - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "MetaProperty", - "span": { - "start": 563, - "end": 573, - "ctxt": 0 - }, - "kind": "new.target" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.ts b/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.ts deleted file mode 100644 index 758443f65a6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.ts +++ /dev/null @@ -1,25 +0,0 @@ -// @target: es6 -const a = new.target; -const b = () => new.target; - -class C { - [new.target]() { } - c() { return new.target; } - get d() { return new.target; } - set e(_) { _ = new.target; } - f = () => new.target; - - static [new.target]() { } - static g() { return new.target; } - static get h() { return new.target; } - static set i(_) { _ = new.target; } - static j = () => new.target; -} - -const O = { - [new.target]: undefined, - k() { return new.target; }, - get l() { return new.target; }, - set m(_) { _ = new.target; }, - n: new.target, -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/iterableContextualTyping1.ts b/crates/swc_ecma_parser/tests/tsc/iterableContextualTyping1.ts index 01e78a28b6f..076d87a04ee 100644 --- a/crates/swc_ecma_parser/tests/tsc/iterableContextualTyping1.ts +++ b/crates/swc_ecma_parser/tests/tsc/iterableContextualTyping1.ts @@ -1,2 +1,2 @@ -//@target: ES6 +//@target: ES6 var iter: Iterable<(x: string) => number> = [s => s.length]; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.json b/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.json new file mode 100644 index 00000000000..96cd38ea9d1 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.json @@ -0,0 +1,279 @@ +{ + "type": "Script", + "span": { + "start": 205, + "end": 389, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 205, + "end": 215, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 209, + "end": 215, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 209, + "end": 211, + "ctxt": 0 + }, + "value": "id", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 214, + "end": 215, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 290, + "end": 389, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 296, + "end": 389, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 296, + "end": 300, + "ctxt": 0 + }, + "value": "send", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 303, + "end": 389, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 303, + "end": 311, + "ctxt": 0 + }, + "value": "handlers", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "NewExpression", + "span": { + "start": 315, + "end": 389, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 319, + "end": 326, + "ctxt": 0 + }, + "value": "Promise", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 327, + "end": 388, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 328, + "end": 335, + "ctxt": 0 + }, + "value": "resolve", + "optional": false, + "typeAnnotation": null + }, + { + "type": "Identifier", + "span": { + "start": 337, + "end": 343, + "ctxt": 0 + }, + "value": "reject", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 348, + "end": 388, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 352, + "end": 386, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 352, + "end": 386, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 352, + "end": 366, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 352, + "end": 360, + "ctxt": 0 + }, + "value": "handlers", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 360, + "end": 366, + "ctxt": 0 + }, + "expression": { + "type": "UpdateExpression", + "span": { + "start": 361, + "end": 365, + "ctxt": 0 + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "span": { + "start": 363, + "end": 365, + "ctxt": 0 + }, + "value": "id", + "optional": false + } + } + } + }, + "right": { + "type": "ArrayExpression", + "span": { + "start": 369, + "end": 386, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 370, + "end": 377, + "ctxt": 0 + }, + "value": "resolve", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 379, + "end": 385, + "ctxt": 0 + }, + "value": "reject", + "optional": false + } + } + ] + } + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.ts b/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.ts new file mode 100644 index 00000000000..fed366525c7 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.ts @@ -0,0 +1,21 @@ +// @allowJs: true +// @checkJs: true +// @target: esnext +// @outDir: ./out +// @declaration: true +// @filename: foo.js +/** + * @typedef {{ + * [id: string]: [Function, Function]; + * }} ResolveRejectMap + */ + +let id = 0 + +/** + * @param {ResolveRejectMap} handlers + * @returns {Promise} + */ +const send = handlers => new Promise((resolve, reject) => { + handlers[++id] = [resolve, reject] +}) \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.json b/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.json index e29c6367ffd..3f14726eaac 100644 --- a/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.json +++ b/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 188, - "end": 2387, + "end": 2411, "ctxt": 0 }, "body": [ @@ -23,14 +23,14 @@ "decorators": [], "span": { "start": 188, - "end": 2387, + "end": 2411, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { "start": 202, - "end": 2387, + "end": 2411, "ctxt": 0 }, "stmts": [ @@ -1729,15 +1729,15 @@ { "type": "TryStatement", "span": { - "start": 2125, - "end": 2189, + "start": 2137, + "end": 2201, "ctxt": 0 }, "block": { "type": "BlockStatement", "span": { - "start": 2129, - "end": 2132, + "start": 2141, + "end": 2144, "ctxt": 0 }, "stmts": [] @@ -1745,30 +1745,30 @@ "handler": { "type": "CatchClause", "span": { - "start": 2133, - "end": 2189, + "start": 2145, + "end": 2201, "ctxt": 0 }, "param": { "type": "ObjectPattern", "span": { - "start": 2163, - "end": 2168, + "start": 2175, + "end": 2180, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 2165, - "end": 2166, + "start": 2177, + "end": 2178, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2165, - "end": 2166, + "start": 2177, + "end": 2178, "ctxt": 0 }, "value": "x", @@ -1783,37 +1783,37 @@ "body": { "type": "BlockStatement", "span": { - "start": 2170, - "end": 2189, + "start": 2182, + "end": 2201, "ctxt": 0 }, "stmts": [ { "type": "ExpressionStatement", "span": { - "start": 2172, - "end": 2187, + "start": 2184, + "end": 2199, "ctxt": 0 }, "expression": { "type": "CallExpression", "span": { - "start": 2172, - "end": 2186, + "start": 2184, + "end": 2198, "ctxt": 0 }, "callee": { "type": "MemberExpression", "span": { - "start": 2172, - "end": 2183, + "start": 2184, + "end": 2195, "ctxt": 0 }, "object": { "type": "Identifier", "span": { - "start": 2172, - "end": 2179, + "start": 2184, + "end": 2191, "ctxt": 0 }, "value": "console", @@ -1822,8 +1822,8 @@ "property": { "type": "Identifier", "span": { - "start": 2180, - "end": 2183, + "start": 2192, + "end": 2195, "ctxt": 0 }, "value": "log", @@ -1836,8 +1836,8 @@ "expression": { "type": "Identifier", "span": { - "start": 2184, - "end": 2185, + "start": 2196, + "end": 2197, "ctxt": 0 }, "value": "x", @@ -1856,15 +1856,15 @@ { "type": "TryStatement", "span": { - "start": 2210, - "end": 2256, + "start": 2234, + "end": 2280, "ctxt": 0 }, "block": { "type": "BlockStatement", "span": { - "start": 2214, - "end": 2217, + "start": 2238, + "end": 2241, "ctxt": 0 }, "stmts": [] @@ -1872,30 +1872,30 @@ "handler": { "type": "CatchClause", "span": { - "start": 2218, - "end": 2256, + "start": 2242, + "end": 2280, "ctxt": 0 }, "param": { "type": "ObjectPattern", "span": { - "start": 2246, - "end": 2251, + "start": 2270, + "end": 2275, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 2248, - "end": 2249, + "start": 2272, + "end": 2273, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2248, - "end": 2249, + "start": 2272, + "end": 2273, "ctxt": 0 }, "value": "x", @@ -1910,8 +1910,8 @@ "body": { "type": "BlockStatement", "span": { - "start": 2253, - "end": 2256, + "start": 2277, + "end": 2280, "ctxt": 0 }, "stmts": [] @@ -1922,15 +1922,15 @@ { "type": "TryStatement", "span": { - "start": 2300, - "end": 2347, + "start": 2324, + "end": 2371, "ctxt": 0 }, "block": { "type": "BlockStatement", "span": { - "start": 2304, - "end": 2307, + "start": 2328, + "end": 2331, "ctxt": 0 }, "stmts": [] @@ -1938,30 +1938,30 @@ "handler": { "type": "CatchClause", "span": { - "start": 2308, - "end": 2347, + "start": 2332, + "end": 2371, "ctxt": 0 }, "param": { "type": "ObjectPattern", "span": { - "start": 2337, - "end": 2342, + "start": 2361, + "end": 2366, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 2339, - "end": 2340, + "start": 2363, + "end": 2364, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 2339, - "end": 2340, + "start": 2363, + "end": 2364, "ctxt": 0 }, "value": "x", @@ -1976,8 +1976,8 @@ "body": { "type": "BlockStatement", "span": { - "start": 2344, - "end": 2347, + "start": 2368, + "end": 2371, "ctxt": 0 }, "stmts": [] diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.ts b/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.ts index 1b9982073f2..b47776eb1d9 100644 --- a/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.ts +++ b/crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.ts @@ -50,8 +50,8 @@ function fn() { try { } catch ({ x }) { } // should be OK try { } catch (/** @type {any} */ { x }) { x.foo; } // should be OK try { } catch (/** @type {Any} */ { x }) { x.foo;} // should be OK - try { } catch (/** @type {unknown} */ { x }) { console.log(x); } // should be OK - try { } catch (/** @type {Unknown} */ { x }) { console.log(x); } // should be OK + try { } catch (/** @type {unknown} */ { x }) { console.log(x); } // error in the destructure + try { } catch (/** @type {Unknown} */ { x }) { console.log(x); } // error in the destructure try { } catch (/** @type {Error} */ { x }) { } // error in the type try { } catch (/** @type {object} */ { x }) { } // error in the type } diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.json new file mode 100644 index 00000000000..40be3bfa022 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.json @@ -0,0 +1,129 @@ +{ + "type": "Module", + "span": { + "start": 46, + "end": 158, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 46, + "end": 67, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 53, + "end": 67, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 65, + "end": 67, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 89, + "end": 118, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 112, + "end": 117, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 137, + "end": 158, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 144, + "end": 158, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 154, + "end": 155, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 156, + "end": 158, + "ctxt": 0 + }, + "body": [] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.ts new file mode 100644 index 00000000000..c078da2e8b7 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.ts @@ -0,0 +1,9 @@ +// @noUnusedLocals: true +// @filename: /a.ts +export interface A {} + +// @filename: /b.ts +import type { A } from "./a"; + +/** {@link A} */ +export interface B {} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.json new file mode 100644 index 00000000000..cad59c3464a --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.json @@ -0,0 +1,121 @@ +{ + "type": "Module", + "span": { + "start": 119, + "end": 218, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 119, + "end": 136, + "ctxt": 0 + }, + "declaration": { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 132, + "end": 133, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "span": { + "start": 126, + "end": 136, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 158, + "end": 182, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 176, + "end": 181, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 201, + "end": 218, + "ctxt": 0 + }, + "declaration": { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 214, + "end": 215, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "declare": false, + "span": { + "start": 208, + "end": 218, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.ts new file mode 100644 index 00000000000..6258e7aed69 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.ts @@ -0,0 +1,15 @@ +// @noUnusedLocals: true +// @checkJs: true +// @allowJs: true +// @target: esnext +// @noEmit: true + +// @filename: /a.js +export class A {} + +// @filename: /b.js +import { A } from "./a"; + +/** {@link A} */ +export class B {} + diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.json new file mode 100644 index 00000000000..56055da2047 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.json @@ -0,0 +1,170 @@ +{ + "type": "Module", + "span": { + "start": 46, + "end": 198, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 46, + "end": 67, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 53, + "end": 67, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 65, + "end": 67, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 89, + "end": 118, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 112, + "end": 117, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 165, + "end": 198, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 181, + "end": 184, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 185, + "end": 194, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 185, + "end": 194, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 186, + "end": 194, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 188, + "end": 194, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 172, + "end": 198, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 196, + "end": 198, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.ts new file mode 100644 index 00000000000..a83c33ebc13 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.ts @@ -0,0 +1,11 @@ +// @noUnusedLocals: true +// @filename: /a.ts +export interface A {} + +// @filename: /b.ts +import type { A } from "./a"; + +/** + * @param {number} a - see {@link A} + */ +export function foo(a: string) {} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.json new file mode 100644 index 00000000000..03b69ee79d5 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.json @@ -0,0 +1,168 @@ +{ + "type": "Module", + "span": { + "start": 46, + "end": 196, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 46, + "end": 67, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 53, + "end": 67, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 63, + "end": 64, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 65, + "end": 67, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 89, + "end": 114, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "span": { + "start": 96, + "end": 102, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 101, + "end": 102, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 108, + "end": 113, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 163, + "end": 196, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 179, + "end": 182, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 183, + "end": 192, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 183, + "end": 192, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 184, + "end": 192, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 186, + "end": 192, + "ctxt": 0 + }, + "kind": "string" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 170, + "end": 196, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 194, + "end": 196, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.ts new file mode 100644 index 00000000000..2d25322c89e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.ts @@ -0,0 +1,11 @@ +// @noUnusedLocals: true +// @filename: /a.ts +export interface A {} + +// @filename: /b.ts +import * as a from "./a"; + +/** + * @param {number} a - see {@link a.A} + */ +export function foo(a: string) {} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.json new file mode 100644 index 00000000000..dfd8316945f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.json @@ -0,0 +1,49 @@ +{ + "type": "Module", + "span": { + "start": 78, + "end": 99, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 78, + "end": 99, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 85, + "end": 99, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 95, + "end": 96, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 97, + "end": 99, + "ctxt": 0 + }, + "body": [] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.ts new file mode 100644 index 00000000000..c7823aaa3b5 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.ts @@ -0,0 +1,5 @@ +// @noUnusedLocals: true +// @filename: /a.ts + +/** {@link UNRESOLVED_LINK} */ +export interface A {} diff --git a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.json b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.json similarity index 70% rename from crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.json rename to crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.json index d5b1b06d023..d6e0bedcc59 100644 --- a/crates/swc_ecma_parser/tests/tsc/classAbstractMethodInNonAbstractClass.json +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.json @@ -1,8 +1,8 @@ { "type": "Script", "span": { - "start": 1, - "end": 67, + "start": 21, + "end": 127, "ctxt": 0 }, "body": [ @@ -11,8 +11,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 7, - "end": 8, + "start": 27, + "end": 28, "ctxt": 0 }, "value": "A", @@ -20,8 +20,8 @@ }, "declare": false, "span": { - "start": 1, - "end": 32, + "start": 21, + "end": 45, "ctxt": 0 }, "decorators": [], @@ -29,15 +29,15 @@ { "type": "ClassMethod", "span": { - "start": 15, - "end": 30, + "start": 35, + "end": 43, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 24, - "end": 27, + "start": 35, + "end": 38, "ctxt": 0 }, "value": "foo", @@ -47,11 +47,19 @@ "params": [], "decorators": [], "span": { - "start": 15, - "end": 30, + "start": 35, + "end": 43, "ctxt": 0 }, - "body": null, + "body": { + "type": "BlockStatement", + "span": { + "start": 41, + "end": 43, + "ctxt": 0 + }, + "stmts": [] + }, "generator": false, "async": false, "typeParameters": null, @@ -60,7 +68,7 @@ "kind": "method", "isStatic": false, "accessibility": null, - "isAbstract": true, + "isAbstract": false, "isOptional": false, "isOverride": false } @@ -76,8 +84,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 40, - "end": 41, + "start": 52, + "end": 53, "ctxt": 0 }, "value": "B", @@ -85,8 +93,8 @@ }, "declare": false, "span": { - "start": 34, - "end": 67, + "start": 46, + "end": 127, "ctxt": 0 }, "decorators": [], @@ -94,15 +102,15 @@ { "type": "ClassMethod", "span": { - "start": 48, - "end": 65, + "start": 117, + "end": 125, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 57, - "end": 60, + "start": 117, + "end": 120, "ctxt": 0 }, "value": "foo", @@ -112,15 +120,15 @@ "params": [], "decorators": [], "span": { - "start": 48, - "end": 65, + "start": 117, + "end": 125, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 63, - "end": 65, + "start": 123, + "end": 125, "ctxt": 0 }, "stmts": [] @@ -133,12 +141,21 @@ "kind": "method", "isStatic": false, "accessibility": null, - "isAbstract": true, + "isAbstract": false, "isOptional": false, "isOverride": false } ], - "superClass": null, + "superClass": { + "type": "Identifier", + "span": { + "start": 62, + "end": 63, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, "isAbstract": false, "typeParams": null, "superTypeParams": null, diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.ts b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.ts new file mode 100644 index 00000000000..5dcb70ddedf --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.ts @@ -0,0 +1,10 @@ +// @filename: /a.ts +class A { + foo() {} +} +class B extends A { + /** + * @override {@link A.foo} + */ + foo() {} +} diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.json b/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.json index 7896867dfc4..193675fcd36 100644 --- a/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.json +++ b/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 167, - "end": 1660, + "end": 1761, "ctxt": 0 }, "body": [ @@ -1001,8 +1001,157 @@ "identifier": { "type": "Identifier", "span": { - "start": 1498, - "end": 1502, + "start": 1369, + "end": 1374, + "ctxt": 0 + }, + "value": "good9", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1375, + "end": 1380, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "ObjectPattern", + "span": { + "start": 1375, + "end": 1380, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1377, + "end": 1378, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1377, + "end": 1378, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 1360, + "end": 1416, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1382, + "end": 1416, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1388, + "end": 1414, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1388, + "end": 1413, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1388, + "end": 1399, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1388, + "end": 1395, + "ctxt": 0 + }, + "value": "console", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1396, + "end": 1399, + "ctxt": 0 + }, + "value": "log", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1400, + "end": 1409, + "ctxt": 0 + }, + "value": "arguments", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1411, + "end": 1412, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1599, + "end": 1603, "ctxt": 0 }, "value": "bad1", @@ -1013,16 +1162,16 @@ { "type": "Parameter", "span": { - "start": 1503, - "end": 1504, + "start": 1604, + "end": 1605, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 1503, - "end": 1504, + "start": 1604, + "end": 1605, "ctxt": 0 }, "value": "x", @@ -1033,31 +1182,31 @@ { "type": "Parameter", "span": { - "start": 1506, - "end": 1512, + "start": 1607, + "end": 1613, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 1506, - "end": 1512, + "start": 1607, + "end": 1613, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1507, - "end": 1508, + "start": 1608, + "end": 1609, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1507, - "end": 1508, + "start": 1608, + "end": 1609, "ctxt": 0 }, "value": "a", @@ -1068,15 +1217,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1510, - "end": 1511, + "start": 1611, + "end": 1612, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1510, - "end": 1511, + "start": 1611, + "end": 1612, "ctxt": 0 }, "value": "b", @@ -1092,15 +1241,15 @@ ], "decorators": [], "span": { - "start": 1489, - "end": 1516, + "start": 1590, + "end": 1617, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 1514, - "end": 1516, + "start": 1615, + "end": 1617, "ctxt": 0 }, "stmts": [] @@ -1115,8 +1264,8 @@ "identifier": { "type": "Identifier", "span": { - "start": 1642, - "end": 1646, + "start": 1743, + "end": 1747, "ctxt": 0 }, "value": "bad2", @@ -1127,16 +1276,16 @@ { "type": "Parameter", "span": { - "start": 1647, - "end": 1648, + "start": 1748, + "end": 1749, "ctxt": 0 }, "decorators": [], "pat": { "type": "Identifier", "span": { - "start": 1647, - "end": 1648, + "start": 1748, + "end": 1749, "ctxt": 0 }, "value": "x", @@ -1147,31 +1296,31 @@ { "type": "Parameter", "span": { - "start": 1650, - "end": 1656, + "start": 1751, + "end": 1757, "ctxt": 0 }, "decorators": [], "pat": { "type": "ObjectPattern", "span": { - "start": 1650, - "end": 1656, + "start": 1751, + "end": 1757, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1651, - "end": 1652, + "start": 1752, + "end": 1753, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1651, - "end": 1652, + "start": 1752, + "end": 1753, "ctxt": 0 }, "value": "a", @@ -1182,15 +1331,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1654, - "end": 1655, + "start": 1755, + "end": 1756, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1654, - "end": 1655, + "start": 1755, + "end": 1756, "ctxt": 0 }, "value": "b", @@ -1206,15 +1355,15 @@ ], "decorators": [], "span": { - "start": 1633, - "end": 1660, + "start": 1734, + "end": 1761, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 1658, - "end": 1660, + "start": 1759, + "end": 1761, "ctxt": 0 }, "stmts": [] diff --git a/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.ts b/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.ts index e9ebbe050c8..0d34ee5496a 100644 --- a/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.ts +++ b/crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.ts @@ -57,6 +57,13 @@ function good7(x, {a, b}, y) {} */ function good8({a, b}) {} +/** + * @param {{ a: string }} argument + */ +function good9({ a }) { + console.log(arguments, a); +} + /** * @param {object} obj - this type gets ignored * @param {string} obj.a diff --git a/crates/swc_ecma_parser/tests/tsc/jsxAndTypeAssertion.tsx b/crates/swc_ecma_parser/tests/tsc/jsxAndTypeAssertion.tsx deleted file mode 100644 index b20dea210a9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxAndTypeAssertion.tsx +++ /dev/null @@ -1,22 +0,0 @@ -// @jsx: preserve - -declare var createElement: any; - -class foo {} - -var x: any; -x = { test: }; - -x = ; - -x = hello {{}} ; - -x = {}}>hello; - -x = {}}>hello{{}}; - -x = x, x = ; - -{{/foo/.test(x) ? : }} - - diff --git a/crates/swc_ecma_parser/tests/tsc/jsxCheckJsxNoTypeArgumentsAllowed.json b/crates/swc_ecma_parser/tests/tsc/jsxCheckJsxNoTypeArgumentsAllowed.json deleted file mode 100644 index 2585add9292..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxCheckJsxNoTypeArgumentsAllowed.json +++ /dev/null @@ -1,614 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 174, - "end": 489, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 174, - "end": 205, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 181, - "end": 191, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 186, - "end": 191, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 197, - "end": 204, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 206, - "end": 292, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 227, - "end": 233, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "declare": true, - "span": { - "start": 213, - "end": 292, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 274, - "end": 290, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 274, - "end": 286, - "ctxt": 0 - }, - "value": "internalProp", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 245, - "end": 260, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 245, - "end": 250, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 251, - "end": 260, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 260, - "end": 267, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 264, - "end": 266, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 294, - "end": 348, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 301, - "end": 348, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 311, - "end": 315, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 316, - "end": 348, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 322, - "end": 332, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 323, - "end": 331, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 325, - "end": 331, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 337, - "end": 346, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 337, - "end": 338, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 338, - "end": 346, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 373, - "end": 416, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 382, - "end": 388, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 382, - "end": 388, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "imported": null, - "isTypeOnly": false - }, - { - "type": "ImportSpecifier", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 402, - "end": 415, - "ctxt": 0 - }, - "value": "./component", - "raw": "\"./component\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 417, - "end": 448, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 424, - "end": 434, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 429, - "end": 434, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 440, - "end": 447, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 450, - "end": 489, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 454, - "end": 488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 458, - "end": 488, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 459, - "end": 465, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 458, - "end": 488, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 472, - "end": 478, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 474, - "end": 478, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 475, - "end": 477, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 479, - "end": 485, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 479, - "end": 480, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 481, - "end": 485, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 465, - "end": 471, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 466, - "end": 470, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 466, - "end": 470, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxEsprimaFbTestSuite.tsx b/crates/swc_ecma_parser/tests/tsc/jsxEsprimaFbTestSuite.tsx deleted file mode 100644 index e18c6ddfc2c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxEsprimaFbTestSuite.tsx +++ /dev/null @@ -1,55 +0,0 @@ -// @jsx: preserve -declare var React: any; -declare var 日本語; -declare var AbC_def; -declare var LeftRight; -declare var x; -declare var a; -declare var props; -declare var value; - -; - -; - - {value} ; - -; - -; -; - -<日本語>; - - -bar -baz -; - - : } />; - -{}; - -{/* this is a comment */}; - -
@test content
; - -

7x invalid-js-identifier
; - - right=monkeys /> gorillas />; - -; - -; - -(
) < x; - -
; - -
; - -
; - - ; diff --git a/crates/swc_ecma_parser/tests/tsc/jsxInvalidEsprimaTestSuite.tsx b/crates/swc_ecma_parser/tests/tsc/jsxInvalidEsprimaTestSuite.tsx deleted file mode 100644 index 5164dc1ce55..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxInvalidEsprimaTestSuite.tsx +++ /dev/null @@ -1,74 +0,0 @@ -// @jsx: preserve -// @filename: 1.tsx -declare var React: any; - -; -// @filename: 2.tsx -; -// @filename: 3.tsx -<:a />; -// @filename: 4.tsx -; -// @filename: 5.tsx -; -// @filename: 6.tsx -
; -// @filename: 7.tsx -; -// @filename: 21.tsx -; -// @filename: 22.tsx -
; -// @filename: 23.tsx -
; - -// @filename: 24.tsx -
stuff
; - -// @filename: 25.tsx -
stuff
; - - -// @filename: 26.tsx -
>; - -// @filename: 27.tsx - >; - -// @filename: 28.tsx -; - -// @filename: 29.tsx -; - -// @filename: 30.tsx -}; - -// @filename: 31.tsx -; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformChildren.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformChildren.json deleted file mode 100644 index f86cab39d33..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformChildren.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 114, - "end": 140, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 120, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 124, - "end": 139, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 125, - "end": 128, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 129, - "end": 133, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 142, - "end": 152, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImport.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImport.json deleted file mode 100644 index a5dc9423cf8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImport.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 142, - "end": 217, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 142, - "end": 205, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXFragment", - "span": { - "start": 152, - "end": 205, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 152, - "end": 154, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 154, - "end": 157, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 157, - "end": 164, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 157, - "end": 160, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 160, - "end": 164, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 164, - "end": 174, - "ctxt": 0 - }, - "value": "\n\n text\n\n ", - "raw": "\n\n text\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 174, - "end": 201, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 174, - "end": 195, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 179, - "end": 194, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 179, - "end": 188, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 189, - "end": 194, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 195, - "end": 201, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 202, - "end": 205, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 207, - "end": 217, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImportPragma.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImportPragma.json deleted file mode 100644 index d7e402dfadc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImportPragma.json +++ /dev/null @@ -1,482 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 169, - "end": 436, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 169, - "end": 232, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 175, - "end": 232, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXFragment", - "span": { - "start": 179, - "end": 232, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 179, - "end": 181, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 184, - "end": 191, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 189, - "end": 190, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 191, - "end": 201, - "ctxt": 0 - }, - "value": "\n\n text\n\n ", - "raw": "\n\n text\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 201, - "end": 228, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 205, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 201, - "end": 222, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 206, - "end": 221, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 206, - "end": 215, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 222, - "end": 228, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 229, - "end": 232, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 234, - "end": 244, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 342, - "end": 360, - "ctxt": 0 - }, - "specifiers": [], - "source": { - "type": "StringLiteral", - "span": { - "start": 349, - "end": 359, - "ctxt": 0 - }, - "value": "./preact", - "raw": "\"./preact\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 361, - "end": 424, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 367, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 367, - "end": 368, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXFragment", - "span": { - "start": 371, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 371, - "end": 373, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 376, - "end": 383, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 377, - "end": 378, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 381, - "end": 382, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 383, - "end": 393, - "ctxt": 0 - }, - "value": "\n\n text\n\n ", - "raw": "\n\n text\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 393, - "end": 420, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 393, - "end": 414, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 398, - "end": 413, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 407, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 408, - "end": 413, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 414, - "end": 420, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 416, - "end": 419, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 420, - "end": 421, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 426, - "end": 436, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyProp.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyProp.json deleted file mode 100644 index 39e24b25d07..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyProp.json +++ /dev/null @@ -1,363 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 250, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 114, - "end": 142, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 120, - "end": 142, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 125, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 128, - "end": 142, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 130, - "end": 136, - "ctxt": 0 - }, - "value": "answer", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 138, - "end": 140, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 143, - "end": 190, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 149, - "end": 189, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 153, - "end": 189, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 154, - "end": 157, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 153, - "end": 179, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 158, - "end": 167, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 179, - "end": 183, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 183, - "end": 189, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 185, - "end": 188, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 191, - "end": 238, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 197, - "end": 237, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 201, - "end": 237, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 205, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 201, - "end": 227, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 210, - "end": 215, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 217, - "end": 226, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 217, - "end": 220, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 221, - "end": 226, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 227, - "end": 231, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 231, - "end": 237, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 240, - "end": 250, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImport.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImport.json deleted file mode 100644 index eb44459e0b8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImport.json +++ /dev/null @@ -1,363 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 142, - "end": 278, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 142, - "end": 170, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 156, - "end": 170, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 158, - "end": 164, - "ctxt": 0 - }, - "value": "answer", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 166, - "end": 168, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 171, - "end": 218, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 177, - "end": 217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 181, - "end": 217, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 182, - "end": 185, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 181, - "end": 207, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 186, - "end": 195, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 190, - "end": 195, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 200, - "end": 205, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 211, - "end": 217, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 219, - "end": 266, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 225, - "end": 265, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 229, - "end": 265, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 229, - "end": 255, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 238, - "end": 243, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 245, - "end": 254, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 249, - "end": 254, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 255, - "end": 259, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 259, - "end": 265, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 268, - "end": 278, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImportPragma.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImportPragma.json deleted file mode 100644 index d02d4ddb3b3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImportPragma.json +++ /dev/null @@ -1,736 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 169, - "end": 564, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 169, - "end": 197, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 175, - "end": 197, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 180, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 183, - "end": 197, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 191, - "ctxt": 0 - }, - "value": "answer", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 193, - "end": 195, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 198, - "end": 245, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 204, - "end": 244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 204, - "end": 205, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 208, - "end": 244, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 208, - "end": 234, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 217, - "end": 222, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 227, - "end": 232, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 238, - "end": 244, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 240, - "end": 243, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 246, - "end": 293, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 252, - "end": 292, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 252, - "end": 253, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 256, - "end": 292, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 257, - "end": 260, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 256, - "end": 282, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 265, - "end": 270, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 272, - "end": 281, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 272, - "end": 275, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 276, - "end": 281, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 282, - "end": 286, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 286, - "end": 292, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 288, - "end": 291, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 295, - "end": 305, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 404, - "end": 422, - "ctxt": 0 - }, - "specifiers": [], - "source": { - "type": "StringLiteral", - "span": { - "start": 411, - "end": 421, - "ctxt": 0 - }, - "value": "./preact", - "raw": "\"./preact\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 423, - "end": 452, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 429, - "end": 452, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 429, - "end": 435, - "ctxt": 0 - }, - "value": "props2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 438, - "end": 452, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 440, - "end": 446, - "ctxt": 0 - }, - "value": "answer", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 448, - "end": 450, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 453, - "end": 502, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 459, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 459, - "end": 461, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 464, - "end": 501, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 465, - "end": 468, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 464, - "end": 491, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 469, - "end": 478, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 469, - "end": 472, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 473, - "end": 478, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 480, - "end": 483, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 483, - "end": 489, - "ctxt": 0 - }, - "value": "props2", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 491, - "end": 495, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 495, - "end": 501, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 503, - "end": 552, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 509, - "end": 551, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 509, - "end": 511, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 514, - "end": 551, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 515, - "end": 518, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 514, - "end": 541, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 520, - "end": 523, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 523, - "end": 529, - "ctxt": 0 - }, - "value": "props2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 531, - "end": 540, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 531, - "end": 534, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 535, - "end": 540, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 541, - "end": 545, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 545, - "end": 551, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 547, - "end": 550, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 554, - "end": 564, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformNestedSelfClosingChild.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformNestedSelfClosingChild.json deleted file mode 100644 index 94dccc7c189..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformNestedSelfClosingChild.json +++ /dev/null @@ -1,714 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 331, - "ctxt": 0 - }, - "body": [ - { - "type": "ImportDeclaration", - "span": { - "start": 114, - "end": 150, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": true, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 152, - "end": 195, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 152, - "end": 195, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 152, - "end": 163, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 152, - "end": 159, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 160, - "end": 163, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "JSXElement", - "span": { - "start": 167, - "end": 193, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 167, - "end": 172, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 177, - "end": 184, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 177, - "end": 184, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 189, - "end": 192, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 197, - "end": 252, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 197, - "end": 252, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 197, - "end": 208, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 197, - "end": 204, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 205, - "end": 208, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "JSXElement", - "span": { - "start": 212, - "end": 250, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 212, - "end": 217, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 217, - "end": 222, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 229, - "end": 234, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 234, - "end": 241, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 234, - "end": 241, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 241, - "end": 244, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 244, - "end": 250, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 246, - "end": 249, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 254, - "end": 331, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 254, - "end": 331, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 254, - "end": 265, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 254, - "end": 261, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "JSXElement", - "span": { - "start": 269, - "end": 329, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 270, - "end": 273, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 274, - "end": 279, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 279, - "end": 320, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 280, - "end": 319, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 280, - "end": 290, - "ctxt": 0 - }, - "object": { - "type": "ArrayExpression", - "span": { - "start": 280, - "end": 286, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 284, - "end": 285, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "property": { - "type": "Identifier", - "span": { - "start": 287, - "end": 290, - "ctxt": 0 - }, - "value": "map", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 291, - "end": 318, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 291, - "end": 292, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 296, - "end": 318, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 296, - "end": 309, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 301, - "end": 308, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 301, - "end": 304, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "value": "i", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 309, - "end": 312, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 310, - "end": 311, - "ctxt": 0 - }, - "value": "i", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 312, - "end": 318, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "JSXText", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 323, - "end": 329, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 325, - "end": 328, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNames.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNames.json deleted file mode 100644 index aed51c0ca1a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNames.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 147, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 114, - "end": 135, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 120, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 124, - "end": 135, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 125, - "end": 128, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 129, - "end": 135, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 131, - "end": 134, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 137, - "end": 147, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNamesFragment.json b/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNamesFragment.json deleted file mode 100644 index ae27b06b57c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNamesFragment.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 114, - "end": 173, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 114, - "end": 161, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 120, - "end": 161, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXFragment", - "span": { - "start": 124, - "end": 161, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 124, - "end": 126, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 129, - "end": 136, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 132, - "end": 136, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 136, - "end": 146, - "ctxt": 0 - }, - "value": "\n\n text\n\n ", - "raw": "\n\n text\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 146, - "end": 157, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 146, - "end": 151, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 151, - "end": 157, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 153, - "end": 156, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExportNamedDeclaration", - "span": { - "start": 163, - "end": 173, - "ctxt": 0 - }, - "specifiers": [], - "source": null, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxParsingError1.tsx b/crates/swc_ecma_parser/tests/tsc/jsxParsingError1.tsx deleted file mode 100644 index 3078223b69a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxParsingError1.tsx +++ /dev/null @@ -1,14 +0,0 @@ -//@jsx: preserve - -//@filename: file.tsx -declare module JSX { - interface Element { } - interface IntrinsicElements { - [s: string]: any; - } -} - -// This should be a parse error -const class1 = "foo"; -const class2 = "bar"; -const elem =
; diff --git a/crates/swc_ecma_parser/tests/tsc/jsxParsingError2.tsx b/crates/swc_ecma_parser/tests/tsc/jsxParsingError2.tsx deleted file mode 100644 index cc418601d68..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxParsingError2.tsx +++ /dev/null @@ -1,28 +0,0 @@ -//@jsx: preserve - -//@filename: file.tsx -declare module JSX { - interface Element { } - interface IntrinsicElements { - [s: string]: any; - } -} - -// @filename: Error1.tsx -// Issue error about missing span closing tag, not missing div closing tag -let x1 =
; - -// @filename: Error2.tsx -let x2 =
; - - -// @filename: Error3.tsx -let x3 =
; - - -// @filename: Error4.tsx -let x4 =
; - -// @filename: Error5.tsx -let x5 =
- diff --git a/crates/swc_ecma_parser/tests/tsc/jsxParsingError3.tsx b/crates/swc_ecma_parser/tests/tsc/jsxParsingError3.tsx deleted file mode 100644 index f7823c49d15..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxParsingError3.tsx +++ /dev/null @@ -1,27 +0,0 @@ -//@jsx: preserve - -//@filename: file.tsx -declare module JSX { - interface Element {} - interface IntrinsicElements { - [s: string]: any; - } -} - -// @filename: Error1.tsx -let x1 =
}
; - -// @filename: Error2.tsx -let x2 =
>
; - -// @filename: Error3.tsx -let x3 =
{"foo"}}
; - -// @filename: Error4.tsx -let x4 =
{"foo"}>
; - -// @filename: Error5.tsx -let x5 =
}{"foo"}
; - -// @filename: Error6.tsx -let x6 =
>{"foo"}
; diff --git a/crates/swc_ecma_parser/tests/tsc/jsxParsingError4.json b/crates/swc_ecma_parser/tests/tsc/jsxParsingError4.json deleted file mode 100644 index ad92460dc28..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxParsingError4.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 60, - "end": 255, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 60, - "end": 84, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 74, - "end": 84, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 79, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 84, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 81, - "end": 84, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 85, - "end": 175, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 103, - "end": 106, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 107, - "end": 175, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 113, - "end": 173, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 140, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 141, - "end": 173, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 152, - "end": 161, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 164, - "end": 167, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 151, - "end": 167, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 177, - "end": 219, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 183, - "end": 218, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 184, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ParenthesisExpression", - "span": { - "start": 187, - "end": 218, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 191, - "end": 216, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 192, - "end": 202, - "ctxt": 0 - }, - "value": "public-foo", - "optional": false - }, - "span": { - "start": 191, - "end": 203, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 203, - "end": 216, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 205, - "end": 215, - "ctxt": 0 - }, - "value": "public-foo", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 221, - "end": 255, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 227, - "end": 254, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 227, - "end": 228, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ParenthesisExpression", - "span": { - "start": 231, - "end": 254, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 235, - "end": 252, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "value": "public", - "optional": false - }, - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 245, - "end": 251, - "ctxt": 0 - }, - "value": "public", - "optional": false - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxReactTestSuite.json b/crates/swc_ecma_parser/tests/tsc/jsxReactTestSuite.json deleted file mode 100644 index 2094881bce4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxReactTestSuite.json +++ /dev/null @@ -1,3749 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 1769, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 19, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 31, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 31, - "end": 36, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 43, - "end": 69, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 55, - "end": 68, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 55, - "end": 64, - "ctxt": 0 - }, - "value": "Component", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 64, - "end": 68, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 65, - "end": 68, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 70, - "end": 96, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 82, - "end": 95, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 82, - "end": 91, - "ctxt": 0 - }, - "value": "Composite", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 91, - "end": 95, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 92, - "end": 95, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 97, - "end": 124, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 109, - "end": 123, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 109, - "end": 119, - "ctxt": 0 - }, - "value": "Composite2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 120, - "end": 123, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 125, - "end": 147, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 137, - "end": 146, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 137, - "end": 142, - "ctxt": 0 - }, - "value": "Child", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 142, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 148, - "end": 174, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 173, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 169, - "ctxt": 0 - }, - "value": "Namespace", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 173, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 170, - "end": 173, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 175, - "end": 196, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 190, - "end": 195, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 197, - "end": 218, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 209, - "end": 217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "value": "bar", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 217, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 219, - "end": 237, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 231, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 236, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 238, - "end": 256, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 250, - "end": 255, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 252, - "end": 255, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 257, - "end": 275, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 270, - "end": 274, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 271, - "end": 274, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 276, - "end": 307, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 288, - "end": 306, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 288, - "end": 302, - "ctxt": 0 - }, - "value": "hasOwnProperty", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 302, - "end": 306, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 309, - "end": 325, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 309, - "end": 324, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 314, - "end": 318, - "ctxt": 0 - }, - "value": "text", - "raw": "text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 318, - "end": 324, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 320, - "end": 323, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 327, - "end": 364, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 327, - "end": 363, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 328, - "end": 331, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 327, - "end": 332, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 332, - "end": 335, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 335, - "end": 356, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 336, - "end": 355, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 336, - "end": 346, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 336, - "end": 340, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 347, - "end": 355, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 356, - "end": 357, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 357, - "end": 363, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 359, - "end": 362, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 366, - "end": 450, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 366, - "end": 449, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 367, - "end": 370, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 366, - "end": 371, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 371, - "end": 374, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 374, - "end": 391, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 375, - "end": 378, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 374, - "end": 379, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 379, - "end": 385, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 380, - "end": 382, - "ctxt": 0 - }, - "value": "br", - "optional": false - }, - "span": { - "start": 379, - "end": 385, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 385, - "end": 391, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 387, - "end": 390, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 391, - "end": 394, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 394, - "end": 433, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 404, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 394, - "end": 405, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 405, - "end": 410, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - { - "type": "JSXElement", - "span": { - "start": 410, - "end": 416, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 411, - "end": 413, - "ctxt": 0 - }, - "value": "br", - "optional": false - }, - "span": { - "start": 410, - "end": 416, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 416, - "end": 421, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 417, - "end": 420, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 421, - "end": 433, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 423, - "end": 432, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 433, - "end": 436, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 436, - "end": 442, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "value": "br", - "optional": false - }, - "span": { - "start": 436, - "end": 442, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 442, - "end": 443, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 443, - "end": 449, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 445, - "end": 448, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 453, - "end": 504, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 453, - "end": 503, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 454, - "end": 463, - "ctxt": 0 - }, - "value": "Composite", - "optional": false - }, - "span": { - "start": 453, - "end": 464, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 464, - "end": 469, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 469, - "end": 490, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 470, - "end": 489, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 470, - "end": 480, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 470, - "end": 474, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 475, - "end": 480, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 481, - "end": 489, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 490, - "end": 491, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 491, - "end": 503, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 493, - "end": 502, - "ctxt": 0 - }, - "value": "Composite", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 506, - "end": 550, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 506, - "end": 549, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 507, - "end": 516, - "ctxt": 0 - }, - "value": "Composite", - "optional": false - }, - "span": { - "start": 506, - "end": 517, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 517, - "end": 522, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 522, - "end": 536, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 523, - "end": 533, - "ctxt": 0 - }, - "value": "Composite2", - "optional": false - }, - "span": { - "start": 522, - "end": 536, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 537, - "end": 549, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 539, - "end": 548, - "ctxt": 0 - }, - "value": "Composite", - "optional": false - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 552, - "end": 784, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 556, - "end": 783, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 556, - "end": 557, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 562, - "end": 783, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 563, - "end": 566, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 562, - "end": 774, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 571, - "end": 604, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 576, - "ctxt": 0 - }, - "value": "attr1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 577, - "end": 604, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 585, - "end": 598, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 585, - "end": 590, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 593, - "end": 598, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 609, - "end": 671, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 609, - "end": 614, - "ctxt": 0 - }, - "value": "attr2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 615, - "end": 671, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 623, - "end": 665, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 623, - "end": 657, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 623, - "end": 636, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 623, - "end": 628, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 631, - "end": 636, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 652, - "end": 657, - "ctxt": 0 - }, - "value": "baz", - "raw": "\"baz\"" - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 660, - "end": 665, - "ctxt": 0 - }, - "value": "bug", - "raw": "\"bug\"" - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 676, - "end": 757, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 676, - "end": 681, - "ctxt": 0 - }, - "value": "attr3", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 682, - "end": 757, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 690, - "end": 725, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 690, - "end": 717, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 690, - "end": 703, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "StringLiteral", - "span": { - "start": 690, - "end": 695, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 698, - "end": 703, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 712, - "end": 717, - "ctxt": 0 - }, - "value": "baz", - "raw": "\"baz\"" - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 720, - "end": 725, - "ctxt": 0 - }, - "value": "bug", - "raw": "\"bug\"" - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 762, - "end": 773, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 762, - "end": 767, - "ctxt": 0 - }, - "value": "attr4", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 768, - "end": 773, - "ctxt": 0 - }, - "value": "baz", - "raw": "\"baz\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 774, - "end": 777, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 777, - "end": 783, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 779, - "end": 782, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 786, - "end": 1063, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 786, - "end": 1062, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 790, - "end": 1060, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 791, - "end": 794, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 790, - "end": 795, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 795, - "end": 800, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 800, - "end": 834, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 833, - "end": 833, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 834, - "end": 839, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 839, - "end": 880, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 879, - "end": 879, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 880, - "end": 885, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 885, - "end": 934, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 886, - "end": 890, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 885, - "end": 891, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 891, - "end": 898, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 898, - "end": 922, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 921, - "end": 921, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 922, - "end": 927, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 927, - "end": 934, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 929, - "end": 933, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 934, - "end": 939, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 939, - "end": 967, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 966, - "end": 966, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 967, - "end": 972, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 972, - "end": 978, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 973, - "end": 975, - "ctxt": 0 - }, - "value": "br", - "optional": false - }, - "span": { - "start": 972, - "end": 978, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 978, - "end": 983, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 983, - "end": 1011, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 1010, - "end": 1010, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1011, - "end": 1016, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1016, - "end": 1051, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 1050, - "end": 1050, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1051, - "end": 1054, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1054, - "end": 1060, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1056, - "end": 1059, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1065, - "end": 1201, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 1065, - "end": 1200, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1069, - "end": 1198, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1070, - "end": 1073, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1069, - "end": 1128, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1116, - "end": 1127, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1121, - "ctxt": 0 - }, - "value": "attr1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1122, - "end": 1127, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1128, - "end": 1133, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 1133, - "end": 1189, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1134, - "end": 1138, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 1133, - "end": 1189, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1171, - "end": 1182, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1171, - "end": 1176, - "ctxt": 0 - }, - "value": "attr2", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1177, - "end": 1182, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 1189, - "end": 1192, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1192, - "end": 1198, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1194, - "end": 1197, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1203, - "end": 1221, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1203, - "end": 1220, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1204, - "end": 1207, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1203, - "end": 1208, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1208, - "end": 1214, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1214, - "end": 1220, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1216, - "end": 1219, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1223, - "end": 1242, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1223, - "end": 1241, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1224, - "end": 1227, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1223, - "end": 1228, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1228, - "end": 1235, - "ctxt": 0 - }, - "value": "  ", - "raw": "  " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1235, - "end": 1241, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1237, - "end": 1240, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1244, - "end": 1285, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1244, - "end": 1284, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1245, - "end": 1259, - "ctxt": 0 - }, - "value": "hasOwnProperty", - "optional": false - }, - "span": { - "start": 1244, - "end": 1260, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1260, - "end": 1267, - "ctxt": 0 - }, - "value": "testing", - "raw": "testing" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1267, - "end": 1284, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1269, - "end": 1283, - "ctxt": 0 - }, - "value": "hasOwnProperty", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1287, - "end": 1319, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1287, - "end": 1318, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1288, - "end": 1297, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1287, - "end": 1318, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1298, - "end": 1315, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1298, - "end": 1309, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1310, - "end": 1315, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1321, - "end": 1345, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1321, - "end": 1344, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 1322, - "end": 1331, - "ctxt": 0 - }, - "value": "Namespace", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1332, - "end": 1341, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "span": { - "start": 1321, - "end": 1344, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1347, - "end": 1385, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1347, - "end": 1384, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 1348, - "end": 1357, - "ctxt": 0 - }, - "value": "Namespace", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1358, - "end": 1371, - "ctxt": 0 - }, - "value": "DeepNamespace", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1372, - "end": 1381, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "span": { - "start": 1347, - "end": 1384, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1387, - "end": 1421, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1387, - "end": 1420, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1388, - "end": 1397, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1387, - "end": 1420, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1400, - "end": 1403, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1404, - "end": 1405, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1408, - "end": 1415, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1408, - "end": 1409, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1411, - "end": 1415, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1412, - "end": 1413, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1416, - "end": 1417, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1416, - "end": 1417, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1423, - "end": 1469, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1423, - "end": 1468, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1424, - "end": 1433, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1423, - "end": 1468, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1439, - "end": 1442, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 1442, - "end": 1452, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1442, - "end": 1446, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1447, - "end": 1452, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1454, - "end": 1465, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1454, - "end": 1459, - "ctxt": 0 - }, - "value": "sound", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1460, - "end": 1465, - "ctxt": 0 - }, - "value": "moo", - "raw": "\"moo\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1471, - "end": 1485, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1471, - "end": 1484, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1472, - "end": 1481, - "ctxt": 0 - }, - "value": "font-face", - "optional": false - }, - "span": { - "start": 1471, - "end": 1484, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1487, - "end": 1507, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1487, - "end": 1506, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1488, - "end": 1497, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1487, - "end": 1506, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1498, - "end": 1503, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1498, - "end": 1499, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1500, - "end": 1503, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1501, - "end": 1502, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1509, - "end": 1525, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1509, - "end": 1524, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1521, - "ctxt": 0 - }, - "value": "x-component", - "optional": false - }, - "span": { - "start": 1509, - "end": 1524, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1527, - "end": 1548, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1527, - "end": 1547, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1528, - "end": 1537, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1527, - "end": 1547, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1539, - "end": 1542, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1542, - "end": 1543, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1550, - "end": 1579, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1550, - "end": 1578, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1551, - "end": 1560, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1550, - "end": 1578, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1563, - "end": 1566, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1566, - "end": 1567, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1570, - "end": 1575, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1570, - "end": 1571, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1572, - "end": 1575, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1573, - "end": 1574, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1581, - "end": 1613, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1581, - "end": 1612, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1582, - "end": 1591, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1581, - "end": 1612, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1594, - "end": 1597, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1598, - "end": 1599, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1602, - "end": 1607, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1602, - "end": 1603, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1604, - "end": 1607, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1605, - "end": 1606, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1608, - "end": 1609, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1608, - "end": 1609, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1615, - "end": 1642, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1615, - "end": 1641, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1616, - "end": 1625, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1615, - "end": 1641, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1626, - "end": 1631, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1626, - "end": 1627, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1628, - "end": 1631, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1629, - "end": 1630, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1633, - "end": 1636, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1636, - "end": 1637, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1645, - "end": 1704, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1645, - "end": 1703, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1646, - "end": 1655, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1645, - "end": 1682, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1656, - "end": 1661, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1656, - "end": 1657, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1658, - "end": 1661, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1659, - "end": 1660, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1662, - "end": 1667, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1662, - "end": 1663, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1664, - "end": 1667, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1669, - "end": 1672, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1672, - "end": 1673, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1676, - "end": 1679, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1679, - "end": 1680, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 1682, - "end": 1691, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1683, - "end": 1688, - "ctxt": 0 - }, - "value": "Child", - "optional": false - }, - "span": { - "start": 1682, - "end": 1691, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1691, - "end": 1703, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1693, - "end": 1702, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1706, - "end": 1769, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 1706, - "end": 1768, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1707, - "end": 1716, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1706, - "end": 1752, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1717, - "end": 1722, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1717, - "end": 1718, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1719, - "end": 1722, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1724, - "end": 1727, - "ctxt": 0 - }, - "arguments": { - "type": "ParenthesisExpression", - "span": { - "start": 1727, - "end": 1744, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 1728, - "end": 1743, - "ctxt": 0 - }, - "expressions": [ - { - "type": "AssignmentExpression", - "span": { - "start": 1728, - "end": 1740, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1728, - "end": 1729, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 1732, - "end": 1740, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1734, - "end": 1735, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1737, - "end": 1738, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - } - }, - { - "type": "Identifier", - "span": { - "start": 1742, - "end": 1743, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1746, - "end": 1751, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1746, - "end": 1747, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1748, - "end": 1751, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1749, - "end": 1750, - "ctxt": 0 - }, - "value": 3.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1752, - "end": 1756, - "ctxt": 0 - }, - "value": "Text", - "raw": "Text" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1756, - "end": 1768, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1758, - "end": 1767, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/jsxSpreadOverwritesAttributeStrict.json b/crates/swc_ecma_parser/tests/tsc/jsxSpreadOverwritesAttributeStrict.json deleted file mode 100644 index bec9868d765..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/jsxSpreadOverwritesAttributeStrict.json +++ /dev/null @@ -1,1501 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 132, - "end": 649, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 132, - "end": 164, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 139, - "end": 144, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 147, - "end": 163, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 155, - "end": 162, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 166, - "end": 247, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 182, - "end": 247, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 188, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 213, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 218, - "end": 229, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 218, - "end": 219, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 220, - "end": 228, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 222, - "end": 228, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 234, - "end": 245, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 236, - "end": 244, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 238, - "end": 244, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 250, - "end": 286, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 256, - "end": 285, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 256, - "end": 261, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 261, - "end": 268, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 271, - "end": 285, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 279, - "end": 280, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 282, - "end": 283, - "ctxt": 0 - }, - "value": 1.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 287, - "end": 340, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 293, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 296, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 299, - "end": 339, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 300, - "end": 312, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 305, - "end": 312, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 307, - "end": 312, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 307, - "end": 312, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "typeParams": null - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 317, - "end": 339, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 321, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 317, - "end": 322, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 322, - "end": 333, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 324, - "end": 331, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 324, - "end": 329, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 330, - "end": 331, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 333, - "end": 339, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 335, - "end": 338, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 348, - "end": 382, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 354, - "end": 381, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 354, - "end": 356, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 359, - "end": 381, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 360, - "end": 363, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 359, - "end": 375, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 368, - "end": 373, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 375, - "end": 381, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 383, - "end": 423, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 389, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 389, - "end": 391, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 394, - "end": 422, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 398, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 394, - "end": 416, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 399, - "end": 404, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 399, - "end": 400, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 402, - "end": 403, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 409, - "end": 414, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 416, - "end": 422, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 421, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 434, - "end": 474, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 440, - "end": 473, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 440, - "end": 442, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 445, - "end": 473, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 446, - "end": 449, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 445, - "end": 467, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 450, - "end": 455, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 450, - "end": 451, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 452, - "end": 455, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 453, - "end": 454, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 457, - "end": 460, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 460, - "end": 465, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 467, - "end": 473, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 469, - "end": 472, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 475, - "end": 521, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 481, - "end": 520, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 481, - "end": 483, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 486, - "end": 520, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 486, - "end": 514, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 491, - "end": 496, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 491, - "end": 492, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 493, - "end": 496, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 497, - "end": 502, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 499, - "end": 502, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 504, - "end": 507, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 507, - "end": 512, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 514, - "end": 520, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 516, - "end": 519, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 522, - "end": 582, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 528, - "end": 581, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 528, - "end": 530, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 533, - "end": 581, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 534, - "end": 537, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 533, - "end": 575, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 538, - "end": 543, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 538, - "end": 539, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 540, - "end": 543, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 541, - "end": 542, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 544, - "end": 549, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 544, - "end": 545, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 546, - "end": 549, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 547, - "end": 548, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 551, - "end": 554, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 554, - "end": 559, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 562, - "end": 565, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 565, - "end": 573, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 567, - "end": 568, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 570, - "end": 571, - "ctxt": 0 - }, - "value": 1.0 - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 575, - "end": 581, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 577, - "end": 580, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 583, - "end": 649, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 589, - "end": 648, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 589, - "end": 591, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 594, - "end": 648, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 595, - "end": 598, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 594, - "end": 642, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 599, - "end": 604, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 599, - "end": 600, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 601, - "end": 604, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 602, - "end": 603, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 605, - "end": 610, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 605, - "end": 606, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 607, - "end": 610, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 608, - "end": 609, - "ctxt": 0 - }, - "value": 1.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 612, - "end": 615, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 615, - "end": 620, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 623, - "end": 626, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 626, - "end": 640, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 628, - "end": 629, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 631, - "end": 632, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 634, - "end": 635, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 637, - "end": 638, - "ctxt": 0 - }, - "value": 1.0 - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 642, - "end": 648, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 644, - "end": 647, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.json b/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.json index 305d68719dc..b4ab93db85b 100644 --- a/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.json +++ b/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 1, - "end": 3783, + "end": 4018, "ctxt": 0 }, "body": [ @@ -8602,6 +8602,554 @@ ] }, "returnType": null + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3813, + "end": 3817, + "ctxt": 0 + }, + "value": "Test", + "optional": false + }, + "declare": false, + "span": { + "start": 3807, + "end": 4018, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 3856, + "end": 3865, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 3856, + "end": 3861, + "ctxt": 0 + }, + "value": "testy", + "optional": false + }, + "value": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3861, + "end": 3864, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3863, + "end": 3864, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3863, + "end": 3864, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": false + }, + { + "type": "Constructor", + "span": { + "start": 3869, + "end": 3912, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 3869, + "end": 3880, + "ctxt": 0 + }, + "value": "constructor", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3881, + "end": 3885, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3881, + "end": 3885, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3882, + "end": 3885, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3884, + "end": 3885, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3884, + "end": 3885, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 3887, + "end": 3912, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3893, + "end": 3908, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3893, + "end": 3907, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 3893, + "end": 3903, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 3893, + "end": 3897, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 3898, + "end": 3903, + "ctxt": 0 + }, + "value": "testy", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 3906, + "end": 3907, + "ctxt": 0 + }, + "value": "t", + "optional": false + } + } + } + ] + }, + "accessibility": null, + "isOptional": false + }, + { + "type": "ClassMethod", + "span": { + "start": 3916, + "end": 4016, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 3923, + "end": 3924, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "function": { + "params": [ + { + "type": "Parameter", + "span": { + "start": 3925, + "end": 3937, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3925, + "end": 3937, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3928, + "end": 3937, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 3930, + "end": 3937, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3936, + "end": 3937, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3936, + "end": 3937, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3916, + "end": 4016, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3947, + "end": 4016, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3953, + "end": 3974, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3953, + "end": 3973, + "ctxt": 0 + }, + "operator": "+=", + "left": { + "type": "MemberExpression", + "span": { + "start": 3953, + "end": 3968, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 3953, + "end": 3963, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 3953, + "end": 3957, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 3958, + "end": 3963, + "ctxt": 0 + }, + "value": "testy", + "optional": false + } + }, + "property": { + "type": "Computed", + "span": { + "start": 3963, + "end": 3968, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3964, + "end": 3967, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 3972, + "end": 3973, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 3989, + "end": 4012, + "ctxt": 0 + }, + "argument": { + "type": "MemberExpression", + "span": { + "start": 3996, + "end": 4011, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 3996, + "end": 4006, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 3996, + "end": 4000, + "ctxt": 0 + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 4001, + "end": 4006, + "ctxt": 0 + }, + "value": "testy", + "optional": false + } + }, + "property": { + "type": "Computed", + "span": { + "start": 4006, + "end": 4011, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 4007, + "end": 4010, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 3938, + "end": 3946, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 3940, + "end": 3946, + "ctxt": 0 + }, + "kind": "number" + } + } + }, + "kind": "method", + "isStatic": false, + "accessibility": "public", + "isAbstract": false, + "isOptional": false, + "isOverride": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3817, + "end": 3851, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3818, + "end": 3850, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3818, + "end": 3819, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 3828, + "end": 3850, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3828, + "end": 3834, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 3834, + "end": 3850, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 3835, + "end": 3841, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 3843, + "end": 3849, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + }, + "default": null + } + ] + }, + "superTypeParams": null, + "implements": [] } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.ts b/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.ts index 8058a02a80d..409e405abd5 100644 --- a/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.ts +++ b/crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.ts @@ -151,3 +151,19 @@ function f30() { function f31() { let x: Partial>>>>>>>[K] = "hello"; } + +// Repro from #51069 + +class Test> { + testy: T; + + constructor(t: T) { + this.testy = t; + } + + public t(key: keyof T): number { + this.testy[key] += 1; // Error + + return this.testy[key]; + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.json b/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.json new file mode 100644 index 00000000000..b4183fd0868 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.json @@ -0,0 +1,396 @@ +{ + "type": "Module", + "span": { + "start": 136, + "end": 403, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 136, + "end": 159, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 143, + "end": 159, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 153, + "end": 156, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 157, + "end": 159, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 180, + "end": 205, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "span": { + "start": 187, + "end": 193, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 192, + "end": 193, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 199, + "end": 204, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 206, + "end": 318, + "ctxt": 0 + }, + "declare": true, + "global": true, + "id": { + "type": "Identifier", + "span": { + "start": 214, + "end": 220, + "ctxt": 0 + }, + "value": "global", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 221, + "end": 318, + "ctxt": 0 + }, + "body": [ + { + "type": "TsModuleDeclaration", + "span": { + "start": 225, + "end": 316, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 235, + "end": 240, + "ctxt": 0 + }, + "value": "teams", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 241, + "end": 316, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 247, + "end": 312, + "ctxt": 0 + }, + "declaration": { + "type": "TsModuleDeclaration", + "span": { + "start": 254, + "end": 312, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 264, + "end": 271, + "ctxt": 0 + }, + "value": "calling", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 272, + "end": 312, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 280, + "end": 306, + "ctxt": 0 + }, + "declare": false, + "isExport": true, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 300, + "end": 301, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 302, + "end": 305, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + } + } + } + ] + } + } + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 339, + "end": 368, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 344, + "end": 347, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 350, + "end": 367, + "ctxt": 0 + }, + "typeName": { + "type": "TsQualifiedName", + "left": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 350, + "end": 355, + "ctxt": 0 + }, + "value": "teams", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 356, + "end": 363, + "ctxt": 0 + }, + "value": "calling", + "optional": false + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 364, + "end": 367, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + } + }, + "typeParams": null + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 369, + "end": 403, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 376, + "end": 403, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 382, + "end": 403, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 382, + "end": 385, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 388, + "end": 403, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 389, + "end": 396, + "ctxt": 0 + }, + "value": "p", + "optional": true, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 391, + "end": 396, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 393, + "end": 396, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 393, + "end": 396, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 401, + "end": 403, + "ctxt": 0 + }, + "stmts": [] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.ts b/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.ts new file mode 100644 index 00000000000..f22262cb82c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.ts @@ -0,0 +1,22 @@ +// @module: esnext +// @outDir: dist +// @declaration: true +// @emitDeclarationOnly: true +// @strictNullChecks: true + +// @Filename: a.ts +export interface Foo {} + +// @Filename: b.ts +import * as a from "./a"; +declare global { + namespace teams { + export namespace calling { + export import Foo = a.Foo; + } + } +} + +// @Filename: c.ts +type Foo = teams.calling.Foo; +export const bar = (p?: Foo) => {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/letIdentifierInElementAccess01.ts b/crates/swc_ecma_parser/tests/tsc/letIdentifierInElementAccess01.ts index 6cf922f9784..92f7ef9edc7 100644 --- a/crates/swc_ecma_parser/tests/tsc/letIdentifierInElementAccess01.ts +++ b/crates/swc_ecma_parser/tests/tsc/letIdentifierInElementAccess01.ts @@ -1,2 +1,2 @@ -var let: any = {}; +var let: any = {}; (let[0] = 100); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.json b/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.json deleted file mode 100644 index c6333090eef..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.json +++ /dev/null @@ -1,4315 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 29, - "end": 1398, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 29, - "end": 43, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 35, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 57, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 50, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 54, - "end": 56, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 58, - "end": 70, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 64, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 64, - "end": 65, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 68, - "end": 69, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 71, - "end": 87, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 77, - "end": 86, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 77, - "end": 78, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BooleanLiteral", - "span": { - "start": 81, - "end": 86, - "ctxt": 0 - }, - "value": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 88, - "end": 114, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 94, - "end": 113, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 95, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 101, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 97, - "end": 101, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": { - "type": "Identifier", - "span": { - "start": 104, - "end": 113, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 115, - "end": 135, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 121, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 121, - "end": 122, - "ctxt": 0 - }, - "value": "u", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 125, - "end": 134, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 151, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 142, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NullLiteral", - "span": { - "start": 146, - "end": 150, - "ctxt": 0 - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 152, - "end": 174, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 158, - "end": 173, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 162, - "end": 173, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "BinaryExpression", - "span": { - "start": 162, - "end": 168, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 176, - "end": 194, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 182, - "end": 193, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 187, - "end": 188, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 195, - "end": 213, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 201, - "end": 212, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 201, - "end": 203, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 206, - "end": 207, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 214, - "end": 232, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 220, - "end": 231, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 220, - "end": 222, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 225, - "end": 231, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 233, - "end": 251, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 239, - "end": 250, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 239, - "end": 241, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 244, - "end": 250, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 252, - "end": 270, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 258, - "end": 269, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 258, - "end": 260, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 263, - "end": 269, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 268, - "end": 269, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 271, - "end": 289, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 277, - "end": 288, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 277, - "end": 279, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 282, - "end": 288, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 282, - "end": 283, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 287, - "end": 288, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 290, - "end": 308, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 296, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 296, - "end": 298, - "ctxt": 0 - }, - "value": "a7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 301, - "end": 307, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 301, - "end": 302, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 327, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 315, - "end": 326, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 315, - "end": 317, - "ctxt": 0 - }, - "value": "a8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 320, - "end": 326, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 325, - "end": 326, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 329, - "end": 347, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 335, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 335, - "end": 337, - "ctxt": 0 - }, - "value": "s1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 340, - "end": 341, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 345, - "end": 346, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 348, - "end": 366, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 354, - "end": 365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 354, - "end": 356, - "ctxt": 0 - }, - "value": "s2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 359, - "end": 365, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 364, - "end": 365, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 367, - "end": 385, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 373, - "end": 384, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 373, - "end": 375, - "ctxt": 0 - }, - "value": "s3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 378, - "end": 384, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 383, - "end": 384, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 386, - "end": 404, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 392, - "end": 403, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 392, - "end": 394, - "ctxt": 0 - }, - "value": "s4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 397, - "end": 403, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 397, - "end": 398, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 402, - "end": 403, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 405, - "end": 423, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 411, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 411, - "end": 413, - "ctxt": 0 - }, - "value": "s5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 416, - "end": 422, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 416, - "end": 417, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 424, - "end": 442, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 441, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 432, - "ctxt": 0 - }, - "value": "s6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 435, - "end": 441, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 440, - "end": 441, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 443, - "end": 461, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 449, - "end": 460, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 449, - "end": 451, - "ctxt": 0 - }, - "value": "s7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 454, - "end": 460, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 459, - "end": 460, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 462, - "end": 480, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 468, - "end": 479, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 468, - "end": 470, - "ctxt": 0 - }, - "value": "s8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 473, - "end": 479, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 473, - "end": 474, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 482, - "end": 500, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 488, - "end": 499, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 488, - "end": 490, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 493, - "end": 499, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 493, - "end": 494, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 498, - "end": 499, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 501, - "end": 519, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 507, - "end": 518, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 507, - "end": 509, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 512, - "end": 518, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 512, - "end": 513, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 517, - "end": 518, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 520, - "end": 538, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 526, - "end": 537, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 526, - "end": 528, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 531, - "end": 537, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 531, - "end": 532, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 539, - "end": 557, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 545, - "end": 556, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 545, - "end": 547, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 550, - "end": 556, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 550, - "end": 551, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 555, - "end": 556, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 558, - "end": 576, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 564, - "end": 575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 564, - "end": 566, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 569, - "end": 575, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 569, - "end": 570, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 574, - "end": 575, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 577, - "end": 595, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 583, - "end": 594, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 583, - "end": 585, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 588, - "end": 594, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 588, - "end": 589, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 593, - "end": 594, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 596, - "end": 614, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 602, - "end": 613, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 602, - "end": 604, - "ctxt": 0 - }, - "value": "x7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 607, - "end": 613, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 607, - "end": 608, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 612, - "end": 613, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 615, - "end": 633, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 621, - "end": 632, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 621, - "end": 623, - "ctxt": 0 - }, - "value": "x8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 626, - "end": 632, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 626, - "end": 627, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 631, - "end": 632, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 635, - "end": 653, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 641, - "end": 652, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 641, - "end": 643, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 646, - "end": 652, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 646, - "end": 647, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 654, - "end": 672, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 660, - "end": 671, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 660, - "end": 662, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 665, - "end": 666, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 670, - "end": 671, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 673, - "end": 691, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 679, - "end": 690, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 679, - "end": 681, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 684, - "end": 690, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 684, - "end": 685, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 689, - "end": 690, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 692, - "end": 710, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 698, - "end": 709, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 698, - "end": 700, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 703, - "end": 709, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 703, - "end": 704, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 708, - "end": 709, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 711, - "end": 729, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 717, - "end": 728, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 717, - "end": 719, - "ctxt": 0 - }, - "value": "b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 722, - "end": 728, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 722, - "end": 723, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 727, - "end": 728, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 730, - "end": 748, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 736, - "end": 747, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 736, - "end": 738, - "ctxt": 0 - }, - "value": "b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 741, - "end": 747, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 741, - "end": 742, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 746, - "end": 747, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 749, - "end": 767, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 755, - "end": 766, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 755, - "end": 757, - "ctxt": 0 - }, - "value": "b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 760, - "end": 766, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 760, - "end": 761, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 765, - "end": 766, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 768, - "end": 786, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 774, - "end": 785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 774, - "end": 776, - "ctxt": 0 - }, - "value": "b8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 779, - "end": 785, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 779, - "end": 780, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 784, - "end": 785, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 788, - "end": 806, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 794, - "end": 805, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 794, - "end": 796, - "ctxt": 0 - }, - "value": "v1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 799, - "end": 805, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 799, - "end": 800, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 804, - "end": 805, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 807, - "end": 825, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 813, - "end": 824, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 813, - "end": 815, - "ctxt": 0 - }, - "value": "v2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 818, - "end": 824, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 818, - "end": 819, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 823, - "end": 824, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 826, - "end": 844, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 832, - "end": 843, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 832, - "end": 834, - "ctxt": 0 - }, - "value": "v3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 837, - "end": 843, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 837, - "end": 838, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 842, - "end": 843, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 845, - "end": 863, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 851, - "end": 862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 851, - "end": 853, - "ctxt": 0 - }, - "value": "v4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 856, - "end": 862, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 856, - "end": 857, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 861, - "end": 862, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 864, - "end": 882, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 870, - "end": 881, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 870, - "end": 872, - "ctxt": 0 - }, - "value": "v5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 875, - "end": 881, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 875, - "end": 876, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 880, - "end": 881, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 883, - "end": 901, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 889, - "end": 900, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 889, - "end": 891, - "ctxt": 0 - }, - "value": "v6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 894, - "end": 900, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 894, - "end": 895, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 899, - "end": 900, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 902, - "end": 920, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 908, - "end": 919, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 908, - "end": 910, - "ctxt": 0 - }, - "value": "v7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 913, - "end": 919, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 913, - "end": 914, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 918, - "end": 919, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 921, - "end": 939, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 927, - "end": 938, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 927, - "end": 929, - "ctxt": 0 - }, - "value": "v8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 932, - "end": 938, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 932, - "end": 933, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 941, - "end": 959, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 947, - "end": 958, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 947, - "end": 949, - "ctxt": 0 - }, - "value": "u1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 952, - "end": 958, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 952, - "end": 953, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 957, - "end": 958, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 960, - "end": 978, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 966, - "end": 977, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 966, - "end": 968, - "ctxt": 0 - }, - "value": "u2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 971, - "end": 977, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 971, - "end": 972, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 976, - "end": 977, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 979, - "end": 997, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 985, - "end": 996, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 985, - "end": 987, - "ctxt": 0 - }, - "value": "u3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 990, - "end": 996, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 990, - "end": 991, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 995, - "end": 996, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 998, - "end": 1016, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1004, - "end": 1015, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1004, - "end": 1006, - "ctxt": 0 - }, - "value": "u4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1009, - "end": 1015, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1009, - "end": 1010, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1014, - "end": 1015, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1017, - "end": 1035, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1023, - "end": 1034, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1023, - "end": 1025, - "ctxt": 0 - }, - "value": "u5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1028, - "end": 1034, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1028, - "end": 1029, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1033, - "end": 1034, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1036, - "end": 1054, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1042, - "end": 1053, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1042, - "end": 1044, - "ctxt": 0 - }, - "value": "u6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1047, - "end": 1053, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1048, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1052, - "end": 1053, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1055, - "end": 1073, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1061, - "end": 1072, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1061, - "end": 1063, - "ctxt": 0 - }, - "value": "u7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1066, - "end": 1072, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1066, - "end": 1067, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1072, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1074, - "end": 1092, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1080, - "end": 1091, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1080, - "end": 1082, - "ctxt": 0 - }, - "value": "u8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1085, - "end": 1091, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1085, - "end": 1086, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1090, - "end": 1091, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1094, - "end": 1112, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1100, - "end": 1111, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1102, - "ctxt": 0 - }, - "value": "n1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1105, - "end": 1111, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1105, - "end": 1106, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1111, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1113, - "end": 1131, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1119, - "end": 1130, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1121, - "ctxt": 0 - }, - "value": "n2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1124, - "end": 1130, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1124, - "end": 1125, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1129, - "end": 1130, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1132, - "end": 1150, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1138, - "end": 1149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1138, - "end": 1140, - "ctxt": 0 - }, - "value": "n3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1143, - "end": 1149, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1144, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1148, - "end": 1149, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1151, - "end": 1169, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1157, - "end": 1168, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1157, - "end": 1159, - "ctxt": 0 - }, - "value": "n4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1162, - "end": 1168, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1162, - "end": 1163, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1167, - "end": 1168, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1170, - "end": 1188, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1176, - "end": 1187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1176, - "end": 1178, - "ctxt": 0 - }, - "value": "n5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1181, - "end": 1187, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1181, - "end": 1182, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1186, - "end": 1187, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1189, - "end": 1207, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1195, - "end": 1206, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1195, - "end": 1197, - "ctxt": 0 - }, - "value": "n6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1200, - "end": 1206, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1200, - "end": 1201, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1205, - "end": 1206, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1208, - "end": 1226, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1214, - "end": 1225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1214, - "end": 1216, - "ctxt": 0 - }, - "value": "n7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1219, - "end": 1225, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1219, - "end": 1220, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1224, - "end": 1225, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1227, - "end": 1245, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1233, - "end": 1244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1233, - "end": 1235, - "ctxt": 0 - }, - "value": "n8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1238, - "end": 1244, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1238, - "end": 1239, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1243, - "end": 1244, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1247, - "end": 1265, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1253, - "end": 1264, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1253, - "end": 1255, - "ctxt": 0 - }, - "value": "z1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1258, - "end": 1264, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1258, - "end": 1259, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1263, - "end": 1264, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1266, - "end": 1284, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1272, - "end": 1283, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1272, - "end": 1274, - "ctxt": 0 - }, - "value": "z2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1277, - "end": 1283, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1277, - "end": 1278, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1282, - "end": 1283, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1285, - "end": 1303, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1291, - "end": 1302, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1291, - "end": 1293, - "ctxt": 0 - }, - "value": "z3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1296, - "end": 1302, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1296, - "end": 1297, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1301, - "end": 1302, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1304, - "end": 1322, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1310, - "end": 1321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1310, - "end": 1312, - "ctxt": 0 - }, - "value": "z4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1315, - "end": 1321, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1315, - "end": 1316, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1320, - "end": 1321, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1323, - "end": 1341, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1329, - "end": 1340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1329, - "end": 1331, - "ctxt": 0 - }, - "value": "z5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1334, - "end": 1340, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1334, - "end": 1335, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1339, - "end": 1340, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1342, - "end": 1360, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1348, - "end": 1359, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1348, - "end": 1350, - "ctxt": 0 - }, - "value": "z6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1353, - "end": 1359, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1353, - "end": 1354, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1358, - "end": 1359, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1361, - "end": 1379, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1367, - "end": 1378, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1367, - "end": 1369, - "ctxt": 0 - }, - "value": "z7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1372, - "end": 1378, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1372, - "end": 1373, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1377, - "end": 1378, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1380, - "end": 1398, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1386, - "end": 1397, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1386, - "end": 1388, - "ctxt": 0 - }, - "value": "z8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1391, - "end": 1397, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1391, - "end": 1392, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1396, - "end": 1397, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.ts b/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.ts deleted file mode 100644 index c4e385db100..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorStrictMode.ts +++ /dev/null @@ -1,82 +0,0 @@ -// @strictNullChecks: true - -const a = [0]; -const s = ""; -const x = 0; -const b = false; -const v: void = undefined; -const u = undefined; -const n = null; -const z = s || x || u; - -const a1 = a && a; -const a2 = a && s; -const a3 = a && x; -const a4 = a && b; -const a5 = a && v; -const a6 = a && u; -const a7 = a && n; -const a8 = a && z; - -const s1 = s && a; -const s2 = s && s; -const s3 = s && x; -const s4 = s && b; -const s5 = s && v; -const s6 = s && u; -const s7 = s && n; -const s8 = s && z; - -const x1 = x && a; -const x2 = x && s; -const x3 = x && x; -const x4 = x && b; -const x5 = x && v; -const x6 = x && u; -const x7 = x && n; -const x8 = x && z; - -const b1 = b && a; -const b2 = b && s; -const b3 = b && x; -const b4 = b && b; -const b5 = b && v; -const b6 = b && u; -const b7 = b && n; -const b8 = b && z; - -const v1 = v && a; -const v2 = v && s; -const v3 = v && x; -const v4 = v && b; -const v5 = v && v; -const v6 = v && u; -const v7 = v && n; -const v8 = v && z; - -const u1 = u && a; -const u2 = u && s; -const u3 = u && x; -const u4 = u && b; -const u5 = u && v; -const u6 = u && u; -const u7 = u && n; -const u8 = u && z; - -const n1 = n && a; -const n2 = n && s; -const n3 = n && x; -const n4 = n && b; -const n5 = n && v; -const n6 = n && u; -const n7 = n && n; -const n8 = n && z; - -const z1 = z && a; -const z2 = z && s; -const z3 = z && x; -const z4 = z && b; -const z5 = z && v; -const z6 = z && u; -const z7 = z && n; -const z8 = z && z; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.json b/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.json deleted file mode 100644 index 436c3a033bd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.json +++ /dev/null @@ -1,6560 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 125, - "end": 2460, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 125, - "end": 143, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 137, - "end": 138, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 145, - "end": 157, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 149, - "end": 156, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 151, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 151, - "end": 156, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 153, - "end": 156, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 158, - "end": 174, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 162, - "end": 173, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 162, - "end": 164, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 173, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 166, - "end": 173, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 175, - "end": 189, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 179, - "end": 189, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 179, - "end": 181, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 181, - "end": 189, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 183, - "end": 189, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 190, - "end": 205, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 194, - "end": 204, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 206, - "end": 219, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 210, - "end": 218, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 212, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 218, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 220, - "end": 230, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 224, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 224, - "end": 226, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 226, - "end": 229, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 228, - "end": 229, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 235, - "end": 241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "a7", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 241, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 239, - "end": 241, - "ctxt": 0 - }, - "members": [] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 243, - "end": 260, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 247, - "end": 259, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 247, - "end": 249, - "ctxt": 0 - }, - "value": "a8", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 249, - "end": 259, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 251, - "end": 259, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 251, - "end": 257, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 262, - "end": 281, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 266, - "end": 269, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 272, - "end": 280, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 272, - "end": 274, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 278, - "end": 280, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 282, - "end": 301, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 286, - "end": 300, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 292, - "end": 300, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 292, - "end": 294, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 298, - "end": 300, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 302, - "end": 321, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 306, - "end": 320, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 306, - "end": 309, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 312, - "end": 320, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 312, - "end": 314, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 318, - "end": 320, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 322, - "end": 341, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 326, - "end": 340, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 326, - "end": 329, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 332, - "end": 340, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 332, - "end": 334, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 338, - "end": 340, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 342, - "end": 361, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 346, - "end": 360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 352, - "end": 360, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 358, - "end": 360, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 362, - "end": 381, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 366, - "end": 380, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 366, - "end": 369, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 372, - "end": 380, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 372, - "end": 374, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 378, - "end": 380, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 382, - "end": 401, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 386, - "end": 400, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 386, - "end": 389, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 392, - "end": 400, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 392, - "end": 394, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 402, - "end": 421, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 406, - "end": 420, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "value": "ra8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 412, - "end": 420, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 412, - "end": 414, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 418, - "end": 420, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 422, - "end": 443, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 426, - "end": 442, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 426, - "end": 429, - "ctxt": 0 - }, - "value": "ra9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 432, - "end": 442, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 432, - "end": 436, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 440, - "end": 442, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 444, - "end": 471, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 448, - "end": 470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 448, - "end": 452, - "ctxt": 0 - }, - "value": "ra10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 455, - "end": 470, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 455, - "end": 464, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 468, - "end": 470, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 473, - "end": 492, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 477, - "end": 491, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 477, - "end": 480, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 483, - "end": 491, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 483, - "end": 485, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 489, - "end": 491, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 512, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 511, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 503, - "end": 511, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 503, - "end": 505, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 509, - "end": 511, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 532, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 517, - "end": 531, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 517, - "end": 520, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 523, - "end": 531, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 523, - "end": 525, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 529, - "end": 531, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 533, - "end": 552, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 537, - "end": 551, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 537, - "end": 540, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 543, - "end": 551, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 543, - "end": 545, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 549, - "end": 551, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 553, - "end": 572, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 557, - "end": 571, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 557, - "end": 560, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 563, - "end": 571, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 563, - "end": 565, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 569, - "end": 571, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 573, - "end": 592, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 577, - "end": 591, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 577, - "end": 580, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 583, - "end": 591, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 583, - "end": 585, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 589, - "end": 591, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 593, - "end": 612, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 597, - "end": 611, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 597, - "end": 600, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 603, - "end": 611, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 603, - "end": 605, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 609, - "end": 611, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 613, - "end": 632, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 617, - "end": 631, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "value": "rb8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 623, - "end": 631, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 623, - "end": 625, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 629, - "end": 631, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 633, - "end": 654, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 637, - "end": 653, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 637, - "end": 640, - "ctxt": 0 - }, - "value": "rb9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 643, - "end": 653, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 643, - "end": 647, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 651, - "end": 653, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 655, - "end": 682, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 659, - "end": 681, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 659, - "end": 663, - "ctxt": 0 - }, - "value": "rb10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 666, - "end": 681, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 666, - "end": 675, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 679, - "end": 681, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 684, - "end": 703, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 688, - "end": 702, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 688, - "end": 691, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 694, - "end": 702, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 694, - "end": 696, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 700, - "end": 702, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 704, - "end": 723, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 708, - "end": 722, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 708, - "end": 711, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 714, - "end": 722, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 714, - "end": 716, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 720, - "end": 722, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 724, - "end": 743, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 728, - "end": 742, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 728, - "end": 731, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 734, - "end": 742, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 734, - "end": 736, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 740, - "end": 742, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 744, - "end": 763, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 748, - "end": 762, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 748, - "end": 751, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 754, - "end": 762, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 754, - "end": 756, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 760, - "end": 762, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 764, - "end": 783, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 768, - "end": 782, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 768, - "end": 771, - "ctxt": 0 - }, - "value": "rc5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 774, - "end": 782, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 774, - "end": 776, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 780, - "end": 782, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 784, - "end": 803, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 788, - "end": 802, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 788, - "end": 791, - "ctxt": 0 - }, - "value": "rc6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 794, - "end": 802, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 794, - "end": 796, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 800, - "end": 802, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 804, - "end": 823, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 808, - "end": 822, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 808, - "end": 811, - "ctxt": 0 - }, - "value": "rc7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 814, - "end": 822, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 814, - "end": 816, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 820, - "end": 822, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 824, - "end": 843, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 828, - "end": 842, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 828, - "end": 831, - "ctxt": 0 - }, - "value": "rc8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 834, - "end": 842, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 834, - "end": 836, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 840, - "end": 842, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 844, - "end": 865, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 848, - "end": 864, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 848, - "end": 851, - "ctxt": 0 - }, - "value": "rc9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 854, - "end": 864, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 854, - "end": 858, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 862, - "end": 864, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 866, - "end": 893, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 870, - "end": 892, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 870, - "end": 874, - "ctxt": 0 - }, - "value": "rc10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 877, - "end": 892, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 877, - "end": 886, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 890, - "end": 892, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 895, - "end": 914, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 899, - "end": 913, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 899, - "end": 902, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 905, - "end": 913, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 905, - "end": 907, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 911, - "end": 913, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 915, - "end": 934, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 919, - "end": 933, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 919, - "end": 922, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 925, - "end": 933, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 925, - "end": 927, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 931, - "end": 933, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 935, - "end": 954, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 939, - "end": 953, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 939, - "end": 942, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 945, - "end": 953, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 945, - "end": 947, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 951, - "end": 953, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 955, - "end": 974, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 959, - "end": 973, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 959, - "end": 962, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 965, - "end": 973, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 965, - "end": 967, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 971, - "end": 973, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 975, - "end": 994, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 979, - "end": 993, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 979, - "end": 982, - "ctxt": 0 - }, - "value": "rd5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 985, - "end": 993, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 985, - "end": 987, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 991, - "end": 993, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 995, - "end": 1014, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 999, - "end": 1013, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 999, - "end": 1002, - "ctxt": 0 - }, - "value": "rd6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1005, - "end": 1013, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1007, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1011, - "end": 1013, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1015, - "end": 1034, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1019, - "end": 1033, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1019, - "end": 1022, - "ctxt": 0 - }, - "value": "rd7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1025, - "end": 1033, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1025, - "end": 1027, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1031, - "end": 1033, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1035, - "end": 1054, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1039, - "end": 1053, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1039, - "end": 1042, - "ctxt": 0 - }, - "value": "rd8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1045, - "end": 1053, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1045, - "end": 1047, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1051, - "end": 1053, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1055, - "end": 1076, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1059, - "end": 1075, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1059, - "end": 1062, - "ctxt": 0 - }, - "value": "rd9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1065, - "end": 1075, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1065, - "end": 1069, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1073, - "end": 1075, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1077, - "end": 1104, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1081, - "end": 1103, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1081, - "end": 1085, - "ctxt": 0 - }, - "value": "rd10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1088, - "end": 1103, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1088, - "end": 1097, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1101, - "end": 1103, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1106, - "end": 1125, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1110, - "end": 1124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1113, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1116, - "end": 1124, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1118, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1122, - "end": 1124, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1126, - "end": 1145, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1130, - "end": 1144, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1130, - "end": 1133, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1136, - "end": 1144, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1136, - "end": 1138, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1142, - "end": 1144, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1146, - "end": 1165, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1150, - "end": 1164, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1150, - "end": 1153, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1156, - "end": 1164, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1156, - "end": 1158, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1162, - "end": 1164, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1166, - "end": 1185, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1170, - "end": 1184, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1170, - "end": 1173, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1176, - "end": 1184, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1176, - "end": 1178, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1182, - "end": 1184, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1186, - "end": 1205, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1190, - "end": 1204, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1190, - "end": 1193, - "ctxt": 0 - }, - "value": "re5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1196, - "end": 1204, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1196, - "end": 1198, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1202, - "end": 1204, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1206, - "end": 1225, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1210, - "end": 1224, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1210, - "end": 1213, - "ctxt": 0 - }, - "value": "re6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1216, - "end": 1224, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1216, - "end": 1218, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1222, - "end": 1224, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1226, - "end": 1245, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1230, - "end": 1244, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1230, - "end": 1233, - "ctxt": 0 - }, - "value": "re7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1236, - "end": 1244, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1236, - "end": 1238, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1242, - "end": 1244, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1246, - "end": 1265, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1250, - "end": 1264, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1250, - "end": 1253, - "ctxt": 0 - }, - "value": "re8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1256, - "end": 1264, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1256, - "end": 1258, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1262, - "end": 1264, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1266, - "end": 1287, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1270, - "end": 1286, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1270, - "end": 1273, - "ctxt": 0 - }, - "value": "re9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1276, - "end": 1286, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1276, - "end": 1280, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1284, - "end": 1286, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1288, - "end": 1315, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1292, - "end": 1314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1292, - "end": 1296, - "ctxt": 0 - }, - "value": "re10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1299, - "end": 1314, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1299, - "end": 1308, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1312, - "end": 1314, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1317, - "end": 1336, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1321, - "end": 1335, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1321, - "end": 1324, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1327, - "end": 1335, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1327, - "end": 1329, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1333, - "end": 1335, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1337, - "end": 1356, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1341, - "end": 1355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1341, - "end": 1344, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1347, - "end": 1355, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1347, - "end": 1349, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1353, - "end": 1355, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1357, - "end": 1376, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1361, - "end": 1375, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1361, - "end": 1364, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1367, - "end": 1375, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1367, - "end": 1369, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1373, - "end": 1375, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1377, - "end": 1396, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1381, - "end": 1395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1381, - "end": 1384, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1387, - "end": 1395, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1387, - "end": 1389, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1393, - "end": 1395, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1397, - "end": 1416, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1401, - "end": 1415, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1401, - "end": 1404, - "ctxt": 0 - }, - "value": "rf5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1407, - "end": 1415, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1407, - "end": 1409, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1413, - "end": 1415, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1417, - "end": 1436, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1421, - "end": 1435, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1421, - "end": 1424, - "ctxt": 0 - }, - "value": "rf6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1427, - "end": 1435, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1427, - "end": 1429, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1433, - "end": 1435, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1437, - "end": 1456, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1441, - "end": 1455, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1441, - "end": 1444, - "ctxt": 0 - }, - "value": "rf7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1447, - "end": 1455, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1447, - "end": 1449, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1453, - "end": 1455, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1457, - "end": 1476, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1461, - "end": 1475, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1461, - "end": 1464, - "ctxt": 0 - }, - "value": "rf8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1467, - "end": 1475, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1467, - "end": 1469, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1473, - "end": 1475, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1477, - "end": 1498, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1481, - "end": 1497, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1481, - "end": 1484, - "ctxt": 0 - }, - "value": "rf9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1487, - "end": 1497, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1487, - "end": 1491, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1495, - "end": 1497, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1499, - "end": 1526, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1503, - "end": 1525, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1503, - "end": 1507, - "ctxt": 0 - }, - "value": "rf10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1510, - "end": 1525, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1510, - "end": 1519, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1523, - "end": 1525, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1528, - "end": 1547, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1532, - "end": 1546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1532, - "end": 1535, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1538, - "end": 1546, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1538, - "end": 1540, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1544, - "end": 1546, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1548, - "end": 1567, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1552, - "end": 1566, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1552, - "end": 1555, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1558, - "end": 1566, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1558, - "end": 1560, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1564, - "end": 1566, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1568, - "end": 1587, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1572, - "end": 1586, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1572, - "end": 1575, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1578, - "end": 1586, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1578, - "end": 1580, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1584, - "end": 1586, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1588, - "end": 1607, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1592, - "end": 1606, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1592, - "end": 1595, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1598, - "end": 1606, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1598, - "end": 1600, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1604, - "end": 1606, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1608, - "end": 1627, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1612, - "end": 1626, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1612, - "end": 1615, - "ctxt": 0 - }, - "value": "rg5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1618, - "end": 1626, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1618, - "end": 1620, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1624, - "end": 1626, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1628, - "end": 1647, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1632, - "end": 1646, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1632, - "end": 1635, - "ctxt": 0 - }, - "value": "rg6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1638, - "end": 1646, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1638, - "end": 1640, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1644, - "end": 1646, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1648, - "end": 1667, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1652, - "end": 1666, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1652, - "end": 1655, - "ctxt": 0 - }, - "value": "rg7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1658, - "end": 1666, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1658, - "end": 1660, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1664, - "end": 1666, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1668, - "end": 1687, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1672, - "end": 1686, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1672, - "end": 1675, - "ctxt": 0 - }, - "value": "rg8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1678, - "end": 1686, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1678, - "end": 1680, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1684, - "end": 1686, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1688, - "end": 1709, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1692, - "end": 1708, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1692, - "end": 1695, - "ctxt": 0 - }, - "value": "rg9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1698, - "end": 1708, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1698, - "end": 1702, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1706, - "end": 1708, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1710, - "end": 1737, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1714, - "end": 1736, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1714, - "end": 1718, - "ctxt": 0 - }, - "value": "rg10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1721, - "end": 1736, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1721, - "end": 1730, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1734, - "end": 1736, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1739, - "end": 1758, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1743, - "end": 1757, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1743, - "end": 1746, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1749, - "end": 1757, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1749, - "end": 1751, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1755, - "end": 1757, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1759, - "end": 1778, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1763, - "end": 1777, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1763, - "end": 1766, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1769, - "end": 1777, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1769, - "end": 1771, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1775, - "end": 1777, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1779, - "end": 1798, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1783, - "end": 1797, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1783, - "end": 1786, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1789, - "end": 1797, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1789, - "end": 1791, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1795, - "end": 1797, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1799, - "end": 1818, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1803, - "end": 1817, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1803, - "end": 1806, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1809, - "end": 1817, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1809, - "end": 1811, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1815, - "end": 1817, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1819, - "end": 1838, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1823, - "end": 1837, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1823, - "end": 1826, - "ctxt": 0 - }, - "value": "rh5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1829, - "end": 1837, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1829, - "end": 1831, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1835, - "end": 1837, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1839, - "end": 1858, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1843, - "end": 1857, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1843, - "end": 1846, - "ctxt": 0 - }, - "value": "rh6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1849, - "end": 1857, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1849, - "end": 1851, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1855, - "end": 1857, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1859, - "end": 1878, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1863, - "end": 1877, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1863, - "end": 1866, - "ctxt": 0 - }, - "value": "rh7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1869, - "end": 1877, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1869, - "end": 1871, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1875, - "end": 1877, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1879, - "end": 1898, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1883, - "end": 1897, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1883, - "end": 1886, - "ctxt": 0 - }, - "value": "rh8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1889, - "end": 1897, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1889, - "end": 1891, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1895, - "end": 1897, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1899, - "end": 1920, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1903, - "end": 1919, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1903, - "end": 1906, - "ctxt": 0 - }, - "value": "rh9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1909, - "end": 1919, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 1909, - "end": 1913, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1917, - "end": 1919, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1921, - "end": 1948, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1925, - "end": 1947, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1925, - "end": 1929, - "ctxt": 0 - }, - "value": "rh10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1932, - "end": 1947, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1932, - "end": 1941, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1945, - "end": 1947, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1950, - "end": 1971, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1954, - "end": 1970, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1954, - "end": 1957, - "ctxt": 0 - }, - "value": "ri1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1960, - "end": 1970, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1960, - "end": 1962, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1966, - "end": 1970, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1972, - "end": 1993, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1976, - "end": 1992, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1976, - "end": 1979, - "ctxt": 0 - }, - "value": "ri2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1982, - "end": 1992, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 1982, - "end": 1984, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1988, - "end": 1992, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1994, - "end": 2015, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1998, - "end": 2014, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1998, - "end": 2001, - "ctxt": 0 - }, - "value": "ri3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2004, - "end": 2014, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2004, - "end": 2006, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2010, - "end": 2014, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2016, - "end": 2037, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2020, - "end": 2036, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2020, - "end": 2023, - "ctxt": 0 - }, - "value": "ri4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2026, - "end": 2036, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2026, - "end": 2028, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2032, - "end": 2036, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2038, - "end": 2059, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2042, - "end": 2058, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2042, - "end": 2045, - "ctxt": 0 - }, - "value": "ri5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2048, - "end": 2058, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2048, - "end": 2050, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2054, - "end": 2058, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2060, - "end": 2081, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2064, - "end": 2080, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2064, - "end": 2067, - "ctxt": 0 - }, - "value": "ri6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2070, - "end": 2080, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2070, - "end": 2072, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2076, - "end": 2080, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2082, - "end": 2103, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2086, - "end": 2102, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2086, - "end": 2089, - "ctxt": 0 - }, - "value": "ri7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2092, - "end": 2102, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2092, - "end": 2094, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2098, - "end": 2102, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2104, - "end": 2125, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2108, - "end": 2124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2108, - "end": 2111, - "ctxt": 0 - }, - "value": "ri8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2114, - "end": 2124, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2114, - "end": 2116, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2120, - "end": 2124, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2126, - "end": 2149, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2130, - "end": 2148, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2130, - "end": 2133, - "ctxt": 0 - }, - "value": "ri9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2136, - "end": 2148, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2136, - "end": 2140, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2144, - "end": 2148, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2150, - "end": 2179, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2154, - "end": 2178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2154, - "end": 2158, - "ctxt": 0 - }, - "value": "ri10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2161, - "end": 2178, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2161, - "end": 2170, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 2174, - "end": 2178, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2181, - "end": 2207, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2185, - "end": 2206, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2185, - "end": 2188, - "ctxt": 0 - }, - "value": "rj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2191, - "end": 2206, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2191, - "end": 2193, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2197, - "end": 2206, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2208, - "end": 2234, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2212, - "end": 2233, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2212, - "end": 2215, - "ctxt": 0 - }, - "value": "rj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2218, - "end": 2233, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2218, - "end": 2220, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2224, - "end": 2233, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2235, - "end": 2261, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2239, - "end": 2260, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2239, - "end": 2242, - "ctxt": 0 - }, - "value": "rj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2245, - "end": 2260, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2245, - "end": 2247, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2251, - "end": 2260, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2262, - "end": 2288, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2266, - "end": 2287, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2266, - "end": 2269, - "ctxt": 0 - }, - "value": "rj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2272, - "end": 2287, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2272, - "end": 2274, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2278, - "end": 2287, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2289, - "end": 2315, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2293, - "end": 2314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2293, - "end": 2296, - "ctxt": 0 - }, - "value": "rj5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2299, - "end": 2314, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2299, - "end": 2301, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2305, - "end": 2314, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2316, - "end": 2342, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2320, - "end": 2341, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2320, - "end": 2323, - "ctxt": 0 - }, - "value": "rj6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2326, - "end": 2341, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2326, - "end": 2328, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2332, - "end": 2341, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2343, - "end": 2369, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2347, - "end": 2368, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2347, - "end": 2350, - "ctxt": 0 - }, - "value": "rj7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2353, - "end": 2368, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2353, - "end": 2355, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2359, - "end": 2368, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2370, - "end": 2396, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2374, - "end": 2395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2374, - "end": 2377, - "ctxt": 0 - }, - "value": "rj8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2380, - "end": 2395, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2380, - "end": 2382, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2386, - "end": 2395, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2397, - "end": 2425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2401, - "end": 2424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2401, - "end": 2404, - "ctxt": 0 - }, - "value": "rj9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2407, - "end": 2424, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "NullLiteral", - "span": { - "start": 2407, - "end": 2411, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2415, - "end": 2424, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2426, - "end": 2460, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2430, - "end": 2459, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2430, - "end": 2434, - "ctxt": 0 - }, - "value": "rj10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2437, - "end": 2459, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 2437, - "end": 2446, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2450, - "end": 2459, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.ts b/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.ts deleted file mode 100644 index 034af8ed982..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalAndOperatorWithEveryType.ts +++ /dev/null @@ -1,123 +0,0 @@ -// The && operator permits the operands to be of any type and produces a result of the same -// type as the second operand. - -enum E { a, b, c } - -var a1: any; -var a2: boolean; -var a3: number -var a4: string; -var a5: void; -var a6: E; -var a7: {}; -var a8: string[]; - -var ra1 = a1 && a1; -var ra2 = a2 && a1; -var ra3 = a3 && a1; -var ra4 = a4 && a1; -var ra5 = a5 && a1; -var ra6 = a6 && a1; -var ra7 = a7 && a1; -var ra8 = a8 && a1; -var ra9 = null && a1; -var ra10 = undefined && a1; - -var rb1 = a1 && a2; -var rb2 = a2 && a2; -var rb3 = a3 && a2; -var rb4 = a4 && a2; -var rb5 = a5 && a2; -var rb6 = a6 && a2; -var rb7 = a7 && a2; -var rb8 = a8 && a2; -var rb9 = null && a2; -var rb10 = undefined && a2; - -var rc1 = a1 && a3; -var rc2 = a2 && a3; -var rc3 = a3 && a3; -var rc4 = a4 && a3; -var rc5 = a5 && a3; -var rc6 = a6 && a3; -var rc7 = a7 && a3; -var rc8 = a8 && a3; -var rc9 = null && a3; -var rc10 = undefined && a3; - -var rd1 = a1 && a4; -var rd2 = a2 && a4; -var rd3 = a3 && a4; -var rd4 = a4 && a4; -var rd5 = a5 && a4; -var rd6 = a6 && a4; -var rd7 = a7 && a4; -var rd8 = a8 && a4; -var rd9 = null && a4; -var rd10 = undefined && a4; - -var re1 = a1 && a5; -var re2 = a2 && a5; -var re3 = a3 && a5; -var re4 = a4 && a5; -var re5 = a5 && a5; -var re6 = a6 && a5; -var re7 = a7 && a5; -var re8 = a8 && a5; -var re9 = null && a5; -var re10 = undefined && a5; - -var rf1 = a1 && a6; -var rf2 = a2 && a6; -var rf3 = a3 && a6; -var rf4 = a4 && a6; -var rf5 = a5 && a6; -var rf6 = a6 && a6; -var rf7 = a7 && a6; -var rf8 = a8 && a6; -var rf9 = null && a6; -var rf10 = undefined && a6; - -var rg1 = a1 && a7; -var rg2 = a2 && a7; -var rg3 = a3 && a7; -var rg4 = a4 && a7; -var rg5 = a5 && a7; -var rg6 = a6 && a7; -var rg7 = a7 && a7; -var rg8 = a8 && a7; -var rg9 = null && a7; -var rg10 = undefined && a7; - -var rh1 = a1 && a8; -var rh2 = a2 && a8; -var rh3 = a3 && a8; -var rh4 = a4 && a8; -var rh5 = a5 && a8; -var rh6 = a6 && a8; -var rh7 = a7 && a8; -var rh8 = a8 && a8; -var rh9 = null && a8; -var rh10 = undefined && a8; - -var ri1 = a1 && null; -var ri2 = a2 && null; -var ri3 = a3 && null; -var ri4 = a4 && null; -var ri5 = a5 && null; -var ri6 = a6 && null; -var ri7 = a7 && null; -var ri8 = a8 && null; -var ri9 = null && null; -var ri10 = undefined && null; - -var rj1 = a1 && undefined; -var rj2 = a2 && undefined; -var rj3 = a3 && undefined; -var rj4 = a4 && undefined; -var rj5 = a5 && undefined; -var rj6 = a6 && undefined; -var rj7 = a7 && undefined; -var rj8 = a8 && undefined; -var rj9 = null && undefined; -var rj10 = undefined && undefined; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.json deleted file mode 100644 index 0d6f9ea7fb4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 172, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 35, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 34, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 34, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 57, - "end": 75, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 61, - "end": 74, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 61, - "end": 69, - "ctxt": 0 - }, - "value": "BOOLEAN1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsNonNullExpression", - "span": { - "start": 72, - "end": 74, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 72, - "end": 73, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 113, - "end": 135, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 117, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "value": "BOOLEAN2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 128, - "end": 134, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "UnaryExpression", - "span": { - "start": 128, - "end": 130, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "Identifier", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 172, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 171, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 168, - "ctxt": 0 - }, - "value": "BOOLEAN3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 170, - "end": 170, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "Invalid", - "span": { - "start": 170, - "end": 170, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.ts deleted file mode 100644 index 5e535a2f8e3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalNotOperatorInvalidOperations.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Unary operator ! -var b: number; - -// operand before ! -var BOOLEAN1 = b!; //expect error - -// miss parentheses -var BOOLEAN2 = !b + b; - -// miss an operand -var BOOLEAN3 =!; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.json b/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.json deleted file mode 100644 index de92e33fd19..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.json +++ /dev/null @@ -1,6602 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 258, - "end": 6718, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 258, - "end": 276, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 278, - "end": 290, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 282, - "end": 289, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 282, - "end": 284, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 291, - "end": 307, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 295, - "end": 306, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 295, - "end": 297, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 297, - "end": 306, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 299, - "end": 306, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 308, - "end": 322, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 312, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 312, - "end": 314, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 314, - "end": 322, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 316, - "end": 322, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 323, - "end": 338, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 327, - "end": 337, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 327, - "end": 329, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 329, - "end": 337, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 339, - "end": 352, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 343, - "end": 351, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 343, - "end": 345, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 345, - "end": 351, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 347, - "end": 351, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 353, - "end": 363, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 357, - "end": 362, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 357, - "end": 359, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 359, - "end": 362, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 361, - "end": 362, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 361, - "end": 362, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 364, - "end": 384, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 368, - "end": 383, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 368, - "end": 370, - "ctxt": 0 - }, - "value": "a7", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 370, - "end": 383, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 372, - "end": 383, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 373, - "end": 382, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 373, - "end": 374, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 374, - "end": 382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 385, - "end": 402, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 389, - "end": 401, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 389, - "end": 391, - "ctxt": 0 - }, - "value": "a8", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 391, - "end": 401, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 393, - "end": 401, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 393, - "end": 399, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 404, - "end": 423, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 408, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 408, - "end": 411, - "ctxt": 0 - }, - "value": "ra1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 414, - "end": 416, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 420, - "end": 422, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 459, - "end": 478, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 477, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 466, - "ctxt": 0 - }, - "value": "ra2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 469, - "end": 477, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 469, - "end": 471, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 475, - "end": 477, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 514, - "end": 533, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 518, - "end": 532, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 518, - "end": 521, - "ctxt": 0 - }, - "value": "ra3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 524, - "end": 532, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 524, - "end": 526, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 530, - "end": 532, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 569, - "end": 588, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 573, - "end": 587, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 573, - "end": 576, - "ctxt": 0 - }, - "value": "ra4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 579, - "end": 587, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 579, - "end": 581, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 585, - "end": 587, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 624, - "end": 643, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 628, - "end": 642, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 628, - "end": 631, - "ctxt": 0 - }, - "value": "ra5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 634, - "end": 642, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 634, - "end": 636, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 640, - "end": 642, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 679, - "end": 698, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 683, - "end": 697, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 683, - "end": 686, - "ctxt": 0 - }, - "value": "ra6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 689, - "end": 697, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 689, - "end": 691, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 695, - "end": 697, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 734, - "end": 753, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 738, - "end": 752, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 738, - "end": 741, - "ctxt": 0 - }, - "value": "ra7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 744, - "end": 752, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 744, - "end": 746, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 750, - "end": 752, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 789, - "end": 808, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 793, - "end": 807, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 793, - "end": 796, - "ctxt": 0 - }, - "value": "ra8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 799, - "end": 807, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 799, - "end": 801, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 805, - "end": 807, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 844, - "end": 865, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 848, - "end": 864, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 848, - "end": 851, - "ctxt": 0 - }, - "value": "ra9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 854, - "end": 864, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 854, - "end": 858, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 862, - "end": 864, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 899, - "end": 926, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 903, - "end": 925, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 903, - "end": 907, - "ctxt": 0 - }, - "value": "ra10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 910, - "end": 925, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 910, - "end": 919, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 923, - "end": 925, - "ctxt": 0 - }, - "value": "a1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 955, - "end": 974, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 959, - "end": 973, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 959, - "end": 962, - "ctxt": 0 - }, - "value": "rb1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 965, - "end": 973, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 965, - "end": 967, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 971, - "end": 973, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1014, - "end": 1033, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1018, - "end": 1032, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1018, - "end": 1021, - "ctxt": 0 - }, - "value": "rb2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1024, - "end": 1032, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1024, - "end": 1026, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1030, - "end": 1032, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1077, - "end": 1096, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1081, - "end": 1095, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1081, - "end": 1084, - "ctxt": 0 - }, - "value": "rb3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1087, - "end": 1095, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1087, - "end": 1089, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1093, - "end": 1095, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1149, - "end": 1168, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1153, - "end": 1167, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1153, - "end": 1156, - "ctxt": 0 - }, - "value": "rb4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1159, - "end": 1167, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1159, - "end": 1161, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1165, - "end": 1167, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1221, - "end": 1240, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1225, - "end": 1239, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1225, - "end": 1228, - "ctxt": 0 - }, - "value": "rb5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1231, - "end": 1239, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1231, - "end": 1233, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1237, - "end": 1239, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1291, - "end": 1310, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1295, - "end": 1309, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1295, - "end": 1298, - "ctxt": 0 - }, - "value": "rb6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1301, - "end": 1309, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1301, - "end": 1303, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1307, - "end": 1309, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1358, - "end": 1377, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1362, - "end": 1376, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1362, - "end": 1365, - "ctxt": 0 - }, - "value": "rb7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1368, - "end": 1376, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1368, - "end": 1370, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1374, - "end": 1376, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1430, - "end": 1449, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1434, - "end": 1448, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1437, - "ctxt": 0 - }, - "value": "rb8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1440, - "end": 1448, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1440, - "end": 1442, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1446, - "end": 1448, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1501, - "end": 1522, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1505, - "end": 1521, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1505, - "end": 1508, - "ctxt": 0 - }, - "value": "rb9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1511, - "end": 1521, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 1511, - "end": 1515, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1519, - "end": 1521, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1564, - "end": 1590, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1568, - "end": 1589, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1568, - "end": 1572, - "ctxt": 0 - }, - "value": "rb10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1574, - "end": 1589, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1574, - "end": 1583, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1587, - "end": 1589, - "ctxt": 0 - }, - "value": "a2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1628, - "end": 1647, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1632, - "end": 1646, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1632, - "end": 1635, - "ctxt": 0 - }, - "value": "rc1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1638, - "end": 1646, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1638, - "end": 1640, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1644, - "end": 1646, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1686, - "end": 1705, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1690, - "end": 1704, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1690, - "end": 1693, - "ctxt": 0 - }, - "value": "rc2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1696, - "end": 1704, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1696, - "end": 1698, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1702, - "end": 1704, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1757, - "end": 1776, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1761, - "end": 1775, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1761, - "end": 1764, - "ctxt": 0 - }, - "value": "rc3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1767, - "end": 1775, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1767, - "end": 1769, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1773, - "end": 1775, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1818, - "end": 1837, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1822, - "end": 1836, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1822, - "end": 1825, - "ctxt": 0 - }, - "value": "rc4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1828, - "end": 1836, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1828, - "end": 1830, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1834, - "end": 1836, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1888, - "end": 1907, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1892, - "end": 1906, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1892, - "end": 1895, - "ctxt": 0 - }, - "value": "rc5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1898, - "end": 1906, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1898, - "end": 1900, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1904, - "end": 1906, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1956, - "end": 1975, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1960, - "end": 1974, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1960, - "end": 1963, - "ctxt": 0 - }, - "value": "rc6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 1966, - "end": 1974, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 1966, - "end": 1968, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1972, - "end": 1974, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2017, - "end": 2036, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2021, - "end": 2035, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2021, - "end": 2024, - "ctxt": 0 - }, - "value": "rc7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2027, - "end": 2035, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2027, - "end": 2029, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2033, - "end": 2035, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2087, - "end": 2106, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2091, - "end": 2105, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2091, - "end": 2094, - "ctxt": 0 - }, - "value": "rc8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2097, - "end": 2105, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2097, - "end": 2099, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2103, - "end": 2105, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2156, - "end": 2177, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2160, - "end": 2176, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2160, - "end": 2163, - "ctxt": 0 - }, - "value": "rc9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2166, - "end": 2176, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 2166, - "end": 2170, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2174, - "end": 2176, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2217, - "end": 2244, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2221, - "end": 2243, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2221, - "end": 2225, - "ctxt": 0 - }, - "value": "rc10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2228, - "end": 2243, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2228, - "end": 2237, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2241, - "end": 2243, - "ctxt": 0 - }, - "value": "a3", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2279, - "end": 2298, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2283, - "end": 2297, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2283, - "end": 2286, - "ctxt": 0 - }, - "value": "rd1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2289, - "end": 2297, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2289, - "end": 2291, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2295, - "end": 2297, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2337, - "end": 2356, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2341, - "end": 2355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2341, - "end": 2344, - "ctxt": 0 - }, - "value": "rd2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2347, - "end": 2355, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2347, - "end": 2349, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2353, - "end": 2355, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2408, - "end": 2427, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2412, - "end": 2426, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2412, - "end": 2415, - "ctxt": 0 - }, - "value": "rd3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2418, - "end": 2426, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2418, - "end": 2420, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2424, - "end": 2426, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2478, - "end": 2497, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2482, - "end": 2496, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2482, - "end": 2485, - "ctxt": 0 - }, - "value": "rd4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2488, - "end": 2496, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2488, - "end": 2490, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2494, - "end": 2496, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2539, - "end": 2558, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2543, - "end": 2557, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2543, - "end": 2546, - "ctxt": 0 - }, - "value": "rd5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2549, - "end": 2557, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2549, - "end": 2551, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2555, - "end": 2557, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2607, - "end": 2626, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2611, - "end": 2625, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2611, - "end": 2614, - "ctxt": 0 - }, - "value": "rd6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2617, - "end": 2625, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2617, - "end": 2619, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2623, - "end": 2625, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2675, - "end": 2694, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2679, - "end": 2693, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2679, - "end": 2682, - "ctxt": 0 - }, - "value": "rd7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2685, - "end": 2693, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2685, - "end": 2687, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2691, - "end": 2693, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2745, - "end": 2764, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2749, - "end": 2763, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2749, - "end": 2752, - "ctxt": 0 - }, - "value": "rd8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2755, - "end": 2763, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2755, - "end": 2757, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2761, - "end": 2763, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2814, - "end": 2835, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2818, - "end": 2834, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2818, - "end": 2821, - "ctxt": 0 - }, - "value": "rd9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2824, - "end": 2834, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 2824, - "end": 2828, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2832, - "end": 2834, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2875, - "end": 2902, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2879, - "end": 2901, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2879, - "end": 2883, - "ctxt": 0 - }, - "value": "rd10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2886, - "end": 2901, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2886, - "end": 2895, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2899, - "end": 2901, - "ctxt": 0 - }, - "value": "a4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2937, - "end": 2956, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2941, - "end": 2955, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2941, - "end": 2944, - "ctxt": 0 - }, - "value": "re1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 2947, - "end": 2955, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 2947, - "end": 2949, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 2953, - "end": 2955, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2993, - "end": 3012, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2997, - "end": 3011, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2997, - "end": 3000, - "ctxt": 0 - }, - "value": "re2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3003, - "end": 3011, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3003, - "end": 3005, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3009, - "end": 3011, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3060, - "end": 3079, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3064, - "end": 3078, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3064, - "end": 3067, - "ctxt": 0 - }, - "value": "re3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3070, - "end": 3078, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3070, - "end": 3072, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3076, - "end": 3078, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3126, - "end": 3145, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3130, - "end": 3144, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3130, - "end": 3133, - "ctxt": 0 - }, - "value": "re4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3136, - "end": 3144, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3136, - "end": 3138, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3142, - "end": 3144, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3192, - "end": 3211, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3196, - "end": 3210, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3196, - "end": 3199, - "ctxt": 0 - }, - "value": "re5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3202, - "end": 3210, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3202, - "end": 3204, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3208, - "end": 3210, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3249, - "end": 3268, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3253, - "end": 3267, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3253, - "end": 3256, - "ctxt": 0 - }, - "value": "re6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3259, - "end": 3267, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3259, - "end": 3261, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3265, - "end": 3267, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3313, - "end": 3332, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3317, - "end": 3331, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3317, - "end": 3320, - "ctxt": 0 - }, - "value": "re7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3323, - "end": 3331, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3323, - "end": 3325, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3329, - "end": 3331, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3379, - "end": 3398, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3383, - "end": 3397, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3383, - "end": 3386, - "ctxt": 0 - }, - "value": "re8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3389, - "end": 3397, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3389, - "end": 3391, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3395, - "end": 3397, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3444, - "end": 3465, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3448, - "end": 3464, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3448, - "end": 3451, - "ctxt": 0 - }, - "value": "re9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3454, - "end": 3464, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 3454, - "end": 3458, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 3462, - "end": 3464, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3501, - "end": 3528, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3505, - "end": 3527, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3505, - "end": 3509, - "ctxt": 0 - }, - "value": "re10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3512, - "end": 3527, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3512, - "end": 3521, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3525, - "end": 3527, - "ctxt": 0 - }, - "value": "a5", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3559, - "end": 3578, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3563, - "end": 3577, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3563, - "end": 3566, - "ctxt": 0 - }, - "value": "rg1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3569, - "end": 3577, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3569, - "end": 3571, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3575, - "end": 3577, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3615, - "end": 3634, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3619, - "end": 3633, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3619, - "end": 3622, - "ctxt": 0 - }, - "value": "rg2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3625, - "end": 3633, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3625, - "end": 3627, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3631, - "end": 3633, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3682, - "end": 3701, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3686, - "end": 3700, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3686, - "end": 3689, - "ctxt": 0 - }, - "value": "rg3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3692, - "end": 3700, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3692, - "end": 3694, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3698, - "end": 3700, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3741, - "end": 3760, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3745, - "end": 3759, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3745, - "end": 3748, - "ctxt": 0 - }, - "value": "rg4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3751, - "end": 3759, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3751, - "end": 3753, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3757, - "end": 3759, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3807, - "end": 3826, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3811, - "end": 3825, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3811, - "end": 3814, - "ctxt": 0 - }, - "value": "rg5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3817, - "end": 3825, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3817, - "end": 3819, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3823, - "end": 3825, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3871, - "end": 3890, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3875, - "end": 3889, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3875, - "end": 3878, - "ctxt": 0 - }, - "value": "rg6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3881, - "end": 3889, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3881, - "end": 3883, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3887, - "end": 3889, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3925, - "end": 3944, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3929, - "end": 3943, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3929, - "end": 3932, - "ctxt": 0 - }, - "value": "rg7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 3935, - "end": 3943, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 3935, - "end": 3937, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3941, - "end": 3943, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3991, - "end": 4010, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3995, - "end": 4009, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3995, - "end": 3998, - "ctxt": 0 - }, - "value": "rg8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4001, - "end": 4009, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4001, - "end": 4003, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4007, - "end": 4009, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4056, - "end": 4077, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4060, - "end": 4076, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4060, - "end": 4063, - "ctxt": 0 - }, - "value": "rg9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4066, - "end": 4076, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 4066, - "end": 4070, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 4074, - "end": 4076, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4110, - "end": 4137, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4114, - "end": 4136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4114, - "end": 4118, - "ctxt": 0 - }, - "value": "rg10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4121, - "end": 4136, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4121, - "end": 4130, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4134, - "end": 4136, - "ctxt": 0 - }, - "value": "a6", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4165, - "end": 4184, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4169, - "end": 4183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4169, - "end": 4172, - "ctxt": 0 - }, - "value": "rh1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4175, - "end": 4183, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4175, - "end": 4177, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4181, - "end": 4183, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4223, - "end": 4242, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4227, - "end": 4241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4227, - "end": 4230, - "ctxt": 0 - }, - "value": "rh2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4233, - "end": 4241, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4233, - "end": 4235, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4239, - "end": 4241, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4294, - "end": 4313, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4298, - "end": 4312, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4298, - "end": 4301, - "ctxt": 0 - }, - "value": "rh3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4304, - "end": 4312, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4304, - "end": 4306, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4310, - "end": 4312, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4364, - "end": 4383, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4368, - "end": 4382, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4368, - "end": 4371, - "ctxt": 0 - }, - "value": "rh4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4374, - "end": 4382, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4374, - "end": 4376, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4380, - "end": 4382, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4434, - "end": 4453, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4438, - "end": 4452, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4438, - "end": 4441, - "ctxt": 0 - }, - "value": "rh5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4444, - "end": 4452, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4444, - "end": 4446, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4450, - "end": 4452, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4502, - "end": 4521, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4506, - "end": 4520, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4506, - "end": 4509, - "ctxt": 0 - }, - "value": "rh6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4512, - "end": 4520, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4512, - "end": 4514, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4518, - "end": 4520, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4570, - "end": 4589, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4574, - "end": 4588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4574, - "end": 4577, - "ctxt": 0 - }, - "value": "rh7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4580, - "end": 4588, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4580, - "end": 4582, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4586, - "end": 4588, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4631, - "end": 4650, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4635, - "end": 4649, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4635, - "end": 4638, - "ctxt": 0 - }, - "value": "rh8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4641, - "end": 4649, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4641, - "end": 4643, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4647, - "end": 4649, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4700, - "end": 4721, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4704, - "end": 4720, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4704, - "end": 4707, - "ctxt": 0 - }, - "value": "rh9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4710, - "end": 4720, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 4710, - "end": 4714, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 4718, - "end": 4720, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4761, - "end": 4788, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4765, - "end": 4787, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4765, - "end": 4769, - "ctxt": 0 - }, - "value": "rh10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4772, - "end": 4787, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4772, - "end": 4781, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4785, - "end": 4787, - "ctxt": 0 - }, - "value": "a7", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4823, - "end": 4842, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4827, - "end": 4841, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4827, - "end": 4830, - "ctxt": 0 - }, - "value": "ri1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4833, - "end": 4841, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4833, - "end": 4835, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4839, - "end": 4841, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4880, - "end": 4899, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4884, - "end": 4898, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4884, - "end": 4887, - "ctxt": 0 - }, - "value": "ri2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4890, - "end": 4898, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4890, - "end": 4892, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4896, - "end": 4898, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4949, - "end": 4968, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4953, - "end": 4967, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4953, - "end": 4956, - "ctxt": 0 - }, - "value": "ri3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 4959, - "end": 4967, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 4959, - "end": 4961, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4965, - "end": 4967, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5017, - "end": 5036, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5021, - "end": 5035, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5021, - "end": 5024, - "ctxt": 0 - }, - "value": "ri4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5027, - "end": 5035, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5027, - "end": 5029, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5033, - "end": 5035, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5085, - "end": 5104, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5089, - "end": 5103, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5089, - "end": 5092, - "ctxt": 0 - }, - "value": "ri5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5095, - "end": 5103, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5095, - "end": 5097, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5101, - "end": 5103, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5151, - "end": 5170, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5155, - "end": 5169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5155, - "end": 5158, - "ctxt": 0 - }, - "value": "ri6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5161, - "end": 5169, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5161, - "end": 5163, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5167, - "end": 5169, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5217, - "end": 5236, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5221, - "end": 5235, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5221, - "end": 5224, - "ctxt": 0 - }, - "value": "ri7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5227, - "end": 5235, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5227, - "end": 5229, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5233, - "end": 5235, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5285, - "end": 5304, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5289, - "end": 5303, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5289, - "end": 5292, - "ctxt": 0 - }, - "value": "ri8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5295, - "end": 5303, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5295, - "end": 5297, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5301, - "end": 5303, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5344, - "end": 5365, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5348, - "end": 5364, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5348, - "end": 5351, - "ctxt": 0 - }, - "value": "ri9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5354, - "end": 5364, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 5354, - "end": 5358, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 5362, - "end": 5364, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5403, - "end": 5430, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5407, - "end": 5429, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5407, - "end": 5411, - "ctxt": 0 - }, - "value": "ri10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5414, - "end": 5429, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5414, - "end": 5423, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 5427, - "end": 5429, - "ctxt": 0 - }, - "value": "a8", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5463, - "end": 5484, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5467, - "end": 5483, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5467, - "end": 5470, - "ctxt": 0 - }, - "value": "rj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5473, - "end": 5483, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5473, - "end": 5475, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5479, - "end": 5483, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5521, - "end": 5542, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5525, - "end": 5541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5525, - "end": 5528, - "ctxt": 0 - }, - "value": "rj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5531, - "end": 5541, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5531, - "end": 5533, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5537, - "end": 5541, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5583, - "end": 5604, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5587, - "end": 5603, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5587, - "end": 5590, - "ctxt": 0 - }, - "value": "rj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5593, - "end": 5603, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5593, - "end": 5595, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5599, - "end": 5603, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5644, - "end": 5665, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5648, - "end": 5664, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5648, - "end": 5651, - "ctxt": 0 - }, - "value": "rj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5654, - "end": 5664, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5654, - "end": 5656, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5660, - "end": 5664, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5705, - "end": 5726, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5709, - "end": 5725, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5709, - "end": 5712, - "ctxt": 0 - }, - "value": "rj5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5715, - "end": 5725, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5715, - "end": 5717, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5721, - "end": 5725, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5764, - "end": 5785, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5768, - "end": 5784, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5768, - "end": 5771, - "ctxt": 0 - }, - "value": "rj6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5774, - "end": 5784, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5774, - "end": 5776, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5780, - "end": 5784, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5820, - "end": 5841, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5824, - "end": 5840, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5824, - "end": 5827, - "ctxt": 0 - }, - "value": "rj7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5830, - "end": 5840, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5830, - "end": 5832, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5836, - "end": 5840, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5881, - "end": 5902, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5885, - "end": 5901, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5885, - "end": 5888, - "ctxt": 0 - }, - "value": "rj8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5891, - "end": 5901, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 5891, - "end": 5893, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5897, - "end": 5901, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5941, - "end": 5964, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5945, - "end": 5963, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5945, - "end": 5948, - "ctxt": 0 - }, - "value": "rj9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 5951, - "end": 5963, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 5951, - "end": 5955, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 5959, - "end": 5963, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 5999, - "end": 6028, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6003, - "end": 6027, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6003, - "end": 6007, - "ctxt": 0 - }, - "value": "rj10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6010, - "end": 6027, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6010, - "end": 6019, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 6023, - "end": 6027, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6058, - "end": 6084, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6062, - "end": 6083, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6062, - "end": 6065, - "ctxt": 0 - }, - "value": "rf1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6068, - "end": 6083, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6068, - "end": 6070, - "ctxt": 0 - }, - "value": "a1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6074, - "end": 6083, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6126, - "end": 6152, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6130, - "end": 6151, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6130, - "end": 6133, - "ctxt": 0 - }, - "value": "rf2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6136, - "end": 6151, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6136, - "end": 6138, - "ctxt": 0 - }, - "value": "a2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6142, - "end": 6151, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6198, - "end": 6224, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6202, - "end": 6223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6202, - "end": 6205, - "ctxt": 0 - }, - "value": "rf3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6208, - "end": 6223, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6208, - "end": 6210, - "ctxt": 0 - }, - "value": "a3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6214, - "end": 6223, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6269, - "end": 6295, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6273, - "end": 6294, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6273, - "end": 6276, - "ctxt": 0 - }, - "value": "rf4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6279, - "end": 6294, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6279, - "end": 6281, - "ctxt": 0 - }, - "value": "a4", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6285, - "end": 6294, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6340, - "end": 6366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6344, - "end": 6365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6344, - "end": 6347, - "ctxt": 0 - }, - "value": "rf5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6350, - "end": 6365, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6350, - "end": 6352, - "ctxt": 0 - }, - "value": "a5", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6356, - "end": 6365, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6409, - "end": 6435, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6413, - "end": 6434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6413, - "end": 6416, - "ctxt": 0 - }, - "value": "rf6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6419, - "end": 6434, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6419, - "end": 6421, - "ctxt": 0 - }, - "value": "a6", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6425, - "end": 6434, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6475, - "end": 6501, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6479, - "end": 6500, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6479, - "end": 6482, - "ctxt": 0 - }, - "value": "rf7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6485, - "end": 6500, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6485, - "end": 6487, - "ctxt": 0 - }, - "value": "a7", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6491, - "end": 6500, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6546, - "end": 6572, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6550, - "end": 6571, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6550, - "end": 6553, - "ctxt": 0 - }, - "value": "rf8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6556, - "end": 6571, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6556, - "end": 6558, - "ctxt": 0 - }, - "value": "a8", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6562, - "end": 6571, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6616, - "end": 6644, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6620, - "end": 6643, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6620, - "end": 6623, - "ctxt": 0 - }, - "value": "rf9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6626, - "end": 6643, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "NullLiteral", - "span": { - "start": 6626, - "end": 6630, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 6634, - "end": 6643, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 6684, - "end": 6718, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6688, - "end": 6717, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 6688, - "end": 6692, - "ctxt": 0 - }, - "value": "rf10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 6695, - "end": 6717, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 6695, - "end": 6704, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 6708, - "end": 6717, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.ts b/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.ts deleted file mode 100644 index 9ec124449f3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/logicalOrOperatorWithEveryType.ts +++ /dev/null @@ -1,125 +0,0 @@ -// The || operator permits the operands to be of any type. -// If the || expression is not contextually typed, the right operand is contextually typed -// by the type of the left operand and the result is of the best common type of the two -// operand types. - -enum E { a, b, c } - -var a1: any; -var a2: boolean; -var a3: number -var a4: string; -var a5: void; -var a6: E; -var a7: {a: string}; -var a8: string[]; - -var ra1 = a1 || a1; // any || any is any -var ra2 = a2 || a1; // boolean || any is any -var ra3 = a3 || a1; // number || any is any -var ra4 = a4 || a1; // string || any is any -var ra5 = a5 || a1; // void || any is any -var ra6 = a6 || a1; // enum || any is any -var ra7 = a7 || a1; // object || any is any -var ra8 = a8 || a1; // array || any is any -var ra9 = null || a1; // null || any is any -var ra10 = undefined || a1; // undefined || any is any - -var rb1 = a1 || a2; // any || boolean is any -var rb2 = a2 || a2; // boolean || boolean is boolean -var rb3 = a3 || a2; // number || boolean is number | boolean -var rb4 = a4 || a2; // string || boolean is string | boolean -var rb5 = a5 || a2; // void || boolean is void | boolean -var rb6 = a6 || a2; // enum || boolean is E | boolean -var rb7 = a7 || a2; // object || boolean is object | boolean -var rb8 = a8 || a2; // array || boolean is array | boolean -var rb9 = null || a2; // null || boolean is boolean -var rb10= undefined || a2; // undefined || boolean is boolean - -var rc1 = a1 || a3; // any || number is any -var rc2 = a2 || a3; // boolean || number is boolean | number -var rc3 = a3 || a3; // number || number is number -var rc4 = a4 || a3; // string || number is string | number -var rc5 = a5 || a3; // void || number is void | number -var rc6 = a6 || a3; // enum || number is number -var rc7 = a7 || a3; // object || number is object | number -var rc8 = a8 || a3; // array || number is array | number -var rc9 = null || a3; // null || number is number -var rc10 = undefined || a3; // undefined || number is number - -var rd1 = a1 || a4; // any || string is any -var rd2 = a2 || a4; // boolean || string is boolean | string -var rd3 = a3 || a4; // number || string is number | string -var rd4 = a4 || a4; // string || string is string -var rd5 = a5 || a4; // void || string is void | string -var rd6 = a6 || a4; // enum || string is enum | string -var rd7 = a7 || a4; // object || string is object | string -var rd8 = a8 || a4; // array || string is array | string -var rd9 = null || a4; // null || string is string -var rd10 = undefined || a4; // undefined || string is string - -var re1 = a1 || a5; // any || void is any -var re2 = a2 || a5; // boolean || void is boolean | void -var re3 = a3 || a5; // number || void is number | void -var re4 = a4 || a5; // string || void is string | void -var re5 = a5 || a5; // void || void is void -var re6 = a6 || a5; // enum || void is enum | void -var re7 = a7 || a5; // object || void is object | void -var re8 = a8 || a5; // array || void is array | void -var re9 = null || a5; // null || void is void -var re10 = undefined || a5; // undefined || void is void - -var rg1 = a1 || a6; // any || enum is any -var rg2 = a2 || a6; // boolean || enum is boolean | enum -var rg3 = a3 || a6; // number || enum is number -var rg4 = a4 || a6; // string || enum is string | enum -var rg5 = a5 || a6; // void || enum is void | enum -var rg6 = a6 || a6; // enum || enum is E -var rg7 = a7 || a6; // object || enum is object | enum -var rg8 = a8 || a6; // array || enum is array | enum -var rg9 = null || a6; // null || enum is E -var rg10 = undefined || a6; // undefined || enum is E - -var rh1 = a1 || a7; // any || object is any -var rh2 = a2 || a7; // boolean || object is boolean | object -var rh3 = a3 || a7; // number || object is number | object -var rh4 = a4 || a7; // string || object is string | object -var rh5 = a5 || a7; // void || object is void | object -var rh6 = a6 || a7; // enum || object is enum | object -var rh7 = a7 || a7; // object || object is object -var rh8 = a8 || a7; // array || object is array | object -var rh9 = null || a7; // null || object is object -var rh10 = undefined || a7; // undefined || object is object - -var ri1 = a1 || a8; // any || array is any -var ri2 = a2 || a8; // boolean || array is boolean | array -var ri3 = a3 || a8; // number || array is number | array -var ri4 = a4 || a8; // string || array is string | array -var ri5 = a5 || a8; // void || array is void | array -var ri6 = a6 || a8; // enum || array is enum | array -var ri7 = a7 || a8; // object || array is object | array -var ri8 = a8 || a8; // array || array is array -var ri9 = null || a8; // null || array is array -var ri10 = undefined || a8; // undefined || array is array - -var rj1 = a1 || null; // any || null is any -var rj2 = a2 || null; // boolean || null is boolean -var rj3 = a3 || null; // number || null is number -var rj4 = a4 || null; // string || null is string -var rj5 = a5 || null; // void || null is void -var rj6 = a6 || null; // enum || null is E -var rj7 = a7 || null; // object || null is object -var rj8 = a8 || null; // array || null is array -var rj9 = null || null; // null || null is any -var rj10 = undefined || null; // undefined || null is any - -var rf1 = a1 || undefined; // any || undefined is any -var rf2 = a2 || undefined; // boolean || undefined is boolean -var rf3 = a3 || undefined; // number || undefined is number -var rf4 = a4 || undefined; // string || undefined is string -var rf5 = a5 || undefined; // void || undefined is void -var rf6 = a6 || undefined; // enum || undefined is E -var rf7 = a7 || undefined; // object || undefined is object -var rf8 = a8 || undefined; // array || undefined is array -var rf9 = null || undefined; // null || undefined is any -var rf10 = undefined || undefined; // undefined || undefined is any \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.json b/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.json new file mode 100644 index 00000000000..faca9804702 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.json @@ -0,0 +1,3207 @@ +{ + "type": "Script", + "span": { + "start": 60, + "end": 1370, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 60, + "end": 116, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 65, + "end": 72, + "ctxt": 0 + }, + "value": "Mapped1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 72, + "end": 90, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 73, + "end": 89, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 73, + "end": 74, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 83, + "end": 89, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 93, + "end": 115, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 96, + "end": 102, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 96, + "end": 97, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 101, + "end": 102, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 101, + "end": 102, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 105, + "end": 113, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 107, + "end": 111, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 107, + "end": 108, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 108, + "end": 111, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 110, + "end": 111, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 110, + "end": 111, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 127, + "end": 129, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 148, + "end": 163, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 148, + "end": 163, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 151, + "end": 163, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 153, + "end": 163, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 153, + "end": 160, + "ctxt": 0 + }, + "value": "Mapped1", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 160, + "end": 163, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 161, + "end": 162, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 161, + "end": 162, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 165, + "end": 171, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 165, + "end": 171, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 168, + "end": 171, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 170, + "end": 171, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 170, + "end": 171, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 118, + "end": 210, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 173, + "end": 210, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 179, + "end": 208, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 185, + "end": 207, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 185, + "end": 186, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 186, + "end": 196, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 188, + "end": 196, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 190, + "end": 194, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 190, + "end": 191, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 191, + "end": 194, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 193, + "end": 194, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 193, + "end": 194, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 199, + "end": 207, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 199, + "end": 202, + "ctxt": 0 + }, + "value": "obj", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 202, + "end": 207, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 203, + "end": 206, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 129, + "end": 147, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 130, + "end": 146, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 130, + "end": 131, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 140, + "end": 146, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 212, + "end": 281, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 217, + "end": 224, + "ctxt": 0 + }, + "value": "Mapped2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 224, + "end": 242, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 225, + "end": 241, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 225, + "end": 226, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 235, + "end": 241, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 245, + "end": 280, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 248, + "end": 254, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 248, + "end": 249, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 253, + "end": 254, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 253, + "end": 254, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + "nameType": { + "type": "TsLiteralType", + "span": { + "start": 258, + "end": 267, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 258, + "end": 267, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 264, + "end": 265, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 264, + "end": 265, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 259, + "end": 262, + "ctxt": 0 + }, + "tail": false, + "cooked": "get", + "raw": "get" + }, + { + "type": "TemplateElement", + "span": { + "start": 266, + "end": 266, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 270, + "end": 278, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 272, + "end": 276, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 272, + "end": 273, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 273, + "end": 276, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 275, + "end": 276, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 275, + "end": 276, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 292, + "end": 294, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 313, + "end": 328, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 313, + "end": 328, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 316, + "end": 328, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 318, + "end": 328, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 318, + "end": 325, + "ctxt": 0 + }, + "value": "Mapped2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 325, + "end": 328, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 326, + "end": 327, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 326, + "end": 327, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 330, + "end": 344, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 330, + "end": 344, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 333, + "end": 344, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 335, + "end": 344, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 335, + "end": 344, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 336, + "end": 339, + "ctxt": 0 + }, + "tail": false, + "cooked": "get", + "raw": "get" + }, + { + "type": "TemplateElement", + "span": { + "start": 343, + "end": 343, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 283, + "end": 393, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 346, + "end": 393, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 352, + "end": 381, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 358, + "end": 380, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 358, + "end": 359, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 359, + "end": 369, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 361, + "end": 369, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 363, + "end": 367, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 363, + "end": 364, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 364, + "end": 367, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 366, + "end": 367, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 366, + "end": 367, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 372, + "end": 380, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 372, + "end": 375, + "ctxt": 0 + }, + "value": "obj", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 375, + "end": 380, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 376, + "end": 379, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 294, + "end": 312, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 295, + "end": 311, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 295, + "end": 296, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 305, + "end": 311, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 395, + "end": 467, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 400, + "end": 407, + "ctxt": 0 + }, + "value": "Mapped3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 407, + "end": 425, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 408, + "end": 424, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 408, + "end": 409, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 418, + "end": 424, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 428, + "end": 466, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 431, + "end": 437, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 431, + "end": 432, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 436, + "end": 437, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 436, + "end": 437, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + "nameType": { + "type": "TsTypeReference", + "span": { + "start": 441, + "end": 453, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 441, + "end": 450, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 450, + "end": 453, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 451, + "end": 452, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 451, + "end": 452, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 456, + "end": 464, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 458, + "end": 462, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 458, + "end": 459, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 459, + "end": 462, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 461, + "end": 462, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 461, + "end": 462, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 478, + "end": 480, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 499, + "end": 514, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 499, + "end": 514, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 502, + "end": 514, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 504, + "end": 514, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 504, + "end": 511, + "ctxt": 0 + }, + "value": "Mapped3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 511, + "end": 514, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 512, + "end": 513, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 512, + "end": 513, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 516, + "end": 533, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 516, + "end": 533, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 519, + "end": 533, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 521, + "end": 533, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 521, + "end": 530, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 530, + "end": 533, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 531, + "end": 532, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 531, + "end": 532, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 469, + "end": 582, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 535, + "end": 582, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 541, + "end": 570, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 547, + "end": 569, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 547, + "end": 548, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 548, + "end": 558, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 550, + "end": 558, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 552, + "end": 556, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 552, + "end": 553, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 553, + "end": 556, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 555, + "end": 556, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 555, + "end": 556, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + } + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 561, + "end": 569, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 561, + "end": 564, + "ctxt": 0 + }, + "value": "obj", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 564, + "end": 569, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 565, + "end": 568, + "ctxt": 0 + }, + "value": "key", + "optional": false + } + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 480, + "end": 498, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 481, + "end": 497, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 481, + "end": 482, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 491, + "end": 497, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 606, + "end": 693, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 611, + "end": 614, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 614, + "end": 632, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 615, + "end": 631, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 615, + "end": 616, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 625, + "end": 631, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 635, + "end": 692, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 642, + "end": 656, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 642, + "end": 651, + "ctxt": 0 + }, + "value": "RemappedT", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 655, + "end": 656, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 655, + "end": 656, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "default": null + }, + "nameType": { + "type": "TsLiteralType", + "span": { + "start": 660, + "end": 677, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 660, + "end": 677, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 666, + "end": 675, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 666, + "end": 675, + "ctxt": 0 + }, + "value": "RemappedT", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 661, + "end": 664, + "ctxt": 0 + }, + "tail": false, + "cooked": "get", + "raw": "get" + }, + { + "type": "TemplateElement", + "span": { + "start": 676, + "end": 676, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 680, + "end": 689, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 680, + "end": 689, + "ctxt": 0 + }, + "value": "RemappedT", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 695, + "end": 766, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 701, + "end": 765, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 701, + "end": 704, + "ctxt": 0 + }, + "value": "get", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 707, + "end": 765, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 726, + "end": 730, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 727, + "end": 730, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 729, + "end": 730, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 729, + "end": 730, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 732, + "end": 743, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 735, + "end": 743, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 737, + "end": 743, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 737, + "end": 740, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 740, + "end": 743, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 741, + "end": 742, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 741, + "end": 742, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "body": { + "type": "MemberExpression", + "span": { + "start": 751, + "end": 765, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 751, + "end": 754, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 754, + "end": 765, + "ctxt": 0 + }, + "expression": { + "type": "TemplateLiteral", + "span": { + "start": 755, + "end": 764, + "ctxt": 0 + }, + "expressions": [ + { + "type": "Identifier", + "span": { + "start": 761, + "end": 762, + "ctxt": 0 + }, + "value": "t", + "optional": false + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 756, + "end": 759, + "ctxt": 0 + }, + "tail": false, + "cooked": "get", + "raw": "get" + }, + { + "type": "TemplateElement", + "span": { + "start": 763, + "end": 763, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + }, + "async": false, + "generator": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 707, + "end": 725, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 708, + "end": 724, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 708, + "end": 709, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 718, + "end": 724, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 744, + "end": 747, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 746, + "end": 747, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 746, + "end": 747, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + "definite": false + } + ] + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 849, + "end": 903, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 859, + "end": 865, + "ctxt": 0 + }, + "value": "Bounds", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 866, + "end": 903, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 872, + "end": 884, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 872, + "end": 875, + "ctxt": 0 + }, + "value": "min", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 875, + "end": 883, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 877, + "end": 883, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 889, + "end": 901, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 889, + "end": 892, + "ctxt": 0 + }, + "value": "max", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 892, + "end": 900, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 894, + "end": 900, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 905, + "end": 1009, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 910, + "end": 925, + "ctxt": 0 + }, + "value": "NumericBoundsOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 925, + "end": 928, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 926, + "end": 927, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 926, + "end": 927, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 931, + "end": 1009, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 938, + "end": 950, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 938, + "end": 939, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 943, + "end": 950, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 949, + "end": 950, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 949, + "end": 950, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": { + "type": "TsConditionalType", + "span": { + "start": 954, + "end": 997, + "ctxt": 0 + }, + "checkType": { + "type": "TsIndexedAccessType", + "span": { + "start": 954, + "end": 958, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 954, + "end": 955, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 954, + "end": 955, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 956, + "end": 957, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 956, + "end": 957, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "extendsType": { + "type": "TsUnionType", + "span": { + "start": 967, + "end": 985, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 967, + "end": 973, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 976, + "end": 985, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 988, + "end": 989, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 988, + "end": 989, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 992, + "end": 997, + "ctxt": 0 + }, + "kind": "never" + } + }, + "optional": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1000, + "end": 1006, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1000, + "end": 1006, + "ctxt": 0 + }, + "value": "Bounds", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1020, + "end": 1028, + "ctxt": 0 + }, + "value": "validate", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1047, + "end": 1053, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1047, + "end": 1053, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1050, + "end": 1053, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1052, + "end": 1053, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1052, + "end": 1053, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1055, + "end": 1081, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1055, + "end": 1081, + "ctxt": 0 + }, + "value": "bounds", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1061, + "end": 1081, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1063, + "end": 1081, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1063, + "end": 1078, + "ctxt": 0 + }, + "value": "NumericBoundsOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1078, + "end": 1081, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1079, + "end": 1080, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1079, + "end": 1080, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1011, + "end": 1370, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1083, + "end": 1370, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ForOfStatement", + "span": { + "start": 1089, + "end": 1351, + "ctxt": 0 + }, + "await": null, + "left": { + "type": "VariableDeclaration", + "span": { + "start": 1094, + "end": 1110, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1100, + "end": 1110, + "ctxt": 0 + }, + "id": { + "type": "ArrayPattern", + "span": { + "start": 1100, + "end": 1110, + "ctxt": 0 + }, + "elements": [ + { + "type": "Identifier", + "span": { + "start": 1101, + "end": 1104, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": null + }, + { + "type": "Identifier", + "span": { + "start": 1106, + "end": 1109, + "ctxt": 0 + }, + "value": "val", + "optional": false, + "typeAnnotation": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": null, + "definite": false + } + ] + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1114, + "end": 1133, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1114, + "end": 1128, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1114, + "end": 1120, + "ctxt": 0 + }, + "value": "Object", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1121, + "end": 1128, + "ctxt": 0 + }, + "value": "entries", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1129, + "end": 1132, + "ctxt": 0 + }, + "value": "obj", + "optional": false + } + } + ], + "typeArguments": null + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1135, + "end": 1351, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1145, + "end": 1206, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1151, + "end": 1205, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1151, + "end": 1163, + "ctxt": 0 + }, + "value": "boundsForKey", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 1166, + "end": 1205, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1166, + "end": 1172, + "ctxt": 0 + }, + "value": "bounds", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 1172, + "end": 1205, + "ctxt": 0 + }, + "expression": { + "type": "TsAsExpression", + "span": { + "start": 1173, + "end": 1204, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1173, + "end": 1176, + "ctxt": 0 + }, + "value": "key", + "optional": false + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 1180, + "end": 1204, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1186, + "end": 1204, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1186, + "end": 1201, + "ctxt": 0 + }, + "value": "NumericBoundsOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1201, + "end": 1204, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1202, + "end": 1203, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1202, + "end": 1203, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + } + }, + "definite": false + } + ] + }, + { + "type": "IfStatement", + "span": { + "start": 1215, + "end": 1345, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 1219, + "end": 1231, + "ctxt": 0 + }, + "value": "boundsForKey", + "optional": false + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1233, + "end": 1345, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1247, + "end": 1281, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1253, + "end": 1280, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1253, + "end": 1265, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1255, + "end": 1258, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1255, + "end": 1258, + "ctxt": 0 + }, + "value": "min", + "optional": false + }, + "value": null + }, + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1260, + "end": 1263, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1260, + "end": 1263, + "ctxt": 0 + }, + "value": "max", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1268, + "end": 1280, + "ctxt": 0 + }, + "value": "boundsForKey", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "IfStatement", + "span": { + "start": 1294, + "end": 1335, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1298, + "end": 1320, + "ctxt": 0 + }, + "operator": "||", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1298, + "end": 1307, + "ctxt": 0 + }, + "operator": ">", + "left": { + "type": "Identifier", + "span": { + "start": 1298, + "end": 1301, + "ctxt": 0 + }, + "value": "min", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1304, + "end": 1307, + "ctxt": 0 + }, + "value": "val", + "optional": false + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1311, + "end": 1320, + "ctxt": 0 + }, + "operator": "<", + "left": { + "type": "Identifier", + "span": { + "start": 1311, + "end": 1314, + "ctxt": 0 + }, + "value": "max", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1317, + "end": 1320, + "ctxt": 0 + }, + "value": "val", + "optional": false + } + } + }, + "consequent": { + "type": "ReturnStatement", + "span": { + "start": 1322, + "end": 1335, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 1329, + "end": 1334, + "ctxt": 0 + }, + "value": false + } + }, + "alternate": null + } + ] + }, + "alternate": null + } + ] + } + }, + { + "type": "ReturnStatement", + "span": { + "start": 1356, + "end": 1368, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 1363, + "end": 1367, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1028, + "end": 1046, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1029, + "end": 1045, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1029, + "end": 1030, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1039, + "end": 1045, + "ctxt": 0 + }, + "kind": "object" + }, + "default": null + } + ] + }, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.ts b/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.ts new file mode 100644 index 00000000000..ed08d53d8f7 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/mappedTypeConstraints2.ts @@ -0,0 +1,51 @@ +// @strict: true +// @declaration: true +// @target: es2017 + +type Mapped1 = { [P in K]: { a: P } }; + +function f1(obj: Mapped1, key: K) { + const x: { a: K } = obj[key]; +} + +type Mapped2 = { [P in K as `get${P}`]: { a: P } }; + +function f2(obj: Mapped2, key: `get${K}`) { + const x: { a: K } = obj[key]; // Error +} + +type Mapped3 = { [P in K as Uppercase

]: { a: P } }; + +function f3(obj: Mapped3, key: Uppercase) { + const x: { a: K } = obj[key]; // Error +} + +// Repro from #47794 + +type Foo = { + [RemappedT in T as `get${RemappedT}`]: RemappedT; +}; + +const get = (t: T, foo: Foo): T => foo[`get${t}`]; // Type 'Foo[`get${T}`]' is not assignable to type 'T' + +// Repro from #48626 + +interface Bounds { + min: number; + max: number; +} + +type NumericBoundsOf = { + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +} + +function validate(obj: T, bounds: NumericBoundsOf) { + for (const [key, val] of Object.entries(obj)) { + const boundsForKey = bounds[key as keyof NumericBoundsOf]; + if (boundsForKey) { + const { min, max } = boundsForKey; + if (min > val || max < val) return false; + } + } + return true; +} diff --git a/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.json b/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.json new file mode 100644 index 00000000000..bed590813c4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.json @@ -0,0 +1,213 @@ +{ + "type": "Module", + "span": { + "start": 20, + "end": 125, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 20, + "end": 40, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 27, + "end": 40, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 32, + "end": 33, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 36, + "end": 39, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 36, + "end": 39, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 61, + "end": 90, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 75, + "end": 76, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 75, + "end": 76, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 84, + "end": 89, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 91, + "end": 108, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 97, + "end": 107, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 97, + "end": 98, + "ctxt": 0 + }, + "value": "A", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 98, + "end": 101, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 100, + "end": 101, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 100, + "end": 101, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + } + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 104, + "end": 107, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 109, + "end": 125, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 109, + "end": 124, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 109, + "end": 122, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 109, + "end": 110, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 111, + "end": 122, + "ctxt": 0 + }, + "value": "toUpperCase", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.ts b/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.ts new file mode 100644 index 00000000000..489f73a11a8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/mergedWithLocalValue.ts @@ -0,0 +1,7 @@ +// @Filename: a.ts +export type A = "a"; + +// @Filename: b.ts +import type { A } from "./a"; +const A: A = "a"; +A.toUpperCase(); diff --git a/crates/swc_ecma_parser/tests/tsc/modifierOnClassDeclarationMemberInFunction.ts b/crates/swc_ecma_parser/tests/tsc/modifierOnClassDeclarationMemberInFunction.ts index 2f62dfcc541..8d78b978f67 100644 --- a/crates/swc_ecma_parser/tests/tsc/modifierOnClassDeclarationMemberInFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/modifierOnClassDeclarationMemberInFunction.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f() { class C { diff --git a/crates/swc_ecma_parser/tests/tsc/modifierOnClassExpressionMemberInFunction.ts b/crates/swc_ecma_parser/tests/tsc/modifierOnClassExpressionMemberInFunction.ts index f848ff8531e..79164d9f59f 100644 --- a/crates/swc_ecma_parser/tests/tsc/modifierOnClassExpressionMemberInFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/modifierOnClassExpressionMemberInFunction.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true // @declaration: true function g() { diff --git a/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.json b/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.json new file mode 100644 index 00000000000..98be2ba8dd9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.json @@ -0,0 +1,2605 @@ +{ + "type": "Script", + "span": { + "start": 75, + "end": 1797, + "ctxt": 0 + }, + "body": [ + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 81, + "end": 86, + "ctxt": 0 + }, + "value": "Thing", + "optional": false + }, + "declare": false, + "span": { + "start": 75, + "end": 97, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 90, + "end": 95, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 90, + "end": 91, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 94, + "end": 95, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "typeAnnotation": null, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 104, + "end": 116, + "ctxt": 0 + }, + "value": "AnotherThing", + "optional": false + }, + "declare": false, + "span": { + "start": 98, + "end": 127, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 119, + "end": 124, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 119, + "end": 120, + "ctxt": 0 + }, + "value": "y", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 123, + "end": 124, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + }, + "typeAnnotation": null, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 137, + "end": 140, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 128, + "end": 155, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 143, + "end": 155, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 145, + "end": 153, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 152, + "end": 153, + "ctxt": 0 + }, + "value": 3.0, + "raw": "3" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 165, + "end": 168, + "ctxt": 0 + }, + "value": "bar", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 156, + "end": 183, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 171, + "end": 183, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 173, + "end": 181, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 180, + "end": 181, + "ctxt": 0 + }, + "value": 4.0, + "raw": "4" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 219, + "end": 332, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 219, + "end": 332, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 219, + "end": 233, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 219, + "end": 225, + "ctxt": 0 + }, + "value": "module", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 226, + "end": 233, + "ctxt": 0 + }, + "value": "exports", + "optional": false + } + }, + "right": { + "type": "ObjectExpression", + "span": { + "start": 236, + "end": 332, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 242, + "end": 247, + "ctxt": 0 + }, + "value": "Thing", + "optional": false + }, + { + "type": "Identifier", + "span": { + "start": 253, + "end": 265, + "ctxt": 0 + }, + "value": "AnotherThing", + "optional": false + }, + { + "type": "Identifier", + "span": { + "start": 271, + "end": 274, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 280, + "end": 283, + "ctxt": 0 + }, + "value": "qux", + "optional": false + }, + "value": { + "type": "Identifier", + "span": { + "start": 285, + "end": 288, + "ctxt": 0 + }, + "value": "bar", + "optional": false + } + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "value": "baz", + "optional": false + }, + "params": [], + "decorators": [], + "span": { + "start": 294, + "end": 312, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 300, + "end": 312, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 302, + "end": 310, + "ctxt": 0 + }, + "argument": { + "type": "NumericLiteral", + "span": { + "start": 309, + "end": 310, + "ctxt": 0 + }, + "value": 5.0, + "raw": "5" + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 318, + "end": 325, + "ctxt": 0 + }, + "value": "literal", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 327, + "end": 329, + "ctxt": 0 + }, + "value": "", + "raw": "\"\"" + } + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 625, + "end": 632, + "ctxt": 0 + }, + "value": "jstypes", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 633, + "end": 634, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 633, + "end": 634, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 636, + "end": 637, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 636, + "end": 637, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 639, + "end": 640, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 639, + "end": 640, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 642, + "end": 643, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 642, + "end": 643, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 645, + "end": 646, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 645, + "end": 646, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 648, + "end": 649, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 648, + "end": 649, + "ctxt": 0 + }, + "value": "f", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 651, + "end": 652, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 651, + "end": 652, + "ctxt": 0 + }, + "value": "g", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 616, + "end": 713, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 654, + "end": 713, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 660, + "end": 711, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 711, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 700, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 694, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 688, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 682, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 667, + "end": 676, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "MemberExpression", + "span": { + "start": 667, + "end": 670, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 667, + "end": 668, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 669, + "end": 670, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 673, + "end": 676, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 673, + "end": 674, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 675, + "end": 676, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 679, + "end": 682, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 679, + "end": 680, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 685, + "end": 688, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 685, + "end": 686, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 691, + "end": 694, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 691, + "end": 692, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 697, + "end": 700, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 697, + "end": 698, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 703, + "end": 711, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 703, + "end": 704, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 705, + "end": 711, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1034, + "end": 1042, + "ctxt": 0 + }, + "value": "jsvalues", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1043, + "end": 1044, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1043, + "end": 1044, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1046, + "end": 1047, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1046, + "end": 1047, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1049, + "end": 1050, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1049, + "end": 1050, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1052, + "end": 1053, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1052, + "end": 1053, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1055, + "end": 1056, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1055, + "end": 1056, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1058, + "end": 1059, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1058, + "end": 1059, + "ctxt": 0 + }, + "value": "f", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 1061, + "end": 1062, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1061, + "end": 1062, + "ctxt": 0 + }, + "value": "g", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 1025, + "end": 1133, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1064, + "end": 1133, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1070, + "end": 1131, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1131, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1120, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1114, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1108, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1102, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1077, + "end": 1096, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "MemberExpression", + "span": { + "start": 1077, + "end": 1085, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1077, + "end": 1078, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1079, + "end": 1085, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1088, + "end": 1096, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1088, + "end": 1089, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1090, + "end": 1096, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1099, + "end": 1102, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1099, + "end": 1100, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1105, + "end": 1108, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1105, + "end": 1106, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1111, + "end": 1114, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1111, + "end": 1112, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1117, + "end": 1120, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1117, + "end": 1118, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1123, + "end": 1131, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1123, + "end": 1124, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1125, + "end": 1131, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1168, + "end": 1173, + "ctxt": 0 + }, + "value": "types", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1179, + "end": 1203, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1179, + "end": 1203, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1180, + "end": 1203, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1182, + "end": 1203, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1189, + "end": 1196, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1198, + "end": 1203, + "ctxt": 0 + }, + "value": "Thing", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1209, + "end": 1240, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1209, + "end": 1240, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1210, + "end": 1240, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1212, + "end": 1240, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1219, + "end": 1226, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1228, + "end": 1240, + "ctxt": 0 + }, + "value": "AnotherThing", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1246, + "end": 1268, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1246, + "end": 1268, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1247, + "end": 1268, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1249, + "end": 1268, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1256, + "end": 1263, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1265, + "end": 1268, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1274, + "end": 1296, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1274, + "end": 1296, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1275, + "end": 1296, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1277, + "end": 1296, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1284, + "end": 1291, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1293, + "end": 1296, + "ctxt": 0 + }, + "value": "qux", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1302, + "end": 1324, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1302, + "end": 1324, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1303, + "end": 1324, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1305, + "end": 1324, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1312, + "end": 1319, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1321, + "end": 1324, + "ctxt": 0 + }, + "value": "baz", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1330, + "end": 1352, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1330, + "end": 1352, + "ctxt": 0 + }, + "value": "f", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1331, + "end": 1352, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1333, + "end": 1352, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1340, + "end": 1347, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1349, + "end": 1352, + "ctxt": 0 + }, + "value": "buz", + "optional": false + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1358, + "end": 1384, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1358, + "end": 1384, + "ctxt": 0 + }, + "value": "g", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1359, + "end": 1384, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsImportType", + "span": { + "start": 1361, + "end": 1384, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1368, + "end": 1375, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1377, + "end": 1384, + "ctxt": 0 + }, + "value": "literal", + "optional": false + }, + "typeArguments": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1159, + "end": 1447, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1388, + "end": 1447, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1394, + "end": 1445, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1445, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1434, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1428, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1422, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1416, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1401, + "end": 1410, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "MemberExpression", + "span": { + "start": 1401, + "end": 1404, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1401, + "end": 1402, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1403, + "end": 1404, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1407, + "end": 1410, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1407, + "end": 1408, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1409, + "end": 1410, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1413, + "end": 1416, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1413, + "end": 1414, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1419, + "end": 1422, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1419, + "end": 1420, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1425, + "end": 1428, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1425, + "end": 1426, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1431, + "end": 1434, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1431, + "end": 1432, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1437, + "end": 1445, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1437, + "end": 1438, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1439, + "end": 1445, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1458, + "end": 1464, + "ctxt": 0 + }, + "value": "values", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1470, + "end": 1501, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1470, + "end": 1501, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1471, + "end": 1501, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1473, + "end": 1501, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1480, + "end": 1501, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1487, + "end": 1494, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1496, + "end": 1501, + "ctxt": 0 + }, + "value": "Thing", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1507, + "end": 1545, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1507, + "end": 1545, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1508, + "end": 1545, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1510, + "end": 1545, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1517, + "end": 1545, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1524, + "end": 1531, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1533, + "end": 1545, + "ctxt": 0 + }, + "value": "AnotherThing", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1551, + "end": 1580, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1551, + "end": 1580, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1552, + "end": 1580, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1554, + "end": 1580, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1561, + "end": 1580, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1568, + "end": 1575, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1577, + "end": 1580, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1586, + "end": 1615, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1586, + "end": 1615, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1587, + "end": 1615, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1589, + "end": 1615, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1596, + "end": 1615, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1603, + "end": 1610, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1612, + "end": 1615, + "ctxt": 0 + }, + "value": "qux", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1621, + "end": 1650, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1621, + "end": 1650, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1622, + "end": 1650, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1624, + "end": 1650, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1631, + "end": 1650, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1638, + "end": 1645, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1647, + "end": 1650, + "ctxt": 0 + }, + "value": "baz", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1656, + "end": 1685, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1656, + "end": 1685, + "ctxt": 0 + }, + "value": "f", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1657, + "end": 1685, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1659, + "end": 1685, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1666, + "end": 1685, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1673, + "end": 1680, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1682, + "end": 1685, + "ctxt": 0 + }, + "value": "buz", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1691, + "end": 1724, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1691, + "end": 1724, + "ctxt": 0 + }, + "value": "g", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1692, + "end": 1724, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 1694, + "end": 1724, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 1701, + "end": 1724, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 1708, + "end": 1715, + "ctxt": 0 + }, + "value": "./mod", + "raw": "'./mod'" + }, + "qualifier": { + "type": "Identifier", + "span": { + "start": 1717, + "end": 1724, + "ctxt": 0 + }, + "value": "literal", + "optional": false + }, + "typeArguments": null + }, + "typeArguments": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1449, + "end": 1797, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1728, + "end": 1797, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 1734, + "end": 1795, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1795, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1784, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1778, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1772, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1766, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1741, + "end": 1760, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "MemberExpression", + "span": { + "start": 1741, + "end": 1749, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1741, + "end": 1742, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1743, + "end": 1749, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1752, + "end": 1760, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1752, + "end": 1753, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1754, + "end": 1760, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1763, + "end": 1766, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1763, + "end": 1764, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1769, + "end": 1772, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1769, + "end": 1770, + "ctxt": 0 + }, + "value": "d", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1775, + "end": 1778, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1775, + "end": 1776, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "CallExpression", + "span": { + "start": 1781, + "end": 1784, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1781, + "end": 1782, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 1787, + "end": 1795, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1787, + "end": 1788, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1789, + "end": 1795, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.ts b/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.ts new file mode 100644 index 00000000000..1e73f7bbb48 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/moduleExportAssignment7.ts @@ -0,0 +1,69 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @Filename: mod.js +class Thing { x = 1 } +class AnotherThing { y = 2 } +function foo() { return 3 } +function bar() { return 4 } +/** @typedef {() => number} buz */ +module.exports = { + Thing, + AnotherThing, + foo, + qux: bar, + baz() { return 5 }, + literal: "", +} +// @Filename: main.js +/** + * @param {import("./mod").Thing} a + * @param {import("./mod").AnotherThing} b + * @param {import("./mod").foo} c + * @param {import("./mod").qux} d + * @param {import("./mod").baz} e + * @param {import("./mod").buz} f + * @param {import("./mod").literal} g + */ +function jstypes(a, b, c, d, e, f, g) { + return a.x + b.y + c() + d() + e() + f() + g.length +} + +/** + * @param {typeof import("./mod").Thing} a + * @param {typeof import("./mod").AnotherThing} b + * @param {typeof import("./mod").foo} c + * @param {typeof import("./mod").qux} d + * @param {typeof import("./mod").baz} e + * @param {typeof import("./mod").buz} f + * @param {typeof import("./mod").literal} g + */ +function jsvalues(a, b, c, d, e, f, g) { + return a.length + b.length + c() + d() + e() + f() + g.length +} + +// @Filename: index.ts + +function types( + a: import('./mod').Thing, + b: import('./mod').AnotherThing, + c: import('./mod').foo, + d: import('./mod').qux, + e: import('./mod').baz, + f: import('./mod').buz, + g: import('./mod').literal, +) { + return a.x + b.y + c() + d() + e() + f() + g.length +} + +function values( + a: typeof import('./mod').Thing, + b: typeof import('./mod').AnotherThing, + c: typeof import('./mod').foo, + d: typeof import('./mod').qux, + e: typeof import('./mod').baz, + f: typeof import('./mod').buz, + g: typeof import('./mod').literal, +) { + return a.length + b.length + c() + d() + e() + f() + g.length +} diff --git a/crates/swc_ecma_parser/tests/tsc/multiline.json b/crates/swc_ecma_parser/tests/tsc/multiline.json deleted file mode 100644 index 2c0ba49c00d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/multiline.json +++ /dev/null @@ -1,1284 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 19, - "end": 814, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 19, - "end": 53, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 26, - "end": 53, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 52, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 37, - "ctxt": 0 - }, - "value": "texts", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 50, - "end": 52, - "ctxt": 0 - }, - "elements": [] - }, - "definite": false - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 74, - "end": 90, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 74, - "end": 89, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 74, - "end": 84, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 74, - "end": 79, - "ctxt": 0 - }, - "value": "texts", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 80, - "end": 84, - "ctxt": 0 - }, - "value": "push", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 85, - "end": 88, - "ctxt": 0 - }, - "value": 100.0 - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 117, - "end": 133, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 117, - "end": 132, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 117, - "end": 127, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 117, - "end": 122, - "ctxt": 0 - }, - "value": "texts", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 123, - "end": 127, - "ctxt": 0 - }, - "value": "push", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "value": 100.0 - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 160, - "end": 178, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 160, - "end": 177, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 160, - "end": 170, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 160, - "end": 165, - "ctxt": 0 - }, - "value": "texts", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - }, - "value": "push", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 171, - "end": 176, - "ctxt": 0 - }, - "value": "100", - "raw": "\"100\"" - } - } - ], - "typeArguments": null - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 249, - "end": 280, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 256, - "end": 266, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 261, - "end": 266, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 272, - "end": 279, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 282, - "end": 355, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 298, - "end": 309, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 310, - "end": 332, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 310, - "end": 332, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 315, - "end": 332, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 317, - "end": 332, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 319, - "end": 330, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 289, - "end": 355, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 334, - "end": 355, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 338, - "end": 353, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 345, - "end": 352, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 345, - "end": 352, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 357, - "end": 814, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 361, - "end": 813, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 361, - "end": 362, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ParenthesisExpression", - "span": { - "start": 365, - "end": 813, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 369, - "end": 811, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 370, - "end": 373, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 369, - "end": 374, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 374, - "end": 379, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 379, - "end": 400, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 399, - "end": 399, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 400, - "end": 405, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 405, - "end": 430, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 406, - "end": 417, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 405, - "end": 430, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 418, - "end": 427, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 421, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 422, - "end": 427, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 430, - "end": 436, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 436, - "end": 452, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 451, - "end": 451, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 452, - "end": 457, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 457, - "end": 482, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 458, - "end": 469, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 457, - "end": 482, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 470, - "end": 479, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 470, - "end": 473, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 474, - "end": 479, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 482, - "end": 488, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 488, - "end": 515, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 514, - "end": 514, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 515, - "end": 520, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 520, - "end": 545, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 521, - "end": 532, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 520, - "end": 545, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 533, - "end": 542, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 533, - "end": 536, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 537, - "end": 542, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 538, - "end": 541, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 545, - "end": 551, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 551, - "end": 581, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 580, - "end": 580, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 581, - "end": 586, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 586, - "end": 611, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 587, - "end": 598, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 586, - "end": 611, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 599, - "end": 608, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 599, - "end": 602, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 603, - "end": 608, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 604, - "end": 607, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 611, - "end": 617, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 617, - "end": 646, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 645, - "end": 645, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 646, - "end": 651, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 651, - "end": 676, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 652, - "end": 663, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 651, - "end": 676, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 664, - "end": 673, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 664, - "end": 667, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 668, - "end": 673, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 669, - "end": 672, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 676, - "end": 682, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 682, - "end": 704, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 703, - "end": 703, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 704, - "end": 709, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 709, - "end": 734, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 710, - "end": 721, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 709, - "end": 734, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 722, - "end": 731, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 722, - "end": 725, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 726, - "end": 731, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 727, - "end": 730, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 734, - "end": 740, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 740, - "end": 767, - "ctxt": 0 - }, - "expression": { - "type": "JSXEmptyExpression", - "span": { - "start": 766, - "end": 766, - "ctxt": 0 - } - } - }, - { - "type": "JSXText", - "span": { - "start": 767, - "end": 772, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 772, - "end": 802, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 773, - "end": 784, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 772, - "end": 802, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 785, - "end": 799, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 785, - "end": 788, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 789, - "end": 799, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 790, - "end": 798, - "ctxt": 0 - }, - "value": "hooray", - "raw": "\"hooray\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 802, - "end": 805, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 805, - "end": 811, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 807, - "end": 810, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault1.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault1.ts index c9f3aa70634..34eba16193e 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault1.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault1.ts @@ -1,4 +1,4 @@ -export default function Foo (){ +export default function Foo (){ } diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault2.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault2.ts index bb7cbc15412..ea45c36f32f 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault2.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault2.ts @@ -1,4 +1,4 @@ -export default { +export default { uhoh: "another default", }; diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault3.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault3.ts index 9bf87ed8a7a..395c65552a8 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault3.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault3.ts @@ -1,4 +1,4 @@ -export default { +export default { uhoh: "another default", }; diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault4.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault4.ts index 867d6014111..0f3dba780ef 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault4.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault4.ts @@ -1,4 +1,4 @@ -export default class C { } +export default class C { } export default { uhoh: "another default", diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault5.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault5.ts index e891192e090..f41f5b90440 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault5.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault5.ts @@ -1,2 +1,2 @@ -export default function bar() { } +export default function bar() { } export default class C {} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault6.ts b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault6.ts index 4b39b6a9c5f..498f58f1620 100644 --- a/crates/swc_ecma_parser/tests/tsc/multipleExportDefault6.ts +++ b/crates/swc_ecma_parser/tests/tsc/multipleExportDefault6.ts @@ -1,4 +1,4 @@ -export default { +export default { lol: 1 } diff --git a/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.json b/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.json deleted file mode 100644 index e15984d85b2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.json +++ /dev/null @@ -1,2016 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 28, - "end": 967, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 28, - "end": 41, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 40, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 42, - "end": 56, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 46, - "end": 55, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 46, - "end": 50, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 55, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 57, - "end": 84, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 61, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 61, - "end": 65, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 65, - "end": 72, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 67, - "end": 72, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 67, - "end": 70, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 76, - "end": 78, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 80, - "end": 82, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 85, - "end": 102, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 89, - "end": 102, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 92, - "end": 102, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 94, - "end": 102, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 97, - "end": 102, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 100, - "end": 102, - "ctxt": 0 - }, - "members": [] - } - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 103, - "end": 137, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 107, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 107, - "end": 111, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 114, - "end": 136, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 119, - "end": 121, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 126, - "end": 135, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 148, - "end": 151, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 139, - "end": 187, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 159, - "end": 187, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 171, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 176, - "end": 185, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 183, - "end": 184, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 188, - "end": 281, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 202, - "end": 216, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 209, - "end": 210, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 215, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 221, - "end": 279, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 228, - "end": 231, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 221, - "end": 279, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 239, - "end": 279, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 249, - "end": 255, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 264, - "end": 273, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 233, - "end": 238, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 282, - "end": 317, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 291, - "end": 317, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 297, - "end": 315, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 304, - "end": 315, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 308, - "end": 314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 311, - "end": 314, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 337, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 322, - "end": 336, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 322, - "end": 326, - "ctxt": 0 - }, - "value": "objA", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 329, - "end": 336, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 333, - "end": 334, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 355, - "end": 383, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 359, - "end": 382, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 359, - "end": 374, - "ctxt": 0 - }, - "value": "ResultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 378, - "end": 382, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 384, - "end": 412, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 388, - "end": 411, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 388, - "end": 403, - "ctxt": 0 - }, - "value": "ResultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 406, - "end": 411, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 438, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 417, - "end": 437, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 417, - "end": 432, - "ctxt": 0 - }, - "value": "ResultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 435, - "end": 437, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 436, - "end": 437, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 439, - "end": 464, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 443, - "end": 463, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 443, - "end": 458, - "ctxt": 0 - }, - "value": "ResultIsNumber4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 461, - "end": 463, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 465, - "end": 492, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 469, - "end": 491, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 469, - "end": 484, - "ctxt": 0 - }, - "value": "ResultIsNumber5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 487, - "end": 491, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 488, - "end": 491, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 521, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 520, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 512, - "ctxt": 0 - }, - "value": "ResultIsNumber6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 515, - "end": 520, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 516, - "end": 520, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 543, - "end": 576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 547, - "end": 575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 547, - "end": 562, - "ctxt": 0 - }, - "value": "ResultIsNumber7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 565, - "end": 575, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 566, - "end": 575, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 577, - "end": 604, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 581, - "end": 603, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 581, - "end": 595, - "ctxt": 0 - }, - "value": "ResultIsNumber", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 598, - "end": 603, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "NullLiteral", - "span": { - "start": 599, - "end": 603, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 630, - "end": 661, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 634, - "end": 660, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 634, - "end": 649, - "ctxt": 0 - }, - "value": "ResultIsNumber8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 652, - "end": 660, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 653, - "end": 660, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 653, - "end": 657, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 657, - "end": 660, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 658, - "end": 659, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 662, - "end": 692, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 666, - "end": 691, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 666, - "end": 681, - "ctxt": 0 - }, - "value": "ResultIsNumber9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 684, - "end": 691, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 685, - "end": 691, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 685, - "end": 689, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 690, - "end": 691, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 693, - "end": 724, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 697, - "end": 723, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 697, - "end": 713, - "ctxt": 0 - }, - "value": "ResultIsNumber10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 716, - "end": 723, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 717, - "end": 723, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 717, - "end": 721, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 722, - "end": 723, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 725, - "end": 756, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 729, - "end": 755, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 729, - "end": 745, - "ctxt": 0 - }, - "value": "ResultIsNumber11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 748, - "end": 755, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 749, - "end": 755, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 749, - "end": 753, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 754, - "end": 755, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 757, - "end": 785, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 761, - "end": 784, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 761, - "end": 777, - "ctxt": 0 - }, - "value": "ResultIsNumber12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 780, - "end": 784, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 781, - "end": 784, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 781, - "end": 782, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 783, - "end": 784, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 786, - "end": 816, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 790, - "end": 815, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 790, - "end": 806, - "ctxt": 0 - }, - "value": "ResultIsNumber13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 809, - "end": 815, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "CallExpression", - "span": { - "start": 810, - "end": 815, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 810, - "end": 813, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 817, - "end": 849, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 821, - "end": 848, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 821, - "end": 837, - "ctxt": 0 - }, - "value": "ResultIsNumber14", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 840, - "end": 848, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "CallExpression", - "span": { - "start": 841, - "end": 848, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 841, - "end": 846, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 841, - "end": 842, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 843, - "end": 846, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 850, - "end": 887, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 854, - "end": 886, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 854, - "end": 870, - "ctxt": 0 - }, - "value": "ResultIsNumber15", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 873, - "end": 886, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 874, - "end": 886, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 875, - "end": 885, - "ctxt": 0 - }, - "operator": "-", - "left": { - "type": "Identifier", - "span": { - "start": 875, - "end": 878, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 881, - "end": 885, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 918, - "end": 923, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 918, - "end": 922, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 919, - "end": 922, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 924, - "end": 930, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 924, - "end": 929, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 925, - "end": 929, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 931, - "end": 940, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 931, - "end": 939, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 932, - "end": 939, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 932, - "end": 936, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 936, - "end": 939, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 941, - "end": 952, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 941, - "end": 951, - "ctxt": 0 - }, - "expressions": [ - { - "type": "UnaryExpression", - "span": { - "start": 941, - "end": 945, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "Identifier", - "span": { - "start": 942, - "end": 945, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - }, - { - "type": "Identifier", - "span": { - "start": 947, - "end": 951, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 953, - "end": 961, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 953, - "end": 960, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 954, - "end": 960, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 954, - "end": 958, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 959, - "end": 960, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 962, - "end": 967, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 962, - "end": 966, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "MemberExpression", - "span": { - "start": 963, - "end": 966, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 963, - "end": 964, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 965, - "end": 966, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.ts b/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.ts deleted file mode 100644 index d29b1a845eb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/negateOperatorWithAnyOtherType.ts +++ /dev/null @@ -1,53 +0,0 @@ -// - operator on any type - -var ANY: any; -var ANY1: any; -var ANY2: any[] = ["", ""]; -var obj: () => {} -var obj1 = { x: "", y: () => { }}; - -function foo(): any { - var a; - return a; -} -class A { - public a: any; - static foo(): any { - var a; - return a; - } -} -module M { - export var n: any; -} -var objA = new A(); - -// any type var -var ResultIsNumber1 = -ANY1; -var ResultIsNumber2 = -ANY2; -var ResultIsNumber3 = -A; -var ResultIsNumber4 = -M; -var ResultIsNumber5 = -obj; -var ResultIsNumber6 = -obj1; - -// any type literal -var ResultIsNumber7 = -undefined; -var ResultIsNumber = -null; - -// any type expressions -var ResultIsNumber8 = -ANY2[0]; -var ResultIsNumber9 = -obj1.x; -var ResultIsNumber10 = -obj1.y; -var ResultIsNumber11 = -objA.a; -var ResultIsNumber12 = -M.n; -var ResultIsNumber13 = -foo(); -var ResultIsNumber14 = -A.foo(); -var ResultIsNumber15 = -(ANY - ANY1); - -// miss assignment operators --ANY; --ANY1; --ANY2[0]; --ANY, ANY1; --objA.a; --M.n; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.json b/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.json deleted file mode 100644 index 7afceb85bf4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.json +++ /dev/null @@ -1,977 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 2, - "end": 631, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 8, - "end": 10, - "ctxt": 0 - }, - "value": "C0", - "optional": false - }, - "declare": false, - "span": { - "start": 2, - "end": 15, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 24, - "ctxt": 0 - }, - "value": "C1", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 70, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 31, - "end": 68, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 42, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 43, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 43, - "end": 52, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 44, - "end": 52, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 46, - "end": 52, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 54, - "end": 63, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 54, - "end": 63, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 55, - "end": 63, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 57, - "end": 63, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 65, - "end": 68, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 78, - "end": 79, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "declare": false, - "span": { - "start": 72, - "end": 113, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 89, - "end": 111, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 89, - "end": 100, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 101, - "end": 106, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 101, - "end": 106, - "ctxt": 0 - }, - "value": "n", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 106, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 108, - "end": 111, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 115, - "end": 149, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 119, - "end": 148, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 126, - "ctxt": 0 - }, - "value": "anyCtor", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 126, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 128, - "end": 148, - "ctxt": 0 - }, - "members": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 134, - "end": 146, - "ctxt": 0 - }, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 151, - "end": 187, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "value": "anyCtor1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 163, - "end": 186, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 165, - "end": 186, - "ctxt": 0 - }, - "members": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 171, - "end": 184, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 189, - "end": 237, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 199, - "end": 209, - "ctxt": 0 - }, - "value": "nestedCtor", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 210, - "end": 237, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 216, - "end": 235, - "ctxt": 0 - }, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 222, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 234, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 224, - "end": 234, - "ctxt": 0 - }, - "value": "nestedCtor", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 238, - "end": 265, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 242, - "end": 264, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 242, - "end": 252, - "ctxt": 0 - }, - "value": "nestedCtor", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 252, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 254, - "end": 264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 254, - "end": 264, - "ctxt": 0 - }, - "value": "nestedCtor", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 355, - "end": 377, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 359, - "end": 369, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 363, - "end": 369, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 367, - "end": 369, - "ctxt": 0 - }, - "value": "C0", - "optional": false - }, - "arguments": null, - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 446, - "end": 461, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 450, - "end": 460, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 450, - "end": 452, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 455, - "end": 460, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 459, - "end": 460, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "arguments": null, - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 462, - "end": 476, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 466, - "end": 475, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 466, - "end": 468, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 468, - "end": 475, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 470, - "end": 475, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 470, - "end": 471, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 471, - "end": 475, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 472, - "end": 474, - "ctxt": 0 - }, - "members": [] - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 477, - "end": 500, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 481, - "end": 499, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 481, - "end": 483, - "ctxt": 0 - }, - "value": "c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 486, - "end": 499, - "ctxt": 0 - }, - "callee": { - "type": "TsInstantiation", - "span": { - "start": 490, - "end": 499, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 490, - "end": 491, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 491, - "end": 499, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 492, - "end": 498, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - }, - "arguments": null, - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 574, - "end": 582, - "ctxt": 0 - }, - "value": "fnNumber", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 565, - "end": 607, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 593, - "end": 607, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 595, - "end": 605, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 602, - "end": 604, - "ctxt": 0 - }, - "value": 32.0, - "raw": "32" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 584, - "end": 592, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 586, - "end": 592, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 608, - "end": 631, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 612, - "end": 630, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 612, - "end": 613, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 616, - "end": 630, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 620, - "end": 628, - "ctxt": 0 - }, - "value": "fnNumber", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.ts b/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.ts deleted file mode 100644 index 63ae5c6345b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/newOperatorErrorCases.ts +++ /dev/null @@ -1,37 +0,0 @@ - -class C0 { - -} -class C1 { - constructor(n: number, s: string) { } -} - -class T { - constructor(n?: T) { } -} - -var anyCtor: { - new (): any; -}; - -var anyCtor1: { - new (n): any; -}; - -interface nestedCtor { - new (): nestedCtor; -} -var nestedCtor: nestedCtor; - -// Construct expression with no parentheses for construct signature with > 0 parameters -var b = new C0 32, ''; // Parse error - -// Generic construct expression with no parentheses -var c1 = new T; -var c1: T<{}>; -var c2 = new T; // Ok - - -// Construct expression of non-void returning function -function fnNumber(): number { return 32; } -var s = new fnNumber(); // Error diff --git a/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.json b/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.json index a00477bdda9..c85fe170476 100644 --- a/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.json +++ b/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 54, - "end": 1745, + "end": 1901, "ctxt": 0 }, "body": [ @@ -1580,11 +1580,282 @@ } ] }, + { + "type": "BlockStatement", + "span": { + "start": 1284, + "end": 1438, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1290, + "end": 1322, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1296, + "end": 1321, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 1296, + "end": 1307, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 1298, + "end": 1299, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 1298, + "end": 1299, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "value": null + }, + { + "type": "RestElement", + "span": { + "start": 1301, + "end": 1305, + "ctxt": 0 + }, + "rest": { + "start": 1301, + "end": 1304, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 1304, + "end": 1305, + "ctxt": 0 + }, + "value": "q", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 1310, + "end": 1321, + "ctxt": 0 + }, + "value": "numMapPoint", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1327, + "end": 1344, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1327, + "end": 1343, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1327, + "end": 1341, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1327, + "end": 1328, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1334, + "end": 1341, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1363, + "end": 1382, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1363, + "end": 1381, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1363, + "end": 1379, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 1363, + "end": 1371, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1363, + "end": 1364, + "ctxt": 0 + }, + "value": "q", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1370, + "end": 1371, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 1372, + "end": 1379, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1401, + "end": 1420, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1401, + "end": 1419, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 1401, + "end": 1417, + "ctxt": 0 + }, + "object": { + "type": "MemberExpression", + "span": { + "start": 1401, + "end": 1409, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 1401, + "end": 1402, + "ctxt": 0 + }, + "value": "q", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 1408, + "end": 1409, + "ctxt": 0 + }, + "value": "z", + "optional": false + } + }, + "property": { + "type": "Identifier", + "span": { + "start": 1410, + "end": 1417, + "ctxt": 0 + }, + "value": "toFixed", + "optional": false + } + }, + "arguments": [], + "typeArguments": null + } + } + ] + }, { "type": "VariableDeclaration", "span": { - "start": 1285, - "end": 1319, + "start": 1441, + "end": 1475, "ctxt": 0 }, "kind": "let", @@ -1593,15 +1864,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1297, - "end": 1318, + "start": 1453, + "end": 1474, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1297, - "end": 1310, + "start": 1453, + "end": 1466, "ctxt": 0 }, "value": "target_string", @@ -1609,15 +1880,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1310, - "end": 1318, + "start": 1466, + "end": 1474, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 1312, - "end": 1318, + "start": 1468, + "end": 1474, "ctxt": 0 }, "kind": "string" @@ -1632,8 +1903,8 @@ { "type": "VariableDeclaration", "span": { - "start": 1320, - "end": 1372, + "start": 1476, + "end": 1528, "ctxt": 0 }, "kind": "let", @@ -1642,15 +1913,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1332, - "end": 1371, + "start": 1488, + "end": 1527, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1332, - "end": 1351, + "start": 1488, + "end": 1507, "ctxt": 0 }, "value": "target_string_undef", @@ -1658,23 +1929,23 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1351, - "end": 1371, + "start": 1507, + "end": 1527, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 1353, - "end": 1371, + "start": 1509, + "end": 1527, "ctxt": 0 }, "types": [ { "type": "TsKeywordType", "span": { - "start": 1353, - "end": 1359, + "start": 1509, + "end": 1515, "ctxt": 0 }, "kind": "string" @@ -1682,8 +1953,8 @@ { "type": "TsKeywordType", "span": { - "start": 1362, - "end": 1371, + "start": 1518, + "end": 1527, "ctxt": 0 }, "kind": "undefined" @@ -1700,8 +1971,8 @@ { "type": "VariableDeclaration", "span": { - "start": 1373, - "end": 1413, + "start": 1529, + "end": 1569, "ctxt": 0 }, "kind": "let", @@ -1710,15 +1981,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1385, - "end": 1412, + "start": 1541, + "end": 1568, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1385, - "end": 1402, + "start": 1541, + "end": 1558, "ctxt": 0 }, "value": "target_string_arr", @@ -1726,22 +1997,22 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1402, - "end": 1412, + "start": 1558, + "end": 1568, "ctxt": 0 }, "typeAnnotation": { "type": "TsArrayType", "span": { - "start": 1404, - "end": 1412, + "start": 1560, + "end": 1568, "ctxt": 0 }, "elemType": { "type": "TsKeywordType", "span": { - "start": 1404, - "end": 1410, + "start": 1560, + "end": 1566, "ctxt": 0 }, "kind": "string" @@ -1757,31 +2028,31 @@ { "type": "ExpressionStatement", "span": { - "start": 1435, - "end": 1462, + "start": 1591, + "end": 1618, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { - "start": 1435, - "end": 1461, + "start": 1591, + "end": 1617, "ctxt": 0 }, "operator": "=", "left": { "type": "ArrayPattern", "span": { - "start": 1435, - "end": 1450, + "start": 1591, + "end": 1606, "ctxt": 0 }, "elements": [ { "type": "Identifier", "span": { - "start": 1436, - "end": 1449, + "start": 1592, + "end": 1605, "ctxt": 0 }, "value": "target_string", @@ -1795,8 +2066,8 @@ "right": { "type": "Identifier", "span": { - "start": 1453, - "end": 1461, + "start": 1609, + "end": 1617, "ctxt": 0 }, "value": "strArray", @@ -1807,31 +2078,31 @@ { "type": "ExpressionStatement", "span": { - "start": 1479, - "end": 1512, + "start": 1635, + "end": 1668, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { - "start": 1479, - "end": 1511, + "start": 1635, + "end": 1667, "ctxt": 0 }, "operator": "=", "left": { "type": "ArrayPattern", "span": { - "start": 1479, - "end": 1500, + "start": 1635, + "end": 1656, "ctxt": 0 }, "elements": [ { "type": "Identifier", "span": { - "start": 1480, - "end": 1499, + "start": 1636, + "end": 1655, "ctxt": 0 }, "value": "target_string_undef", @@ -1845,8 +2116,8 @@ "right": { "type": "Identifier", "span": { - "start": 1503, - "end": 1511, + "start": 1659, + "end": 1667, "ctxt": 0 }, "value": "strArray", @@ -1857,23 +2128,23 @@ { "type": "ExpressionStatement", "span": { - "start": 1527, - "end": 1565, + "start": 1683, + "end": 1721, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { - "start": 1527, - "end": 1564, + "start": 1683, + "end": 1720, "ctxt": 0 }, "operator": "=", "left": { "type": "ArrayPattern", "span": { - "start": 1527, - "end": 1553, + "start": 1683, + "end": 1709, "ctxt": 0 }, "elements": [ @@ -1883,20 +2154,20 @@ { "type": "RestElement", "span": { - "start": 1535, - "end": 1552, + "start": 1691, + "end": 1708, "ctxt": 0 }, "rest": { - "start": 1532, - "end": 1535, + "start": 1688, + "end": 1691, "ctxt": 0 }, "argument": { "type": "Identifier", "span": { - "start": 1535, - "end": 1552, + "start": 1691, + "end": 1708, "ctxt": 0 }, "value": "target_string_arr", @@ -1912,8 +2183,8 @@ "right": { "type": "Identifier", "span": { - "start": 1556, - "end": 1564, + "start": 1712, + "end": 1720, "ctxt": 0 }, "value": "strArray", @@ -1924,16 +2195,16 @@ { "type": "BlockStatement", "span": { - "start": 1580, - "end": 1745, + "start": 1736, + "end": 1901, "ctxt": 0 }, "stmts": [ { "type": "VariableDeclaration", "span": { - "start": 1586, - "end": 1634, + "start": 1742, + "end": 1790, "ctxt": 0 }, "kind": "let", @@ -1942,15 +2213,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1590, - "end": 1599, + "start": 1746, + "end": 1755, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1590, - "end": 1591, + "start": 1746, + "end": 1747, "ctxt": 0 }, "value": "x", @@ -1958,15 +2229,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1591, - "end": 1599, + "start": 1747, + "end": 1755, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 1593, - "end": 1599, + "start": 1749, + "end": 1755, "ctxt": 0 }, "kind": "number" @@ -1979,15 +2250,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1601, - "end": 1610, + "start": 1757, + "end": 1766, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1601, - "end": 1602, + "start": 1757, + "end": 1758, "ctxt": 0 }, "value": "y", @@ -1995,15 +2266,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1602, - "end": 1610, + "start": 1758, + "end": 1766, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 1604, - "end": 1610, + "start": 1760, + "end": 1766, "ctxt": 0 }, "kind": "number" @@ -2016,15 +2287,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1612, - "end": 1633, + "start": 1768, + "end": 1789, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1612, - "end": 1613, + "start": 1768, + "end": 1769, "ctxt": 0 }, "value": "z", @@ -2032,23 +2303,23 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1613, - "end": 1633, + "start": 1769, + "end": 1789, "ctxt": 0 }, "typeAnnotation": { "type": "TsUnionType", "span": { - "start": 1615, - "end": 1633, + "start": 1771, + "end": 1789, "ctxt": 0 }, "types": [ { "type": "TsKeywordType", "span": { - "start": 1615, - "end": 1621, + "start": 1771, + "end": 1777, "ctxt": 0 }, "kind": "number" @@ -2056,8 +2327,8 @@ { "type": "TsKeywordType", "span": { - "start": 1624, - "end": 1633, + "start": 1780, + "end": 1789, "ctxt": 0 }, "kind": "undefined" @@ -2074,45 +2345,45 @@ { "type": "ExpressionStatement", "span": { - "start": 1639, - "end": 1667, + "start": 1795, + "end": 1823, "ctxt": 0 }, "expression": { "type": "ParenthesisExpression", "span": { - "start": 1639, - "end": 1666, + "start": 1795, + "end": 1822, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { - "start": 1640, - "end": 1665, + "start": 1796, + "end": 1821, "ctxt": 0 }, "operator": "=", "left": { "type": "ObjectPattern", "span": { - "start": 1640, - "end": 1651, + "start": 1796, + "end": 1807, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1642, - "end": 1643, + "start": 1798, + "end": 1799, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1642, - "end": 1643, + "start": 1798, + "end": 1799, "ctxt": 0 }, "value": "x", @@ -2123,15 +2394,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1645, - "end": 1646, + "start": 1801, + "end": 1802, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1645, - "end": 1646, + "start": 1801, + "end": 1802, "ctxt": 0 }, "value": "y", @@ -2142,15 +2413,15 @@ { "type": "AssignmentPatternProperty", "span": { - "start": 1648, - "end": 1649, + "start": 1804, + "end": 1805, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1648, - "end": 1649, + "start": 1804, + "end": 1805, "ctxt": 0 }, "value": "z", @@ -2165,8 +2436,8 @@ "right": { "type": "Identifier", "span": { - "start": 1654, - "end": 1665, + "start": 1810, + "end": 1821, "ctxt": 0 }, "value": "numMapPoint", @@ -2178,8 +2449,8 @@ { "type": "VariableDeclaration", "span": { - "start": 1686, - "end": 1700, + "start": 1842, + "end": 1856, "ctxt": 0 }, "kind": "let", @@ -2188,15 +2459,15 @@ { "type": "VariableDeclarator", "span": { - "start": 1690, - "end": 1699, + "start": 1846, + "end": 1855, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 1690, - "end": 1691, + "start": 1846, + "end": 1847, "ctxt": 0 }, "value": "q", @@ -2204,15 +2475,15 @@ "typeAnnotation": { "type": "TsTypeAnnotation", "span": { - "start": 1691, - "end": 1699, + "start": 1847, + "end": 1855, "ctxt": 0 }, "typeAnnotation": { "type": "TsKeywordType", "span": { - "start": 1693, - "end": 1699, + "start": 1849, + "end": 1855, "ctxt": 0 }, "kind": "number" @@ -2227,45 +2498,45 @@ { "type": "ExpressionStatement", "span": { - "start": 1705, - "end": 1727, + "start": 1861, + "end": 1883, "ctxt": 0 }, "expression": { "type": "ParenthesisExpression", "span": { - "start": 1705, - "end": 1726, + "start": 1861, + "end": 1882, "ctxt": 0 }, "expression": { "type": "AssignmentExpression", "span": { - "start": 1706, - "end": 1725, + "start": 1862, + "end": 1881, "ctxt": 0 }, "operator": "=", "left": { "type": "ObjectPattern", "span": { - "start": 1706, - "end": 1711, + "start": 1862, + "end": 1867, "ctxt": 0 }, "properties": [ { "type": "AssignmentPatternProperty", "span": { - "start": 1708, - "end": 1709, + "start": 1864, + "end": 1865, "ctxt": 0 }, "key": { "type": "Identifier", "span": { - "start": 1708, - "end": 1709, + "start": 1864, + "end": 1865, "ctxt": 0 }, "value": "q", @@ -2280,8 +2551,8 @@ "right": { "type": "Identifier", "span": { - "start": 1714, - "end": 1725, + "start": 1870, + "end": 1881, "ctxt": 0 }, "value": "numMapPoint", diff --git a/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.ts b/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.ts index a274900bcae..3538e94be37 100644 --- a/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.ts +++ b/crates/swc_ecma_parser/tests/tsc/noUncheckedIndexedAccessDestructuring.ts @@ -44,6 +44,18 @@ declare const numMapPoint: { x: number, y: number} & { [s: string]: number }; q.z.toFixed(); // Should error } +{ + const { x, ...q } = numMapPoint; + x. + toFixed(); // Should OK + + q. + y.toFixed(); // Should OK + + q. + z.toFixed(); // Should error +} + declare let target_string: string; declare let target_string_undef: string | undefined; diff --git a/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.json b/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.json new file mode 100644 index 00000000000..c60e3414652 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.json @@ -0,0 +1,368 @@ +{ + "type": "Module", + "span": { + "start": 133, + "end": 626, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 133, + "end": 158, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 147, + "end": 157, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 147, + "end": 152, + "ctxt": 0 + }, + "value": "React", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 152, + "end": 157, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 154, + "end": 157, + "ctxt": 0 + }, + "kind": "any" + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 159, + "end": 174, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 168, + "end": 173, + "ctxt": 0 + }, + "value": "React", + "optional": false + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 228, + "end": 272, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 252, + "end": 263, + "ctxt": 0 + }, + "value": "createStore", + "optional": false + }, + "declare": true, + "params": [], + "decorators": [], + "span": { + "start": 235, + "end": 272, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 265, + "end": 271, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 267, + "end": 271, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 328, + "end": 348, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 328, + "end": 347, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 328, + "end": 342, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 328, + "end": 334, + "ctxt": 0 + }, + "value": "module", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 335, + "end": 342, + "ctxt": 0 + }, + "value": "exports", + "optional": false + } + }, + "right": { + "type": "ObjectExpression", + "span": { + "start": 345, + "end": 347, + "ctxt": 0 + }, + "properties": [] + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 406, + "end": 450, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 430, + "end": 441, + "ctxt": 0 + }, + "value": "createStore", + "optional": false + }, + "declare": true, + "params": [], + "decorators": [], + "span": { + "start": 413, + "end": 450, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 443, + "end": 449, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 445, + "end": 449, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 506, + "end": 526, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 506, + "end": 525, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 506, + "end": 520, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 506, + "end": 512, + "ctxt": 0 + }, + "value": "module", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 513, + "end": 520, + "ctxt": 0 + }, + "value": "exports", + "optional": false + } + }, + "right": { + "type": "ObjectExpression", + "span": { + "start": 523, + "end": 525, + "ctxt": 0 + }, + "properties": [] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 563, + "end": 589, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 570, + "end": 575, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 570, + "end": 575, + "ctxt": 0 + }, + "value": "React", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 581, + "end": 588, + "ctxt": 0 + }, + "value": "react", + "raw": "\"react\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 590, + "end": 626, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 599, + "end": 610, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 599, + "end": 610, + "ctxt": 0 + }, + "value": "createStore", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 618, + "end": 625, + "ctxt": 0 + }, + "value": "redux", + "raw": "\"redux\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.ts b/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.ts new file mode 100644 index 00000000000..22aa5194809 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/nodeModulesAtTypesPriority.ts @@ -0,0 +1,24 @@ +// @module: node16 +// @strict: true +// @noEmit: true +// @traceResolution: true + +// @Filename: /node_modules/@types/react/index.d.ts +declare const React: any; +export = React; + +// @Filename: /node_modules/@types/redux/index.d.ts +export declare function createStore(): void; + +// @Filename: /packages/a/node_modules/react/index.js +module.exports = {}; + +// @Filename: /packages/a/node_modules/redux/index.d.ts +export declare function createStore(): void; + +// @Filename: /packages/a/node_modules/redux/index.js +module.exports = {}; + +// @Filename: /packages/a/index.ts +import React from "react"; +import { createStore } from "redux"; diff --git a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.json b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.json new file mode 100644 index 00000000000..da502473559 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.json @@ -0,0 +1,365 @@ +{ + "type": "Module", + "span": { + "start": 63, + "end": 259, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 63, + "end": 114, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 70, + "end": 114, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 80, + "end": 88, + "ctxt": 0 + }, + "value": "BarProps", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 89, + "end": 114, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 95, + "end": 112, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 95, + "end": 102, + "ctxt": 0 + }, + "value": "barProp", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 103, + "end": 111, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 105, + "end": 111, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 116, + "end": 179, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 123, + "end": 179, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 133, + "end": 141, + "ctxt": 0 + }, + "value": "FooProps", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 142, + "end": 179, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 148, + "end": 177, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 148, + "end": 156, + "ctxt": 0 + }, + "value": "fooProps", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 157, + "end": 176, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 159, + "end": 176, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 159, + "end": 167, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 159, + "end": 167, + "ctxt": 0 + }, + "value": "BarProps", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 170, + "end": 176, + "ctxt": 0 + }, + "kind": "object" + } + ] + } + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 181, + "end": 209, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 195, + "end": 208, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 195, + "end": 198, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 198, + "end": 208, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 200, + "end": 208, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 200, + "end": 208, + "ctxt": 0 + }, + "value": "FooProps", + "optional": false + }, + "typeParams": null + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 210, + "end": 240, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 216, + "end": 239, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 216, + "end": 233, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 218, + "end": 231, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 218, + "end": 226, + "ctxt": 0 + }, + "value": "fooProps", + "optional": false + }, + "value": { + "type": "ObjectExpression", + "span": { + "start": 229, + "end": 231, + "ctxt": 0 + }, + "properties": [] + } + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 236, + "end": 239, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 242, + "end": 259, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 242, + "end": 258, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 242, + "end": 250, + "ctxt": 0 + }, + "value": "fooProps", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 251, + "end": 258, + "ctxt": 0 + }, + "value": "barProp", + "optional": false + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.ts b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.ts new file mode 100644 index 00000000000..b529e929e28 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAndEmptyObject.ts @@ -0,0 +1,17 @@ +// @strict: true +// @declaration: true + +// Repro from #49480 + +export interface BarProps { + barProp?: string; +} + +export interface FooProps { + fooProps?: BarProps & object; +} + +declare const foo: FooProps; +const { fooProps = {} } = foo; + +fooProps.barProp; diff --git a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.json b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.json deleted file mode 100644 index be09257ee3f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.json +++ /dev/null @@ -1,1947 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 29, - "end": 1106, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 29, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 33, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 34, - "end": 42, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 36, - "end": 42, - "ctxt": 0 - }, - "kind": "object" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 43, - "end": 71, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 55, - "end": 71, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 56, - "end": 71, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 58, - "end": 71, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 58, - "end": 64, - "ctxt": 0 - }, - "kind": "object" - }, - { - "type": "TsKeywordType", - "span": { - "start": 67, - "end": 71, - "ctxt": 0 - }, - "kind": "null" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 72, - "end": 105, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 84, - "end": 105, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 84, - "end": 85, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 85, - "end": 105, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 87, - "end": 105, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 87, - "end": 93, - "ctxt": 0 - }, - "kind": "object" - }, - { - "type": "TsKeywordType", - "span": { - "start": 96, - "end": 105, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 106, - "end": 146, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 118, - "end": 146, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 118, - "end": 119, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 121, - "end": 146, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 121, - "end": 127, - "ctxt": 0 - }, - "kind": "object" - }, - { - "type": "TsKeywordType", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "kind": "null" - }, - { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 146, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 147, - "end": 167, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 151, - "end": 167, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 151, - "end": 152, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 167, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 154, - "end": 167, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 154, - "end": 160, - "ctxt": 0 - }, - "kind": "object" - }, - { - "type": "TsKeywordType", - "span": { - "start": 163, - "end": 167, - "ctxt": 0 - }, - "kind": "null" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 168, - "end": 179, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 168, - "end": 178, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 189, - "end": 203, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 189, - "end": 202, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 189, - "end": 190, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 193, - "end": 202, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 232, - "end": 237, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 236, - "end": 237, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 248, - "end": 253, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 248, - "end": 249, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 252, - "end": 253, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 264, - "end": 270, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 264, - "end": 269, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 264, - "end": 265, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 268, - "end": 269, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 281, - "end": 287, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 281, - "end": 286, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 294, - "end": 300, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 294, - "end": 299, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - } - }, - { - "type": "IfStatement", - "span": { - "start": 308, - "end": 372, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 312, - "end": 333, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "UnaryExpression", - "span": { - "start": 312, - "end": 320, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Identifier", - "span": { - "start": 319, - "end": 320, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 325, - "end": 333, - "ctxt": 0 - }, - "value": "object", - "raw": "'object'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 335, - "end": 372, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 341, - "end": 354, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 341, - "end": 353, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 341, - "end": 351, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 343, - "end": 351, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 374, - "end": 443, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 378, - "end": 399, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "UnaryExpression", - "span": { - "start": 378, - "end": 386, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Identifier", - "span": { - "start": 385, - "end": 386, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 391, - "end": 399, - "ctxt": 0 - }, - "value": "object", - "raw": "'object'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 401, - "end": 443, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 407, - "end": 413, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 407, - "end": 412, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 407, - "end": 408, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 411, - "end": 412, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 445, - "end": 581, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 449, - "end": 470, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "UnaryExpression", - "span": { - "start": 449, - "end": 457, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Identifier", - "span": { - "start": 456, - "end": 457, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 462, - "end": 470, - "ctxt": 0 - }, - "value": "object", - "raw": "'object'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 472, - "end": 534, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 478, - "end": 484, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 478, - "end": 483, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 495, - "end": 508, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 495, - "end": 507, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 495, - "end": 505, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 495, - "end": 496, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 497, - "end": 505, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 540, - "end": 581, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 546, - "end": 559, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 546, - "end": 558, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 546, - "end": 556, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 546, - "end": 547, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 548, - "end": 556, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 583, - "end": 683, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 587, - "end": 596, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 587, - "end": 588, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 592, - "end": 596, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 598, - "end": 646, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 604, - "end": 617, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 604, - "end": 616, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 604, - "end": 614, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 606, - "end": 614, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 652, - "end": 683, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 658, - "end": 671, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 658, - "end": 670, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 658, - "end": 668, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 658, - "end": 659, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 660, - "end": 668, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 685, - "end": 793, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 689, - "end": 699, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 689, - "end": 690, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 695, - "end": 699, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 701, - "end": 737, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 707, - "end": 720, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 707, - "end": 719, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 707, - "end": 717, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 707, - "end": 708, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 709, - "end": 717, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 743, - "end": 793, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 749, - "end": 762, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 749, - "end": 761, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 749, - "end": 759, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 749, - "end": 750, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 751, - "end": 759, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 795, - "end": 917, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 799, - "end": 823, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "UnaryExpression", - "span": { - "start": 799, - "end": 807, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Identifier", - "span": { - "start": 806, - "end": 807, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 812, - "end": 823, - "ctxt": 0 - }, - "value": "undefined", - "raw": "'undefined'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 825, - "end": 866, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 831, - "end": 844, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 831, - "end": 843, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 831, - "end": 841, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 831, - "end": 832, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 833, - "end": 841, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 872, - "end": 917, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 878, - "end": 891, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 878, - "end": 890, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 878, - "end": 888, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 878, - "end": 879, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 880, - "end": 888, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 919, - "end": 955, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 929, - "end": 934, - "ctxt": 0 - }, - "value": "Proxy", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 934, - "end": 952, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 935, - "end": 951, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 935, - "end": 936, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 945, - "end": 951, - "ctxt": 0 - }, - "kind": "object" - }, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 953, - "end": 955, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 957, - "end": 978, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 961, - "end": 977, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 961, - "end": 962, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 962, - "end": 977, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 964, - "end": 977, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 964, - "end": 969, - "ctxt": 0 - }, - "value": "Proxy", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 969, - "end": 977, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 970, - "end": 976, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 988, - "end": 1007, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 992, - "end": 1006, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 992, - "end": 993, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 993, - "end": 1006, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 995, - "end": 1006, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 995, - "end": 1000, - "ctxt": 0 - }, - "value": "Proxy", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1000, - "end": 1006, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 1001, - "end": 1005, - "ctxt": 0 - }, - "kind": "null" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1017, - "end": 1041, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1021, - "end": 1040, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1021, - "end": 1022, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1022, - "end": 1040, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1024, - "end": 1040, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1024, - "end": 1029, - "ctxt": 0 - }, - "value": "Proxy", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1029, - "end": 1040, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 1030, - "end": 1039, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1052, - "end": 1085, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1062, - "end": 1066, - "ctxt": 0 - }, - "value": "Blah", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1067, - "end": 1085, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1071, - "end": 1083, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1074, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1074, - "end": 1082, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1076, - "end": 1082, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1087, - "end": 1106, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1091, - "end": 1105, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1092, - "ctxt": 0 - }, - "value": "u", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1092, - "end": 1105, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1094, - "end": 1105, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1094, - "end": 1099, - "ctxt": 0 - }, - "value": "Proxy", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1099, - "end": 1105, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1100, - "end": 1104, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1104, - "ctxt": 0 - }, - "value": "Blah", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.ts b/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.ts deleted file mode 100644 index 3c2b9646c7e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/nonPrimitiveStrictNull.ts +++ /dev/null @@ -1,61 +0,0 @@ -// @strictNullChecks: true - -var a: object -declare var b: object | null -declare var c: object | undefined -declare var d: object | null | undefined -var e: object | null -a.toString; // error -a = undefined; // error -a = null; // error -a = b; // error -a = c; // error -a = d; // error - -e = a; // ok -a = e; // ok - -if (typeof b !== 'object') { - b.toString(); // error, never -} - -if (typeof b === 'object') { - a = b; // error, b is not narrowed -} - -if (typeof d === 'object') { - b = d; // ok - d.toString(); // error, object | null -} else { - d.toString(); // error, undefined -} - -if (d == null) { - d.toString(); // error, undefined | null -} else { - d.toString(); // object -} - -if (d === null) { - d.toString(); // error, null -} else { - d.toString(); // error, object | undefined -} - -if (typeof d === 'undefined') { - d.toString(); // error, undefined -} else { - d.toString(); // error, object | null -} - -interface Proxy {} - -var x: Proxy; // error -var y: Proxy; // error -var z: Proxy; // error - -interface Blah { - foo: number; -} - -var u: Proxy; // ok diff --git a/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.json b/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.json new file mode 100644 index 00000000000..f50c88cbcf8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.json @@ -0,0 +1,2753 @@ +{ + "type": "Script", + "span": { + "start": 41, + "end": 1211, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 41, + "end": 72, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 46, + "end": 48, + "ctxt": 0 + }, + "value": "T0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 51, + "end": 71, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 51, + "end": 57, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 60, + "end": 71, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 60, + "end": 71, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 63, + "end": 69, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 61, + "end": 61, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 70, + "end": 70, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 84, + "end": 115, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 89, + "end": 91, + "ctxt": 0 + }, + "value": "T1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 94, + "end": 114, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 94, + "end": 100, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 103, + "end": 114, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 103, + "end": 114, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 106, + "end": 112, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 104, + "end": 104, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 113, + "end": 113, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 131, + "end": 162, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 136, + "end": 138, + "ctxt": 0 + }, + "value": "T2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 141, + "end": 161, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 141, + "end": 147, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 150, + "end": 161, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 150, + "end": 161, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 153, + "end": 159, + "ctxt": 0 + }, + "kind": "bigint" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 151, + "end": 151, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 160, + "end": 160, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 178, + "end": 222, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 183, + "end": 185, + "ctxt": 0 + }, + "value": "T3", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 185, + "end": 203, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 186, + "end": 202, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 186, + "end": 187, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 196, + "end": 202, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 206, + "end": 221, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 206, + "end": 212, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 215, + "end": 221, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 215, + "end": 221, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 218, + "end": 219, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 218, + "end": 219, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 216, + "end": 216, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 220, + "end": 220, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 233, + "end": 294, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 238, + "end": 240, + "ctxt": 0 + }, + "value": "T4", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 240, + "end": 258, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 241, + "end": 257, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 241, + "end": 242, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 251, + "end": 257, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 261, + "end": 293, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 261, + "end": 267, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 270, + "end": 293, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 270, + "end": 293, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 273, + "end": 291, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 273, + "end": 283, + "ctxt": 0 + }, + "value": "Capitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 283, + "end": 291, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 284, + "end": 290, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 284, + "end": 290, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 287, + "end": 288, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 287, + "end": 288, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 285, + "end": 285, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 289, + "end": 289, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 271, + "end": 271, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 292, + "end": 292, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 328, + "end": 330, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 331, + "end": 343, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 331, + "end": 343, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 332, + "end": 343, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 334, + "end": 343, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 334, + "end": 341, + "ctxt": 0 + }, + "kind": "boolean" + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 345, + "end": 359, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 345, + "end": 359, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 346, + "end": 359, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 348, + "end": 359, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 348, + "end": 359, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 351, + "end": 357, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 349, + "end": 349, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 358, + "end": 358, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 319, + "end": 394, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 361, + "end": 394, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 367, + "end": 380, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 371, + "end": 379, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 371, + "end": 372, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 375, + "end": 379, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 375, + "end": 376, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 376, + "end": 379, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 377, + "end": 378, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 405, + "end": 407, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 408, + "end": 420, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 408, + "end": 420, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 409, + "end": 420, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 411, + "end": 420, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 411, + "end": 418, + "ctxt": 0 + }, + "kind": "boolean" + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 422, + "end": 445, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 422, + "end": 445, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 423, + "end": 445, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 425, + "end": 445, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 425, + "end": 431, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsLiteralType", + "span": { + "start": 434, + "end": 445, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 434, + "end": 445, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 437, + "end": 443, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 435, + "end": 435, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 444, + "end": 444, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 396, + "end": 480, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 447, + "end": 480, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 453, + "end": 466, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 457, + "end": 465, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 457, + "end": 458, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 461, + "end": 465, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 461, + "end": 462, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 462, + "end": 465, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 463, + "end": 464, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 482, + "end": 516, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 487, + "end": 490, + "ctxt": 0 + }, + "value": "T10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIndexedAccessType", + "span": { + "start": 493, + "end": 515, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsArrayType", + "span": { + "start": 493, + "end": 502, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 493, + "end": 500, + "ctxt": 0 + }, + "kind": "boolean" + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 503, + "end": 514, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 503, + "end": 514, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 506, + "end": 512, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 504, + "end": 504, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 513, + "end": 513, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 529, + "end": 572, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 534, + "end": 537, + "ctxt": 0 + }, + "value": "T11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIndexedAccessType", + "span": { + "start": 540, + "end": 571, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsArrayType", + "span": { + "start": 540, + "end": 549, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 540, + "end": 547, + "ctxt": 0 + }, + "kind": "boolean" + } + }, + "indexType": { + "type": "TsUnionType", + "span": { + "start": 550, + "end": 570, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 550, + "end": 556, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsLiteralType", + "span": { + "start": 559, + "end": 570, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 559, + "end": 570, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 562, + "end": 568, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 560, + "end": 560, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 569, + "end": 569, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 586, + "end": 631, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 591, + "end": 594, + "ctxt": 0 + }, + "value": "T20", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 594, + "end": 626, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 595, + "end": 625, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 595, + "end": 596, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 605, + "end": 625, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 605, + "end": 611, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsLiteralType", + "span": { + "start": 614, + "end": 625, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 614, + "end": 625, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 617, + "end": 623, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 615, + "end": 615, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 624, + "end": 624, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 629, + "end": 630, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 629, + "end": 630, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 632, + "end": 691, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 637, + "end": 640, + "ctxt": 0 + }, + "value": "T21", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 640, + "end": 661, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 641, + "end": 660, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 641, + "end": 642, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsArrayType", + "span": { + "start": 651, + "end": 660, + "ctxt": 0 + }, + "elemType": { + "type": "TsKeywordType", + "span": { + "start": 651, + "end": 658, + "ctxt": 0 + }, + "kind": "unknown" + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 664, + "end": 690, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 667, + "end": 679, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 667, + "end": 668, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 672, + "end": 679, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 678, + "end": 679, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 678, + "end": 679, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 682, + "end": 688, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 682, + "end": 685, + "ctxt": 0 + }, + "value": "T20", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 685, + "end": 688, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 686, + "end": 687, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 686, + "end": 687, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 693, + "end": 729, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 698, + "end": 707, + "ctxt": 0 + }, + "value": "Container", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 707, + "end": 710, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 708, + "end": 709, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 708, + "end": 709, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 713, + "end": 729, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 719, + "end": 727, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 719, + "end": 724, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 724, + "end": 727, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 726, + "end": 727, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 726, + "end": 727, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 731, + "end": 821, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 736, + "end": 752, + "ctxt": 0 + }, + "value": "UnwrapContainers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 752, + "end": 784, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 753, + "end": 783, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 753, + "end": 754, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsArrayType", + "span": { + "start": 763, + "end": 783, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 763, + "end": 781, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 763, + "end": 772, + "ctxt": 0 + }, + "value": "Container", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 772, + "end": 781, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 773, + "end": 780, + "ctxt": 0 + }, + "kind": "unknown" + } + ] + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 787, + "end": 820, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 790, + "end": 802, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 790, + "end": 791, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 795, + "end": 802, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 801, + "end": 802, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 801, + "end": 802, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsIndexedAccessType", + "span": { + "start": 805, + "end": 818, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsIndexedAccessType", + "span": { + "start": 805, + "end": 809, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 805, + "end": 806, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 805, + "end": 806, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 807, + "end": 808, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 807, + "end": 808, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 810, + "end": 817, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 810, + "end": 817, + "ctxt": 0 + }, + "value": "value", + "raw": "'value'" + } + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 840, + "end": 855, + "ctxt": 0 + }, + "value": "createContainer", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 875, + "end": 883, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 875, + "end": 883, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 880, + "end": 883, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 882, + "end": 883, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 882, + "end": 883, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 823, + "end": 899, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 855, + "end": 874, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 856, + "end": 873, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 856, + "end": 857, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 866, + "end": 873, + "ctxt": 0 + }, + "kind": "unknown" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 884, + "end": 898, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 886, + "end": 898, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 886, + "end": 895, + "ctxt": 0 + }, + "value": "Container", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 895, + "end": 898, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 896, + "end": 897, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 896, + "end": 897, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 918, + "end": 919, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 952, + "end": 970, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 952, + "end": 970, + "ctxt": 0 + }, + "value": "containers", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 962, + "end": 970, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTupleType", + "span": { + "start": 964, + "end": 970, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 965, + "end": 969, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsRestType", + "span": { + "start": 965, + "end": 969, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 968, + "end": 969, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 968, + "end": 969, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 972, + "end": 1022, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 972, + "end": 1022, + "ctxt": 0 + }, + "value": "callback", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 980, + "end": 1022, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 982, + "end": 1022, + "ctxt": 0 + }, + "params": [ + { + "type": "RestElement", + "span": { + "start": 983, + "end": 1013, + "ctxt": 0 + }, + "rest": { + "start": 983, + "end": 986, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 986, + "end": 992, + "ctxt": 0 + }, + "value": "values", + "optional": false, + "typeAnnotation": null + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 992, + "end": 1013, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 994, + "end": 1013, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 994, + "end": 1010, + "ctxt": 0 + }, + "value": "UnwrapContainers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1010, + "end": 1013, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1011, + "end": 1012, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1011, + "end": 1012, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1015, + "end": 1022, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1018, + "end": 1022, + "ctxt": 0 + }, + "kind": "void" + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 901, + "end": 1030, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 919, + "end": 951, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 920, + "end": 950, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 920, + "end": 921, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsArrayType", + "span": { + "start": 930, + "end": 950, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 930, + "end": 948, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 930, + "end": 939, + "ctxt": 0 + }, + "value": "Container", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 939, + "end": 948, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 940, + "end": 947, + "ctxt": 0 + }, + "kind": "unknown" + } + ] + } + } + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 1023, + "end": 1029, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1025, + "end": 1029, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1032, + "end": 1072, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1038, + "end": 1072, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1038, + "end": 1048, + "ctxt": 0 + }, + "value": "container1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 1051, + "end": 1072, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1051, + "end": 1066, + "ctxt": 0 + }, + "value": "createContainer", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 1067, + "end": 1071, + "ctxt": 0 + }, + "value": "hi", + "raw": "'hi'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1073, + "end": 1110, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1079, + "end": 1110, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1079, + "end": 1089, + "ctxt": 0 + }, + "value": "container2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 1092, + "end": 1110, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1092, + "end": 1107, + "ctxt": 0 + }, + "value": "createContainer", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 1108, + "end": 1109, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1112, + "end": 1211, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 1112, + "end": 1210, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 1112, + "end": 1113, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "ArrayExpression", + "span": { + "start": 1114, + "end": 1138, + "ctxt": 0 + }, + "elements": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1115, + "end": 1125, + "ctxt": 0 + }, + "value": "container1", + "optional": false + } + }, + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 1127, + "end": 1137, + "ctxt": 0 + }, + "value": "container2", + "optional": false + } + } + ] + } + }, + { + "spread": null, + "expression": { + "type": "ArrowFunctionExpression", + "span": { + "start": 1140, + "end": 1209, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 1141, + "end": 1147, + "ctxt": 0 + }, + "value": "value1", + "optional": false, + "typeAnnotation": null + }, + { + "type": "Identifier", + "span": { + "start": 1149, + "end": 1155, + "ctxt": 0 + }, + "value": "value2", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 1160, + "end": 1209, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1166, + "end": 1173, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1166, + "end": 1172, + "ctxt": 0 + }, + "value": "value1", + "optional": false + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1189, + "end": 1196, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1189, + "end": 1195, + "ctxt": 0 + }, + "value": "value2", + "optional": false + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + ], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.ts b/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.ts new file mode 100644 index 00000000000..80c3a265f71 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/numericStringLiteralTypes.ts @@ -0,0 +1,40 @@ +// @strict: true +// @declaration: true + +type T0 = string & `${string}`; // string +type T1 = string & `${number}`; // `${number} +type T2 = string & `${bigint}`; // `${bigint} +type T3 = string & `${T}`; // `${T} +type T4 = string & `${Capitalize<`${T}`>}`; // `${Capitalize}` + +function f1(a: boolean[], x: `${number}`) { + let s = a[x]; // boolean +} + +function f2(a: boolean[], x: number | `${number}`) { + let s = a[x]; // boolean +} + +type T10 = boolean[][`${number}`]; // boolean +type T11 = boolean[][number | `${number}`]; // boolean + +type T20 = T; +type T21 = { [K in keyof T]: T20 }; + +type Container = { + value: T +} + +type UnwrapContainers[]> = { [K in keyof T]: T[K]['value'] }; + +declare function createContainer(value: T): Container; + +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; + +const container1 = createContainer('hi') +const container2 = createContainer(2) + +f([container1, container2], (value1, value2) => { + value1; // string + value2; // number +}); diff --git a/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.json b/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.json deleted file mode 100644 index 8b2b7d2a355..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.json +++ /dev/null @@ -1,547 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 164, - "end": 415, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 164, - "end": 247, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 178, - "end": 190, - "ctxt": 0 - }, - "key": { - "type": "StringLiteral", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 181, - "end": 189, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 183, - "end": 189, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 195, - "end": 209, - "ctxt": 0 - }, - "key": { - "type": "StringLiteral", - "span": { - "start": 195, - "end": 200, - "ctxt": 0 - }, - "value": "1.0", - "raw": "\"1.0\"" - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 202, - "end": 208, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 233, - "end": 245, - "ctxt": 0 - }, - "key": { - "type": "NumericLiteral", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 236, - "end": 244, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 238, - "end": 244, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 249, - "end": 333, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 259, - "end": 260, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 261, - "end": 333, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 267, - "end": 279, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 270, - "end": 278, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 272, - "end": 278, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 284, - "end": 297, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 284, - "end": 288, - "ctxt": 0 - }, - "value": "1.", - "raw": "\"1.\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 288, - "end": 296, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 290, - "end": 296, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 321, - "end": 331, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 335, - "end": 379, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 339, - "end": 379, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 339, - "end": 340, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 340, - "end": 379, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 342, - "end": 379, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 348, - "end": 360, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 348, - "end": 351, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 351, - "end": 359, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 353, - "end": 359, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 365, - "end": 377, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 368, - "end": 376, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 370, - "end": 376, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 381, - "end": 415, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 385, - "end": 415, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 385, - "end": 386, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 389, - "end": 415, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 395, - "end": 398, - "ctxt": 0 - }, - "value": "0", - "raw": "\"0\"" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 400, - "end": 402, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 408, - "end": 409, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 411, - "end": 413, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.ts b/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.ts deleted file mode 100644 index 6cc7951c8bd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/numericStringNamedPropertyEquivalence.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Each of these types has an error in it. -// String named and numeric named properties conflict if they would be equivalent after ToNumber on the property name. -class C { - "1": number; - "1.0": number; // not a duplicate - 1.0: number; -} - -interface I { - "1": number; - "1.": number; // not a duplicate - 1: number; -} - -var a: { - "1": number; - 1.0: string; -} - -var b = { - "0": '', - 0: '' -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.json b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.json deleted file mode 100644 index 6489a480917..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 2, - "end": 30, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2, - "end": 30, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 6, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "ObjectPattern", - "span": { - "start": 6, - "end": 15, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "value": "while", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 18, - "end": 30, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 20, - "end": 25, - "ctxt": 0 - }, - "value": "while", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.ts b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.ts deleted file mode 100644 index 1e87866b3ff..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers01.ts +++ /dev/null @@ -1,2 +0,0 @@ - -var { while } = { while: 1 } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers05.ts b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers05.ts index 6dbab4e8919..00992e955fa 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers05.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers05.ts @@ -1,2 +1,2 @@ - + var { as } = { as: 1 } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers06.ts b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers06.ts index db25ddf63d8..e7586f46795 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers06.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectBindingPatternKeywordIdentifiers06.ts @@ -1,2 +1,2 @@ - + var { as: as } = { as: 1 } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignment.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignment.ts index 48c21a5c038..e28512ea317 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignment.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignment.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentES6.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentES6.ts index ee1fbeabab9..fe6272dcf16 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentES6.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 // @target: es6 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentError.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentError.ts index 2e7f7ceb9b9..47a8ab620b1 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentError.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentError.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts index bc695d44140..702e40ec336 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.json b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.json deleted file mode 100644 index 3ff102a02c8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 56, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 56, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 9, - "end": 56, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 28, - "end": 45, - "ctxt": 0 - }, - "value": "undefinedVariable", - "optional": false - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts deleted file mode 100644 index 0d3a12af0d1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts +++ /dev/null @@ -1,4 +0,0 @@ -var x = { - x, // OK - undefinedVariable // Error -} diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument.ts index 0529bc02350..1a459e95650 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument2.ts b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument2.ts index 3dbf6634658..5e7480894c7 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument2.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectLiteralShorthandPropertiesFunctionArgument2.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es5 var id: number = 10000; var name: string = "my name"; diff --git a/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.json b/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.json deleted file mode 100644 index 927b5079aee..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.json +++ /dev/null @@ -1,4520 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 44, - "end": 2631, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 44, - "end": 69, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 52, - "end": 69, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 54, - "end": 55, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 57, - "end": 58, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 60, - "end": 61, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 63, - "end": 67, - "ctxt": 0 - }, - "value": "no", - "raw": "'no'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 100, - "end": 116, - "ctxt": 0 - }, - "value": "PrivateOptionalX", - "optional": false - }, - "declare": false, - "span": { - "start": 94, - "end": 144, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 123, - "end": 142, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 131, - "end": 132, - "ctxt": 0 - }, - "value": "x", - "optional": true - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 133, - "end": 141, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 135, - "end": 141, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": true, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 151, - "end": 158, - "ctxt": 0 - }, - "value": "PublicX", - "optional": false - }, - "declare": false, - "span": { - "start": 145, - "end": 184, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 165, - "end": 182, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 173, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 175, - "end": 181, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 185, - "end": 214, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 197, - "end": 213, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 197, - "end": 204, - "ctxt": 0 - }, - "value": "publicX", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 213, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 206, - "end": 213, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 206, - "end": 213, - "ctxt": 0 - }, - "value": "PublicX", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 215, - "end": 262, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 227, - "end": 261, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 227, - "end": 243, - "ctxt": 0 - }, - "value": "privateOptionalX", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 243, - "end": 261, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 245, - "end": 261, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 245, - "end": 261, - "ctxt": 0 - }, - "value": "PrivateOptionalX", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 263, - "end": 308, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 267, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "value": "o2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 272, - "end": 307, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 274, - "end": 277, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 277, - "end": 284, - "ctxt": 0 - }, - "value": "publicX", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 289, - "end": 305, - "ctxt": 0 - }, - "value": "privateOptionalX", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 331, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 313, - "end": 330, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 313, - "end": 315, - "ctxt": 0 - }, - "value": "sn", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 315, - "end": 323, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 317, - "end": 323, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 326, - "end": 330, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 326, - "end": 328, - "ctxt": 0 - }, - "value": "o2", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 355, - "end": 399, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 367, - "end": 398, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 367, - "end": 381, - "ctxt": 0 - }, - "value": "optionalString", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 381, - "end": 398, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 383, - "end": 398, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 385, - "end": 396, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 385, - "end": 387, - "ctxt": 0 - }, - "value": "sn", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 396, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 390, - "end": 396, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 400, - "end": 444, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 412, - "end": 443, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 412, - "end": 426, - "ctxt": 0 - }, - "value": "optionalNumber", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 426, - "end": 443, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 428, - "end": 443, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 430, - "end": 441, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 430, - "end": 432, - "ctxt": 0 - }, - "value": "sn", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 433, - "end": 441, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 435, - "end": 441, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 445, - "end": 529, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 449, - "end": 528, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 449, - "end": 460, - "ctxt": 0 - }, - "value": "allOptional", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 460, - "end": 485, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 462, - "end": 485, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 464, - "end": 483, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 464, - "end": 466, - "ctxt": 0 - }, - "value": "sn", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 466, - "end": 483, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 468, - "end": 483, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 468, - "end": 474, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 477, - "end": 483, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 488, - "end": 528, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 490, - "end": 493, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 493, - "end": 507, - "ctxt": 0 - }, - "value": "optionalString", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 509, - "end": 512, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 512, - "end": 526, - "ctxt": 0 - }, - "value": "optionalNumber", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 615, - "end": 644, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 625, - "end": 629, - "ctxt": 0 - }, - "value": "Bool", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 630, - "end": 644, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 632, - "end": 642, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 632, - "end": 633, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 633, - "end": 642, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 635, - "end": 642, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "EmptyStatement", - "span": { - "start": 644, - "end": 645, - "ctxt": 0 - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 646, - "end": 673, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 656, - "end": 659, - "ctxt": 0 - }, - "value": "Str", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 660, - "end": 673, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 662, - "end": 671, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 662, - "end": 663, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 663, - "end": 671, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "EmptyStatement", - "span": { - "start": 673, - "end": 674, - "ctxt": 0 - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 675, - "end": 723, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 679, - "end": 722, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 679, - "end": 685, - "ctxt": 0 - }, - "value": "spread", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 688, - "end": 722, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 690, - "end": 693, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 693, - "end": 704, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 695, - "end": 696, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 698, - "end": 702, - "ctxt": 0 - }, - "value": true - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 706, - "end": 709, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 709, - "end": 720, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 710, - "end": 711, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 713, - "end": 718, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 724, - "end": 746, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 724, - "end": 745, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 724, - "end": 730, - "ctxt": 0 - }, - "value": "spread", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 733, - "end": 745, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 735, - "end": 736, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 738, - "end": 743, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 770, - "end": 791, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 774, - "end": 790, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 774, - "end": 775, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 778, - "end": 790, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 780, - "end": 781, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 783, - "end": 788, - "ctxt": 0 - }, - "value": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 792, - "end": 803, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 792, - "end": 802, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 792, - "end": 798, - "ctxt": 0 - }, - "value": "spread", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 801, - "end": 802, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 891, - "end": 953, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 895, - "end": 953, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 895, - "end": 905, - "ctxt": 0 - }, - "value": "duplicated", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 908, - "end": 953, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 910, - "end": 911, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 913, - "end": 918, - "ctxt": 0 - }, - "value": "bad", - "raw": "'bad'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 920, - "end": 923, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 923, - "end": 924, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 926, - "end": 927, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 929, - "end": 934, - "ctxt": 0 - }, - "value": "bad", - "raw": "'bad'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 936, - "end": 939, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 939, - "end": 941, - "ctxt": 0 - }, - "value": "o2", - "optional": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 943, - "end": 944, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 946, - "end": 951, - "ctxt": 0 - }, - "value": "bad", - "raw": "'bad'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 954, - "end": 991, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 958, - "end": 991, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 958, - "end": 974, - "ctxt": 0 - }, - "value": "duplicatedSpread", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 977, - "end": 991, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 979, - "end": 982, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 982, - "end": 983, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 985, - "end": 988, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 988, - "end": 989, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1054, - "end": 1119, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1058, - "end": 1119, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1058, - "end": 1064, - "ctxt": 0 - }, - "value": "ignore", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1064, - "end": 1090, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1066, - "end": 1090, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1068, - "end": 1078, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1068, - "end": 1069, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1069, - "end": 1077, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1071, - "end": 1077, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1079, - "end": 1088, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1079, - "end": 1080, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1080, - "end": 1088, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1082, - "end": 1088, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1097, - "end": 1119, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1099, - "end": 1100, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1102, - "end": 1111, - "ctxt": 0 - }, - "value": "ignored", - "raw": "'ignored'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1113, - "end": 1116, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1117, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1121, - "end": 1147, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1125, - "end": 1147, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1125, - "end": 1127, - "ctxt": 0 - }, - "value": "o3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1130, - "end": 1147, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1132, - "end": 1133, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1135, - "end": 1136, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1138, - "end": 1139, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1141, - "end": 1145, - "ctxt": 0 - }, - "value": "no", - "raw": "'no'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1148, - "end": 1178, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1152, - "end": 1178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1152, - "end": 1154, - "ctxt": 0 - }, - "value": "o4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1157, - "end": 1178, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1159, - "end": 1160, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1162, - "end": 1167, - "ctxt": 0 - }, - "value": "yes", - "raw": "'yes'" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1169, - "end": 1170, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1172, - "end": 1176, - "ctxt": 0 - }, - "value": true - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1179, - "end": 1267, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1183, - "end": 1267, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1183, - "end": 1197, - "ctxt": 0 - }, - "value": "combinedBefore", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1197, - "end": 1235, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1199, - "end": 1235, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1201, - "end": 1211, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1201, - "end": 1202, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1202, - "end": 1210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1204, - "end": 1210, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1212, - "end": 1222, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1212, - "end": 1213, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1213, - "end": 1221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1215, - "end": 1221, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1223, - "end": 1233, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1223, - "end": 1224, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1224, - "end": 1233, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1226, - "end": 1233, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1242, - "end": 1267, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1244, - "end": 1245, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1247, - "end": 1251, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1253, - "end": 1256, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1256, - "end": 1258, - "ctxt": 0 - }, - "value": "o3", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1260, - "end": 1263, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1263, - "end": 1265, - "ctxt": 0 - }, - "value": "o4", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1268, - "end": 1353, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1272, - "end": 1353, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1272, - "end": 1283, - "ctxt": 0 - }, - "value": "combinedMid", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1283, - "end": 1321, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1285, - "end": 1321, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1287, - "end": 1297, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1287, - "end": 1288, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1288, - "end": 1296, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1290, - "end": 1296, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1298, - "end": 1308, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1298, - "end": 1299, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1299, - "end": 1307, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1301, - "end": 1307, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1309, - "end": 1319, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1309, - "end": 1310, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1310, - "end": 1319, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1312, - "end": 1319, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1328, - "end": 1353, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1330, - "end": 1333, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1333, - "end": 1335, - "ctxt": 0 - }, - "value": "o3", - "optional": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1337, - "end": 1338, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1340, - "end": 1344, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1346, - "end": 1349, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1349, - "end": 1351, - "ctxt": 0 - }, - "value": "o4", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1354, - "end": 1524, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1358, - "end": 1524, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1358, - "end": 1372, - "ctxt": 0 - }, - "value": "combinedNested", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1372, - "end": 1421, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1374, - "end": 1421, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1376, - "end": 1386, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1376, - "end": 1377, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1377, - "end": 1385, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1379, - "end": 1385, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1387, - "end": 1398, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1387, - "end": 1388, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1388, - "end": 1397, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1390, - "end": 1397, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1399, - "end": 1409, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1399, - "end": 1400, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1400, - "end": 1408, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1402, - "end": 1408, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1410, - "end": 1419, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1410, - "end": 1411, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1411, - "end": 1419, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1413, - "end": 1419, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1428, - "end": 1524, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1430, - "end": 1433, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1433, - "end": 1474, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1435, - "end": 1436, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1438, - "end": 1439, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1441, - "end": 1444, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1444, - "end": 1472, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1446, - "end": 1447, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 1449, - "end": 1454, - "ctxt": 0 - }, - "value": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1456, - "end": 1457, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1459, - "end": 1470, - "ctxt": 0 - }, - "value": "overriden", - "raw": "'overriden'" - } - } - ] - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1476, - "end": 1477, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1479, - "end": 1493, - "ctxt": 0 - }, - "value": "actually new", - "raw": "'actually new'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1495, - "end": 1498, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1498, - "end": 1522, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1500, - "end": 1501, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1503, - "end": 1504, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1506, - "end": 1507, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1509, - "end": 1520, - "ctxt": 0 - }, - "value": "maybe new", - "raw": "'maybe new'" - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1525, - "end": 1606, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1529, - "end": 1605, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1529, - "end": 1545, - "ctxt": 0 - }, - "value": "changeTypeBefore", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1545, - "end": 1571, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1547, - "end": 1571, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1549, - "end": 1559, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1549, - "end": 1550, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1550, - "end": 1558, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1552, - "end": 1558, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1560, - "end": 1569, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1560, - "end": 1561, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1561, - "end": 1569, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1563, - "end": 1569, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1578, - "end": 1605, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1580, - "end": 1581, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1583, - "end": 1596, - "ctxt": 0 - }, - "value": "wrong type?", - "raw": "'wrong type?'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1598, - "end": 1601, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1601, - "end": 1603, - "ctxt": 0 - }, - "value": "o3", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1607, - "end": 1747, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1611, - "end": 1747, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1611, - "end": 1625, - "ctxt": 0 - }, - "value": "computedMiddle", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1625, - "end": 1688, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1627, - "end": 1688, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1629, - "end": 1639, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1629, - "end": 1630, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1630, - "end": 1638, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1632, - "end": 1638, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1640, - "end": 1650, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1640, - "end": 1641, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1641, - "end": 1649, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1643, - "end": 1649, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1651, - "end": 1662, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1651, - "end": 1652, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1652, - "end": 1661, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1654, - "end": 1661, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1663, - "end": 1686, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 1663, - "end": 1678, - "ctxt": 0 - }, - "value": "in the middle", - "raw": "\"in the middle\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1678, - "end": 1686, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1680, - "end": 1686, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1695, - "end": 1747, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1697, - "end": 1700, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1700, - "end": 1702, - "ctxt": 0 - }, - "value": "o3", - "optional": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 1704, - "end": 1721, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1705, - "end": 1720, - "ctxt": 0 - }, - "value": "in the middle", - "raw": "'in the middle'" - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1723, - "end": 1725, - "ctxt": 0 - }, - "value": 13.0, - "raw": "13" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1727, - "end": 1728, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1730, - "end": 1738, - "ctxt": 0 - }, - "value": "maybe?", - "raw": "'maybe?'" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1740, - "end": 1743, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1743, - "end": 1745, - "ctxt": 0 - }, - "value": "o4", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1802, - "end": 1828, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1806, - "end": 1827, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1806, - "end": 1815, - "ctxt": 0 - }, - "value": "spreadNum", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1818, - "end": 1827, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1820, - "end": 1823, - "ctxt": 0 - }, - "arguments": { - "type": "NumericLiteral", - "span": { - "start": 1823, - "end": 1825, - "ctxt": 0 - }, - "value": 12.0, - "raw": "12" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1829, - "end": 1858, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1833, - "end": 1857, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1833, - "end": 1842, - "ctxt": 0 - }, - "value": "spreadSum", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1845, - "end": 1857, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1847, - "end": 1850, - "ctxt": 0 - }, - "arguments": { - "type": "BinaryExpression", - "span": { - "start": 1850, - "end": 1855, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NumericLiteral", - "span": { - "start": 1850, - "end": 1851, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 1854, - "end": 1855, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1859, - "end": 1885, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1863, - "end": 1884, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1863, - "end": 1873, - "ctxt": 0 - }, - "value": "spreadZero", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1876, - "end": 1884, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1878, - "end": 1881, - "ctxt": 0 - }, - "arguments": { - "type": "NumericLiteral", - "span": { - "start": 1881, - "end": 1882, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1886, - "end": 1907, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1886, - "end": 1906, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1886, - "end": 1904, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1886, - "end": 1896, - "ctxt": 0 - }, - "value": "spreadZero", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1897, - "end": 1904, - "ctxt": 0 - }, - "value": "toFixed", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1954, - "end": 1983, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1958, - "end": 1982, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1958, - "end": 1968, - "ctxt": 0 - }, - "value": "spreadBool", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 1971, - "end": 1982, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 1973, - "end": 1976, - "ctxt": 0 - }, - "arguments": { - "type": "BooleanLiteral", - "span": { - "start": 1976, - "end": 1980, - "ctxt": 0 - }, - "value": true - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1984, - "end": 2005, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1984, - "end": 2004, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1984, - "end": 2002, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1984, - "end": 1994, - "ctxt": 0 - }, - "value": "spreadBool", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1995, - "end": 2002, - "ctxt": 0 - }, - "value": "valueOf", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2006, - "end": 2035, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2010, - "end": 2034, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2010, - "end": 2019, - "ctxt": 0 - }, - "value": "spreadStr", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2022, - "end": 2034, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 2024, - "end": 2027, - "ctxt": 0 - }, - "arguments": { - "type": "StringLiteral", - "span": { - "start": 2027, - "end": 2032, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2036, - "end": 2053, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2036, - "end": 2052, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2036, - "end": 2045, - "ctxt": 0 - }, - "value": "spreadStr", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2046, - "end": 2052, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2076, - "end": 2096, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2076, - "end": 2095, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 2076, - "end": 2092, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2076, - "end": 2085, - "ctxt": 0 - }, - "value": "spreadStr", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2086, - "end": 2092, - "ctxt": 0 - }, - "value": "charAt", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2093, - "end": 2094, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2150, - "end": 2189, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2154, - "end": 2189, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2154, - "end": 2164, - "ctxt": 0 - }, - "value": "spreadFunc", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2167, - "end": 2189, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 2169, - "end": 2172, - "ctxt": 0 - }, - "arguments": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 2172, - "end": 2187, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2184, - "end": 2187, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2190, - "end": 2203, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2190, - "end": 2202, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2190, - "end": 2200, - "ctxt": 0 - }, - "value": "spreadFunc", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2270, - "end": 2322, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2274, - "end": 2321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2274, - "end": 2284, - "ctxt": 0 - }, - "value": "setterOnly", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2287, - "end": 2321, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 2289, - "end": 2292, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 2292, - "end": 2319, - "ctxt": 0 - }, - "properties": [ - { - "type": "SetterProperty", - "span": { - "start": 2294, - "end": 2317, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2298, - "end": 2299, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 2301, - "end": 2312, - "ctxt": 0 - }, - "value": "bad", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2304, - "end": 2312, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2306, - "end": 2312, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2314, - "end": 2317, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2323, - "end": 2341, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2323, - "end": 2340, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 2323, - "end": 2335, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2323, - "end": 2333, - "ctxt": 0 - }, - "value": "setterOnly", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2334, - "end": 2335, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 2338, - "end": 2340, - "ctxt": 0 - }, - "value": 12.0, - "raw": "12" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2432, - "end": 2433, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 2426, - "end": 2452, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2436, - "end": 2442, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2436, - "end": 2437, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 2440, - "end": 2441, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 2443, - "end": 2450, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2443, - "end": 2444, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2443, - "end": 2450, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2447, - "end": 2450, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2453, - "end": 2471, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2457, - "end": 2471, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2457, - "end": 2458, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2458, - "end": 2461, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2460, - "end": 2461, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2460, - "end": 2461, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "NewExpression", - "span": { - "start": 2464, - "end": 2471, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 2468, - "end": 2469, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2472, - "end": 2494, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2476, - "end": 2494, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2476, - "end": 2483, - "ctxt": 0 - }, - "value": "spreadC", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2486, - "end": 2494, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 2488, - "end": 2491, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 2491, - "end": 2492, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2495, - "end": 2507, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 2495, - "end": 2506, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 2495, - "end": 2504, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2495, - "end": 2502, - "ctxt": 0 - }, - "value": "spreadC", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2503, - "end": 2504, - "ctxt": 0 - }, - "value": "m", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2561, - "end": 2590, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2565, - "end": 2589, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2565, - "end": 2568, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2568, - "end": 2576, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2570, - "end": 2576, - "ctxt": 0 - }, - "kind": "object" - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2579, - "end": 2589, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2581, - "end": 2582, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 2584, - "end": 2587, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2591, - "end": 2618, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2595, - "end": 2617, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2595, - "end": 2604, - "ctxt": 0 - }, - "value": "spreadObj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 2607, - "end": 2617, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 2609, - "end": 2612, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 2612, - "end": 2615, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2619, - "end": 2631, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 2619, - "end": 2630, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2619, - "end": 2628, - "ctxt": 0 - }, - "value": "spreadObj", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2629, - "end": 2630, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.ts b/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.ts deleted file mode 100644 index 00dfd440667..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectSpreadNegative.ts +++ /dev/null @@ -1,76 +0,0 @@ -// @target: es5 -// @strictNullChecks: true -let o = { a: 1, b: 'no' } - -/// private propagates -class PrivateOptionalX { - private x?: number; -} -class PublicX { - public x: number; -} -declare let publicX: PublicX; -declare let privateOptionalX: PrivateOptionalX; -let o2 = { ...publicX, ...privateOptionalX }; -let sn: number = o2.x; // error, x is private -declare let optionalString: { sn?: string }; -declare let optionalNumber: { sn?: number }; -let allOptional: { sn: string | number } = { ...optionalString, ...optionalNumber }; -// error, 'sn' is optional in source, required in target - -// assignability as target -interface Bool { b: boolean }; -interface Str { s: string }; -let spread = { ...{ b: true }, ...{s: "foo" } }; -spread = { s: "foo" }; // error, missing 'b' -let b = { b: false }; -spread = b; // error, missing 's' - -// literal repeats are not allowed, but spread repeats are fine -let duplicated = { b: 'bad', ...o, b: 'bad', ...o2, b: 'bad' } -let duplicatedSpread = { ...o, ...o } -// Note: ignore changes the order that properties are printed -let ignore: { a: number, b: string } = - { b: 'ignored', ...o } - -let o3 = { a: 1, b: 'no' } -let o4 = { b: 'yes', c: true } -let combinedBefore: { a: number, b: string, c: boolean } = - { b: 'ok', ...o3, ...o4 } -let combinedMid: { a: number, b: string, c: boolean } = - { ...o3, b: 'ok', ...o4 } -let combinedNested: { a: number, b: boolean, c: string, d: string } = - { ...{ a: 4, ...{ b: false, c: 'overriden' } }, d: 'actually new', ...{ a: 5, d: 'maybe new' } } -let changeTypeBefore: { a: number, b: string } = - { a: 'wrong type?', ...o3 }; -let computedMiddle: { a: number, b: string, c: boolean, "in the middle": number } = - { ...o3, ['in the middle']: 13, b: 'maybe?', ...o4 } - -// primitives are not allowed, except for falsy ones -let spreadNum = { ...12 }; -let spreadSum = { ...1 + 1 }; -let spreadZero = { ...0 }; -spreadZero.toFixed(); // error, no methods even from a falsy number -let spreadBool = { ...true }; -spreadBool.valueOf(); -let spreadStr = { ...'foo' }; -spreadStr.length; // error, no 'length' -spreadStr.charAt(1); // error, no methods either -// functions are skipped -let spreadFunc = { ...function () { } } -spreadFunc(); // error, no call signature - -// write-only properties get skipped -let setterOnly = { ...{ set b (bad: number) { } } }; -setterOnly.b = 12; // error, 'b' does not exist - -// methods are skipped because they aren't enumerable -class C { p = 1; m() { } } -let c: C = new C() -let spreadC = { ...c } -spreadC.m(); // error 'm' is not in '{ ... c }' - -// non primitive -let obj: object = { a: 123 }; -let spreadObj = { ...obj }; -spreadObj.a; // error 'a' is not in {} diff --git a/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.json b/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.json deleted file mode 100644 index 5377460d9db..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.json +++ /dev/null @@ -1,569 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 99, - "end": 299, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 99, - "end": 144, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 113, - "end": 115, - "ctxt": 0 - }, - "key": { - "type": "NumericLiteral", - "span": { - "start": 113, - "end": 114, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 120, - "end": 124, - "ctxt": 0 - }, - "key": { - "type": "NumericLiteral", - "span": { - "start": 120, - "end": 123, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "key": { - "type": "NumericLiteral", - "span": { - "start": 129, - "end": 131, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1." - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 137, - "end": 142, - "ctxt": 0 - }, - "key": { - "type": "NumericLiteral", - "span": { - "start": 137, - "end": 141, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.00" - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 146, - "end": 195, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 158, - "end": 195, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 164, - "end": 166, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 164, - "end": 165, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 171, - "end": 174, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 180, - "end": 182, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1." - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 188, - "end": 193, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 188, - "end": 192, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.00" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 197, - "end": 241, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 201, - "end": 241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 202, - "end": 241, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 210, - "end": 212, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 217, - "end": 220, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 226, - "end": 229, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 226, - "end": 228, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1." - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 234, - "end": 239, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "NumericLiteral", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.00" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 243, - "end": 299, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 247, - "end": 299, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 251, - "end": 299, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 260, - "end": 261, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.0" - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 279, - "end": 281, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1." - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 283, - "end": 284, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 290, - "end": 294, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1.00" - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 296, - "end": 297, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.ts b/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.ts deleted file mode 100644 index 7281d04964c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/objectTypeWithDuplicateNumericProperty.ts +++ /dev/null @@ -1,31 +0,0 @@ -// numeric properties must be distinct after a ToNumber operation -// so the below are all errors - -class C { - 1; - 1.0; - 1.; - 1.00; -} - -interface I { - 1; - 1.0; - 1.; - 1.00; -} - -var a: { - 1; - 1.0; - 1.; - 1.00; -} - -var b = { - 1: 1, - 1.0: 1, - 1.: 1, - 1.00: 1 -} - diff --git a/crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates3.ts b/crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates3.ts index 4895466258b..0e5dc45c941 100644 --- a/crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates3.ts +++ b/crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates3.ts @@ -1,4 +1,4 @@ -interface T1 { } +interface T1 { } interface T2 { z } class C1 { diff --git a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteral.ts b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteral.ts index a9a2362b5c9..41e92545019 100644 --- a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteral.ts +++ b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteral.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; diff --git a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralES6.ts b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralES6.ts index 59c24153ad4..61a0526725a 100644 --- a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; diff --git a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.json b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.json deleted file mode 100644 index ab59e565db6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 10, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 10, - "end": 32, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 14, - "end": 28, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 14, - "end": 18, - "ctxt": 0 - }, - "value": "oct1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 21, - "end": 28, - "ctxt": 0 - }, - "value": 5852.0, - "raw": "0O13334" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 33, - "end": 55, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 37, - "end": 50, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 41, - "ctxt": 0 - }, - "value": "oct2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 44, - "end": 50, - "ctxt": 0 - }, - "value": 1817.0, - "raw": "0o3431" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 57, - "end": 133, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 61, - "end": 132, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 61, - "end": 65, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 68, - "end": 132, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 74, - "end": 81, - "ctxt": 0 - }, - "value": 19230.0, - "raw": "0O45436" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 83, - "end": 87, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 93, - "end": 98, - "ctxt": 0 - }, - "value": 19230.0, - "raw": "19230" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 100, - "end": 107, - "ctxt": 0 - }, - "value": "Hello", - "raw": "\"Hello\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 113, - "end": 120, - "ctxt": 0 - }, - "value": "19230", - "raw": "\"19230\"" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.ts b/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.ts deleted file mode 100644 index f1911b184e7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralError.ts +++ /dev/null @@ -1,9 +0,0 @@ -// error -var oct1 = 0O13334823; -var oct2 = 0o34318592; - -var obj1 = { - 0O45436: "hi", - 19230: "Hello", - "19230": "world", -}; diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters1.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters1.ts index f1d8d49abb0..573fec7f0d8 100644 --- a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters1.ts +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters1.ts @@ -1,4 +1,4 @@ - + function foo([x,y,z]?: [string, number, boolean]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters2.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters2.ts index 51df1faf160..8efda6671be 100644 --- a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters2.ts +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters2.ts @@ -1,4 +1,4 @@ - + function foo({ x, y, z }?: { x: string; y: number; z: boolean }) { } diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters3.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters3.ts index f1772bdaa49..751bbc21b77 100644 --- a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters3.ts +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters3.ts @@ -1,4 +1,4 @@ -// @checkJs: true +// @checkJs: true // @allowJs: true // @noEmit: true // @filename: /a.js diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.json b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.json new file mode 100644 index 00000000000..eca20cc9017 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.json @@ -0,0 +1,123 @@ +{ + "type": "Script", + "span": { + "start": 125, + "end": 175, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 134, + "end": 137, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 138, + "end": 152, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "AssignmentPattern", + "span": { + "start": 138, + "end": 152, + "ctxt": 0 + }, + "left": { + "type": "ObjectPattern", + "span": { + "start": 138, + "end": 147, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 140, + "end": 145, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 140, + "end": 145, + "ctxt": 0 + }, + "value": "cause", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "ObjectExpression", + "span": { + "start": 150, + "end": 152, + "ctxt": 0 + }, + "properties": [] + }, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 125, + "end": 175, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 154, + "end": 175, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 160, + "end": 173, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 167, + "end": 172, + "ctxt": 0 + }, + "value": "cause", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.ts new file mode 100644 index 00000000000..e660b6f33ed --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.ts @@ -0,0 +1,11 @@ +// @checkJs: true +// @allowJs: true +// @noEmit: true +// @filename: /a.js + +/** +* @param {{ cause?: string }} [options] +*/ +function foo({ cause } = {}) { + return cause; +} diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads1.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads1.ts index a5a426d4623..aaa4884d057 100644 --- a/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads1.ts +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads1.ts @@ -1,4 +1,4 @@ - + function foo([x, y, z] ?: [string, number, boolean]); function foo(...rest: any[]) { diff --git a/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads2.ts b/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads2.ts index 321754600ad..edf27f0e112 100644 --- a/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads2.ts +++ b/crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads2.ts @@ -1,4 +1,4 @@ - + function foo({ x, y, z }?: { x: string; y: number; z: boolean }); function foo(...rest: any[]) { diff --git a/crates/swc_ecma_parser/tests/tsc/overloadTag1.json b/crates/swc_ecma_parser/tests/tsc/overloadTag1.json new file mode 100644 index 00000000000..a8e9ecc35b8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/overloadTag1.json @@ -0,0 +1,885 @@ +{ + "type": "Module", + "span": { + "start": 364, + "end": 978, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 364, + "end": 598, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 380, + "end": 390, + "ctxt": 0 + }, + "value": "overloaded", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 391, + "end": 392, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 391, + "end": 392, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 393, + "end": 394, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 393, + "end": 394, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 371, + "end": 598, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 396, + "end": 598, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 400, + "end": 556, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 404, + "end": 450, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 404, + "end": 425, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 404, + "end": 412, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 411, + "end": 412, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 417, + "end": 425, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 429, + "end": 450, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 429, + "end": 437, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 436, + "end": 437, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 442, + "end": 450, + "ctxt": 0 + }, + "value": "string", + "raw": "\"string\"" + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 452, + "end": 475, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 458, + "end": 471, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 465, + "end": 470, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 465, + "end": 466, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 469, + "end": 470, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + } + ] + }, + "alternate": { + "type": "IfStatement", + "span": { + "start": 481, + "end": 556, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 485, + "end": 531, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 485, + "end": 506, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 485, + "end": 493, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 492, + "end": 493, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 498, + "end": 506, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 510, + "end": 531, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 510, + "end": 518, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 517, + "end": 518, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 523, + "end": 531, + "ctxt": 0 + }, + "value": "number", + "raw": "\"number\"" + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 533, + "end": 556, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 539, + "end": 552, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 546, + "end": 551, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 546, + "end": 547, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 550, + "end": 551, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + } + ] + }, + "alternate": null + } + }, + { + "type": "ThrowStatement", + "span": { + "start": 559, + "end": 596, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 565, + "end": 595, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 569, + "end": 574, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 575, + "end": 594, + "ctxt": 0 + }, + "value": "Invalid arguments", + "raw": "\"Invalid arguments\"" + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 599, + "end": 623, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 603, + "end": 623, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 603, + "end": 605, + "ctxt": 0 + }, + "value": "o1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 608, + "end": 623, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 608, + "end": 618, + "ctxt": 0 + }, + "value": "overloaded", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 619, + "end": 620, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 621, + "end": 622, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 624, + "end": 658, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 628, + "end": 658, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 628, + "end": 630, + "ctxt": 0 + }, + "value": "o2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 633, + "end": 658, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 633, + "end": 643, + "ctxt": 0 + }, + "value": "overloaded", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 644, + "end": 650, + "ctxt": 0 + }, + "value": "zero", + "raw": "\"zero\"" + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 652, + "end": 657, + "ctxt": 0 + }, + "value": "one", + "raw": "\"one\"" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 659, + "end": 689, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 663, + "end": 689, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 663, + "end": 665, + "ctxt": 0 + }, + "value": "o3", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 668, + "end": 689, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 668, + "end": 678, + "ctxt": 0 + }, + "value": "overloaded", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 679, + "end": 682, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + }, + { + "spread": null, + "expression": { + "type": "BooleanLiteral", + "span": { + "start": 683, + "end": 688, + "ctxt": 0 + }, + "value": false + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "ExportDeclaration", + "span": { + "start": 855, + "end": 918, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 871, + "end": 890, + "ctxt": 0 + }, + "value": "uncheckedInternally", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 891, + "end": 892, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 891, + "end": 892, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 894, + "end": 895, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 894, + "end": 895, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 862, + "end": 918, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 897, + "end": 918, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 903, + "end": 916, + "ctxt": 0 + }, + "argument": { + "type": "BinaryExpression", + "span": { + "start": 910, + "end": 915, + "ctxt": 0 + }, + "operator": "+", + "left": { + "type": "Identifier", + "span": { + "start": 910, + "end": 911, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 914, + "end": 915, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 919, + "end": 943, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 919, + "end": 943, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 919, + "end": 938, + "ctxt": 0 + }, + "value": "uncheckedInternally", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 939, + "end": 940, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 941, + "end": 942, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 944, + "end": 978, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 944, + "end": 978, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 944, + "end": 963, + "ctxt": 0 + }, + "value": "uncheckedInternally", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 964, + "end": 970, + "ctxt": 0 + }, + "value": "zero", + "raw": "\"zero\"" + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 972, + "end": 977, + "ctxt": 0 + }, + "value": "one", + "raw": "\"one\"" + } + } + ], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/overloadTag1.ts b/crates/swc_ecma_parser/tests/tsc/overloadTag1.ts new file mode 100644 index 00000000000..4eb66b596df --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/overloadTag1.ts @@ -0,0 +1,48 @@ +// @checkJs: true +// @allowJs: true +// @outdir: foo +// @declaration: true +// @filename: overloadTag1.js +/** + * @overload + * @param {number} a + * @param {number} b + * @returns {number} + * + * @overload + * @param {string} a + * @param {boolean} b + * @returns {string} + * + * @param {string | number} a + * @param {string | number} b + * @returns {string | number} + */ +export function overloaded(a,b) { + if (typeof a === "string" && typeof b === "string") { + return a + b; + } else if (typeof a === "number" && typeof b === "number") { + return a + b; + } + throw new Error("Invalid arguments"); +} +var o1 = overloaded(1,2) +var o2 = overloaded("zero", "one") +var o3 = overloaded("a",false) + +/** + * @overload + * @param {number} a + * @param {number} b + * @returns {number} + * + * @overload + * @param {string} a + * @param {boolean} b + * @returns {string} + */ +export function uncheckedInternally(a, b) { + return a + b; +} +uncheckedInternally(1,2) +uncheckedInternally("zero", "one") diff --git a/crates/swc_ecma_parser/tests/tsc/overloadTag2.json b/crates/swc_ecma_parser/tests/tsc/overloadTag2.json new file mode 100644 index 00000000000..cbed073502a --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/overloadTag2.json @@ -0,0 +1,609 @@ +{ + "type": "Module", + "span": { + "start": 141, + "end": 772, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 141, + "end": 686, + "ctxt": 0 + }, + "declaration": { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 154, + "end": 157, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "declare": false, + "span": { + "start": 148, + "end": 686, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "PrivateProperty", + "span": { + "start": 164, + "end": 183, + "ctxt": 0 + }, + "key": { + "type": "PrivateName", + "span": { + "start": 164, + "end": 166, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 165, + "end": 166, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + "value": { + "type": "ConditionalExpression", + "span": { + "start": 169, + "end": 183, + "ctxt": 0 + }, + "test": { + "type": "BooleanLiteral", + "span": { + "start": 169, + "end": 173, + "ctxt": 0 + }, + "value": true + }, + "consequent": { + "type": "NumericLiteral", + "span": { + "start": 176, + "end": 177, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "alternate": { + "type": "StringLiteral", + "span": { + "start": 180, + "end": 183, + "ctxt": 0 + }, + "value": "1", + "raw": "\"1\"" + } + }, + "typeAnnotation": null, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isOptional": false, + "isOverride": false, + "readonly": false, + "definite": false + }, + { + "type": "PrivateProperty", + "span": { + "start": 188, + "end": 190, + "ctxt": 0 + }, + "key": { + "type": "PrivateName", + "span": { + "start": 188, + "end": 190, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 189, + "end": 190, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + }, + "value": null, + "typeAnnotation": null, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isOptional": false, + "isOverride": false, + "readonly": false, + "definite": false + }, + { + "type": "Constructor", + "span": { + "start": 619, + "end": 684, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 619, + "end": 630, + "ctxt": 0 + }, + "value": "constructor", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 631, + "end": 632, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 631, + "end": 632, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + } + }, + { + "type": "Parameter", + "span": { + "start": 634, + "end": 635, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 634, + "end": 635, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 637, + "end": 684, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 647, + "end": 658, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 647, + "end": 658, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 647, + "end": 654, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 647, + "end": 651, + "ctxt": 0 + } + }, + "property": { + "type": "PrivateName", + "span": { + "start": 652, + "end": 654, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 653, + "end": 654, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 657, + "end": 658, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 667, + "end": 678, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 667, + "end": 678, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 667, + "end": 674, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 667, + "end": 671, + "ctxt": 0 + } + }, + "property": { + "type": "PrivateName", + "span": { + "start": 672, + "end": 674, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 673, + "end": 674, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 677, + "end": 678, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + } + ] + }, + "accessibility": null, + "isOptional": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 687, + "end": 704, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 691, + "end": 704, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 691, + "end": 692, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 695, + "end": 704, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 699, + "end": 702, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 705, + "end": 727, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 709, + "end": 727, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 709, + "end": 710, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 713, + "end": 727, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 717, + "end": 720, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 721, + "end": 726, + "ctxt": 0 + }, + "value": "str", + "raw": "'str'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 728, + "end": 746, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 732, + "end": 746, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 732, + "end": 733, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 736, + "end": 746, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 740, + "end": 743, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 744, + "end": 745, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 747, + "end": 772, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 751, + "end": 772, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 751, + "end": 752, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NewExpression", + "span": { + "start": 755, + "end": 772, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 759, + "end": 762, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 763, + "end": 768, + "ctxt": 0 + }, + "value": "str", + "raw": "'str'" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 770, + "end": 771, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/overloadTag2.ts b/crates/swc_ecma_parser/tests/tsc/overloadTag2.ts new file mode 100644 index 00000000000..e6acf59b380 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/overloadTag2.ts @@ -0,0 +1,40 @@ +// @checkJs: true +// @allowJs: true +// @target: esnext +// @outdir: foo +// @declaration: true +// @filename: overloadTag2.js +// @strict: true +export class Foo { + #a = true ? 1 : "1" + #b + + /** + * Should not have an implicit any error, because constructor's return type is always implicit + * @constructor + * @overload + * @param {string} a + * @param {number} b + */ + /** + * @constructor + * @overload + * @param {number} a + */ + /** + * @constructor + * @overload + * @param {string} a + *//** + * @constructor + * @param {number | string} a + */ + constructor(a, b) { + this.#a = a + this.#b = b + } +} +var a = new Foo() +var b = new Foo('str') +var c = new Foo(2) +var d = new Foo('str', 2) diff --git a/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.json b/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.json new file mode 100644 index 00000000000..e6ebc6ba5b0 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.json @@ -0,0 +1,10 @@ +{ + "type": "Script", + "span": { + "start": 1, + "end": 1, + "ctxt": 0 + }, + "body": [], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.ts b/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.ts new file mode 100644 index 00000000000..b1bf3811d6e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/packageJsonImportsExportsOptionCompat.ts @@ -0,0 +1,7 @@ +// @moduleResolution: classic, node, node16, nodenext, bundler +// @resolvePackageJsonImports: true +// @resolvePackageJsonExports: true +// @noTypesAndSymbols: true +// @noEmit: true + +// @Filename: index.ts \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.json b/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.json deleted file mode 100644 index 3b665a97f73..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.json +++ /dev/null @@ -1,327 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 174, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 174, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 31, - "end": 46, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 40, - "ctxt": 0 - }, - "value": "interface", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 43, - "end": 45, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 51, - "end": 74, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 58, - "end": 68, - "ctxt": 0 - }, - "value": "implements", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 51, - "end": 74, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 71, - "end": 74, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 79, - "end": 109, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 86, - "end": 89, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 90, - "end": 104, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 90, - "end": 104, - "ctxt": 0 - }, - "value": "arguments", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 79, - "end": 109, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 106, - "end": 109, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 114, - "end": 172, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 125, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 126, - "end": 134, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 126, - "end": 134, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 131, - "end": 134, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 114, - "end": 172, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 136, - "end": 172, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 146, - "end": 166, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 146, - "end": 165, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 146, - "end": 155, - "ctxt": 0 - }, - "value": "arguments", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 158, - "end": 165, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.ts b/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.ts deleted file mode 100644 index 2b247acbc23..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parseClassDeclarationInStrictModeByDefaultInES6.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target: es6 -class C { - interface = 10; - public implements() { } - public foo(arguments: any) { } - private bar(eval:any) { - arguments = "hello"; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.json b/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.json deleted file mode 100644 index dcc5b648ce6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 13, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 9, - "end": 13, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Invalid", - "span": { - "start": 9, - "end": 11, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 12, - "end": 13, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.ts b/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.ts deleted file mode 100644 index 9f017210e1c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parseIncompleteBinaryExpression1.ts +++ /dev/null @@ -1 +0,0 @@ -var v = || b; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.json b/crates/swc_ecma_parser/tests/tsc/parseThrowsTag.json similarity index 77% rename from crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.json rename to crates/swc_ecma_parser/tests/tsc/parseThrowsTag.json index 031cb3900a0..07a91c58a52 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.json +++ b/crates/swc_ecma_parser/tests/tsc/parseThrowsTag.json @@ -1,8 +1,8 @@ { "type": "Script", "span": { - "start": 1, - "end": 17, + "start": 32, + "end": 47, "ctxt": 0 }, "body": [ @@ -11,26 +11,26 @@ "identifier": { "type": "Identifier", "span": { - "start": 10, - "end": 11, + "start": 41, + "end": 42, "ctxt": 0 }, - "value": "F", + "value": "f", "optional": false }, "declare": false, "params": [], "decorators": [], "span": { - "start": 1, - "end": 17, + "start": 32, + "end": 47, "ctxt": 0 }, "body": { "type": "BlockStatement", "span": { - "start": 14, - "end": 17, + "start": 45, + "end": 47, "ctxt": 0 }, "stmts": [] diff --git a/crates/swc_ecma_parser/tests/tsc/parseThrowsTag.ts b/crates/swc_ecma_parser/tests/tsc/parseThrowsTag.ts new file mode 100644 index 00000000000..90b69045f92 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parseThrowsTag.ts @@ -0,0 +1,2 @@ +/** @throws {Error} comment */ +function f() {} diff --git a/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.json b/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.json deleted file mode 100644 index d27ae3aad19..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 619, - "end": 683, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 619, - "end": 632, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 619, - "end": 631, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 633, - "end": 646, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 633, - "end": 645, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ThrowStatement", - "span": { - "start": 647, - "end": 667, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 653, - "end": 666, - "ctxt": 0 - }, - "value": "NotEarlyError", - "optional": false - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 668, - "end": 683, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 672, - "end": 682, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 672, - "end": 678, - "ctxt": 0 - }, - "value": "public", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 681, - "end": 682, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.ts b/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.ts deleted file mode 100644 index 9526194a373..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser10.1.1-8gs.ts +++ /dev/null @@ -1,19 +0,0 @@ -// @allowUnreachableCode: true - -/// Copyright (c) 2012 Ecma International. All rights reserved. -/// Ecma International makes this code available under the terms and conditions set -/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the -/// "Use Terms"). Any redistribution of this code must retain the above -/// copyright and this notice and otherwise comply with the Use Terms. - -/** - * @path ch10/10.1/10.1.1/10.1.1-8gs.js - * @description Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the code - * @noStrict - * @negative ^((?!NotEarlyError).)*$ - */ - -"use strict"; -"use strict"; -throw NotEarlyError; -var public = 1; diff --git a/crates/swc_ecma_parser/tests/tsc/parser509618.json b/crates/swc_ecma_parser/tests/tsc/parser509618.json deleted file mode 100644 index fb3b7c0fc56..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser509618.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 26, - "ctxt": 0 - }, - "value": "ambiModule", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 27, - "end": 51, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 32, - "end": 48, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 42, - "end": 44, - "ctxt": 0 - }, - "value": "i1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "EmptyStatement", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser509618.ts b/crates/swc_ecma_parser/tests/tsc/parser509618.ts deleted file mode 100644 index 73c5e8e113c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser509618.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module ambiModule { - interface i1 { }; -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser512084.json b/crates/swc_ecma_parser/tests/tsc/parser512084.json deleted file mode 100644 index 26d03533478..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser512084.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 12, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 12, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser512084.ts b/crates/swc_ecma_parser/tests/tsc/parser512084.ts deleted file mode 100644 index 24417e95c5c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser512084.ts +++ /dev/null @@ -1 +0,0 @@ -class foo { diff --git a/crates/swc_ecma_parser/tests/tsc/parser512325.json b/crates/swc_ecma_parser/tests/tsc/parser512325.json deleted file mode 100644 index 777c6c3fcc5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser512325.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 31, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 7, - "ctxt": 0 - }, - "value": "tt", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 10, - "end": 30, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - { - "type": "Invalid", - "span": { - "start": 14, - "end": 20, - "ctxt": 0 - } - } - ], - "body": { - "type": "BinaryExpression", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser512325.ts b/crates/swc_ecma_parser/tests/tsc/parser512325.ts deleted file mode 100644 index 8be4e1754c9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser512325.ts +++ /dev/null @@ -1 +0,0 @@ -var tt = (a, (b, c)) => a+b+c; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser553699.json b/crates/swc_ecma_parser/tests/tsc/parser553699.json deleted file mode 100644 index 1513b51fa42..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser553699.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 107, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 66, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 15, - "end": 32, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 15, - "end": 26, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 35, - "end": 64, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 42, - "end": 48, - "ctxt": 0 - }, - "value": "banana", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 53, - "end": 59, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 53, - "end": 59, - "ctxt": 0 - }, - "value": "public", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 35, - "end": 64, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 61, - "end": 64, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "declare": false, - "span": { - "start": 68, - "end": 107, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 82, - "end": 105, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 82, - "end": 93, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 94, - "end": 100, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 94, - "end": 100, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 100, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser553699.ts b/crates/swc_ecma_parser/tests/tsc/parser553699.ts deleted file mode 100644 index d9416b38d0e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser553699.ts +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - constructor() { } - public banana (x: public) { } -} - -class Bar { - constructor(c: Bar) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser642331.json b/crates/swc_ecma_parser/tests/tsc/parser642331.json deleted file mode 100644 index 5a40565dfb8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser642331.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 44, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 11, - "ctxt": 0 - }, - "value": "test", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 44, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 18, - "end": 42, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "value": "static", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser642331.ts b/crates/swc_ecma_parser/tests/tsc/parser642331.ts deleted file mode 100644 index 6ebc70d7def..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser642331.ts +++ /dev/null @@ -1,3 +0,0 @@ -class test { - constructor (static) { } -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser642331_1.json b/crates/swc_ecma_parser/tests/tsc/parser642331_1.json deleted file mode 100644 index 6a0495a5832..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser642331_1.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 59, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 26, - "ctxt": 0 - }, - "value": "test", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 59, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 33, - "end": 57, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 44, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 46, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 46, - "end": 52, - "ctxt": 0 - }, - "value": "static", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser642331_1.ts b/crates/swc_ecma_parser/tests/tsc/parser642331_1.ts deleted file mode 100644 index d966520f1b9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser642331_1.ts +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -class test { - constructor (static) { } -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser645086_1.json b/crates/swc_ecma_parser/tests/tsc/parser645086_1.json deleted file mode 100644 index d9a44e22364..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser645086_1.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 13, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "RegExpLiteral", - "span": { - "start": 9, - "end": 13, - "ctxt": 0 - }, - "pattern": "[]", - "flags": "" - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser645086_1.ts b/crates/swc_ecma_parser/tests/tsc/parser645086_1.ts deleted file mode 100644 index dd56d7ba442..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser645086_1.ts +++ /dev/null @@ -1 +0,0 @@ -var v = /[]/]/ \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser645086_2.json b/crates/swc_ecma_parser/tests/tsc/parser645086_2.json deleted file mode 100644 index bce28ed4f57..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser645086_2.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "RegExpLiteral", - "span": { - "start": 9, - "end": 14, - "ctxt": 0 - }, - "pattern": "[^]", - "flags": "" - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser645086_2.ts b/crates/swc_ecma_parser/tests/tsc/parser645086_2.ts deleted file mode 100644 index 661a3010c3a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser645086_2.ts +++ /dev/null @@ -1 +0,0 @@ -var v = /[^]/]/ \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.json b/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.json deleted file mode 100644 index 3e5ced76fc6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 28, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 12, - "ctxt": 0 - }, - "value": "Outer", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 28, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 15, - "end": 28, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 22, - "end": 28, - "ctxt": 0 - }, - "value": "public", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.ts deleted file mode 100644 index 7541fce05ea..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessibilityAfterStatic6.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Outer -{ -static public \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors10.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors10.json deleted file mode 100644 index 11f2a04e44a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors10.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 52, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 52, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 51, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 25, - "end": 51, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 29, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 40, - "end": 43, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors10.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors10.ts deleted file mode 100644 index da4d163c8f7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors10.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -var v = { - public get foo() { } -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors5.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors5.json deleted file mode 100644 index 61bb9c89f65..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors5.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 62, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 17, - "end": 62, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 37, - "end": 60, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 41, - "end": 44, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 37, - "end": 60, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 47, - "end": 60, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors5.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors5.ts deleted file mode 100644 index e086f4f87e5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors5.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -declare class C { - get foo() { return 0; } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors6.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors6.json deleted file mode 100644 index f52a59c7478..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors6.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 53, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 17, - "end": 53, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 37, - "end": 51, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 41, - "end": 44, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 37, - "end": 51, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 48, - "end": 51, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors6.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors6.ts deleted file mode 100644 index 90754705e54..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors6.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -declare class C { - set foo(v) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors7.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors7.json deleted file mode 100644 index 11dea12de80..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors7.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 52, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 52, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 51, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 25, - "end": 51, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 27, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors7.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors7.ts deleted file mode 100644 index 2629dc54b9c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors7.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target: es5 -var v = { get foo(v: number) { } }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors8.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors8.json deleted file mode 100644 index b418b3f9657..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors8.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 42, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 25, - "end": 42, - "ctxt": 0 - }, - "properties": [ - { - "type": "SetterProperty", - "span": { - "start": 27, - "end": 40, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "param": { - "type": "Invalid", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors8.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors8.ts deleted file mode 100644 index 7a3410b9800..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors8.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target: es5 -var v = { set foo() { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors9.json b/crates/swc_ecma_parser/tests/tsc/parserAccessors9.json deleted file mode 100644 index c1c160dc5d4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors9.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 46, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 17, - "end": 46, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 21, - "end": 46, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 25, - "end": 46, - "ctxt": 0 - }, - "properties": [ - { - "type": "SetterProperty", - "span": { - "start": 27, - "end": 44, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 41, - "end": 44, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserAccessors9.ts b/crates/swc_ecma_parser/tests/tsc/parserAccessors9.ts deleted file mode 100644 index 80a108c6c8b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserAccessors9.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @target: es5 -var v = { set foo(a, b) { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator1.ts b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator1.ts index 9b910ba2d88..8457aebd7cc 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator1.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator1.ts @@ -1,4 +1,4 @@ -function f1() { +function f1() { var a, b, c; if (a < b || b > (c + 1)) { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator2.ts b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator2.ts index 0b764ae6baf..edb79474461 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator2.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator2.ts @@ -1,4 +1,4 @@ -function f() { +function f() { var a, b, c; if (a < b && b > (c + 1)) { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator3.ts b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator3.ts index 5a626ece5e7..48086ba3893 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator3.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator3.ts @@ -1,4 +1,4 @@ -function f() { +function f() { var a, b, c; if (a < b && b < (c + 1)) { } } diff --git a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator4.ts b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator4.ts index 220568d9ae8..e1316446d63 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator4.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserAmbiguityWithBinaryOperator4.ts @@ -1,4 +1,4 @@ -function g() { +function g() { var a, b, c; if (a(c + 1)) { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.json new file mode 100644 index 00000000000..488b3d1fa0e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.json @@ -0,0 +1,271 @@ +{ + "type": "Script", + "span": { + "start": 98, + "end": 232, + "ctxt": 0 + }, + "body": [ + { + "type": "ExpressionStatement", + "span": { + "start": 98, + "end": 125, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 98, + "end": 125, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 102, + "end": 116, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 113, + "end": 116, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 114, + "end": 115, + "ctxt": 0 + }, + "value": "d", + "optional": false + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 106, + "end": 109, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 108, + "end": 109, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 108, + "end": 109, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "typeParams": null + } + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 119, + "end": 125, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 119, + "end": 120, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 124, + "end": 125, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 205, + "end": 232, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 205, + "end": 232, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 205, + "end": 206, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 209, + "end": 223, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 210, + "end": 211, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 220, + "end": 223, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 221, + "end": 222, + "ctxt": 0 + }, + "value": "d", + "optional": false + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 213, + "end": 216, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 215, + "end": 216, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 215, + "end": 216, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "typeParams": null + } + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 226, + "end": 232, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 226, + "end": 227, + "ctxt": 0 + }, + "value": "e", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 231, + "end": 232, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.ts new file mode 100644 index 00000000000..306e32d7a23 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression10.ts @@ -0,0 +1,10 @@ +// @allowjs: true +// @checkjs: true +// @outdir: out +// @target: es3,es6 + +// @filename: fileJs.js +a ? (b) : c => (d) : e => f // Not legal JS; "Unexpected token ':'" at last colon + +// @filename: fileTs.ts +a ? (b) : c => (d) : e => f diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression11.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression11.ts new file mode 100644 index 00000000000..ef0a245ff5d --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression11.ts @@ -0,0 +1,10 @@ +// @allowjs: true +// @checkjs: true +// @outdir: out +// @target: es3,es6 + +// @filename: fileJs.js +a ? b ? c : (d) : e => f // Legal JS + +// @filename: fileTs.ts +a ? b ? c : (d) : e => f diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.json new file mode 100644 index 00000000000..3185f8c5a4f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.json @@ -0,0 +1,219 @@ +{ + "type": "Script", + "span": { + "start": 98, + "end": 180, + "ctxt": 0 + }, + "body": [ + { + "type": "ExpressionStatement", + "span": { + "start": 98, + "end": 120, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 98, + "end": 120, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 102, + "end": 112, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 109, + "end": 112, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 110, + "end": 111, + "ctxt": 0 + }, + "value": "c", + "optional": false + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 114, + "end": 120, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 114, + "end": 115, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 119, + "end": 120, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 158, + "end": 180, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 158, + "end": 180, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 158, + "end": 159, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 162, + "end": 172, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 163, + "end": 164, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 169, + "end": 172, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 170, + "end": 171, + "ctxt": 0 + }, + "value": "c", + "optional": false + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 174, + "end": 180, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 174, + "end": 175, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 179, + "end": 180, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.ts new file mode 100644 index 00000000000..9d75874c055 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression12.ts @@ -0,0 +1,10 @@ +// @allowjs: true +// @checkjs: true +// @outdir: out +// @target: es3,es6 + +// @filename: fileJs.js +a ? (b) => (c): d => e // Legal JS + +// @filename: fileTs.ts +a ? (b) => (c): d => e diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.json deleted file mode 100644 index 7bbdae85558..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 5, - "end": 19, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "ArrowFunctionExpression", - "span": { - "start": 5, - "end": 14, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 11, - "end": 14, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.ts deleted file mode 100644 index 4e3e78e111b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression2.ts +++ /dev/null @@ -1 +0,0 @@ -a = () => { } || a \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.json deleted file mode 100644 index 00a66c16043..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ParenthesisExpression", - "span": { - "start": 5, - "end": 21, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 6, - "end": 20, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "ArrowFunctionExpression", - "span": { - "start": 6, - "end": 15, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 12, - "end": 15, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.ts deleted file mode 100644 index 6a6277b456c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression3.ts +++ /dev/null @@ -1 +0,0 @@ -a = (() => { } || a) \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.json new file mode 100644 index 00000000000..32597b17d6f --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.json @@ -0,0 +1,275 @@ +{ + "type": "Script", + "span": { + "start": 98, + "end": 198, + "ctxt": 0 + }, + "body": [ + { + "type": "ExpressionStatement", + "span": { + "start": 98, + "end": 129, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 98, + "end": 129, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 102, + "end": 114, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 102, + "end": 103, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 107, + "end": 114, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 108, + "end": 113, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 110, + "end": 111, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + ] + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 117, + "end": 129, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 117, + "end": 118, + "ctxt": 0 + }, + "value": "z", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 122, + "end": 129, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 123, + "end": 128, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 125, + "end": 126, + "ctxt": 0 + }, + "value": "z", + "optional": false + } + ] + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 167, + "end": 198, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 167, + "end": 198, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "consequent": { + "type": "ArrowFunctionExpression", + "span": { + "start": 171, + "end": 183, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 171, + "end": 172, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 176, + "end": 183, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 177, + "end": 182, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 179, + "end": 180, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + ] + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 186, + "end": 198, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 186, + "end": 187, + "ctxt": 0 + }, + "value": "z", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 191, + "end": 198, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 192, + "end": 197, + "ctxt": 0 + }, + "properties": [ + { + "type": "Identifier", + "span": { + "start": 194, + "end": 195, + "ctxt": 0 + }, + "value": "z", + "optional": false + } + ] + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.ts new file mode 100644 index 00000000000..4a908beffa7 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression8.ts @@ -0,0 +1,10 @@ +// @allowjs: true +// @checkjs: true +// @outdir: out +// @target: es3,es6 + +// @filename: fileJs.js +x ? y => ({ y }) : z => ({ z }) // Legal JS + +// @filename: fileTs.ts +x ? y => ({ y }) : z => ({ z }) diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.json b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.json new file mode 100644 index 00000000000..fa35eb68673 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.json @@ -0,0 +1,169 @@ +{ + "type": "Script", + "span": { + "start": 98, + "end": 168, + "ctxt": 0 + }, + "body": [ + { + "type": "ExpressionStatement", + "span": { + "start": 98, + "end": 114, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 98, + "end": 114, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 98, + "end": 99, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "consequent": { + "type": "ParenthesisExpression", + "span": { + "start": 102, + "end": 105, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 103, + "end": 104, + "ctxt": 0 + }, + "value": "c", + "optional": false + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 108, + "end": 114, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 108, + "end": 109, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 113, + "end": 114, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 152, + "end": 168, + "ctxt": 0 + }, + "expression": { + "type": "ConditionalExpression", + "span": { + "start": 152, + "end": 168, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 152, + "end": 153, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "consequent": { + "type": "ParenthesisExpression", + "span": { + "start": 156, + "end": 159, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 157, + "end": 158, + "ctxt": 0 + }, + "value": "c", + "optional": false + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "span": { + "start": 162, + "end": 168, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 162, + "end": 163, + "ctxt": 0 + }, + "value": "d", + "optional": false, + "typeAnnotation": null + } + ], + "body": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "e", + "optional": false + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.ts b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.ts new file mode 100644 index 00000000000..93ebbc25408 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/parserArrowFunctionExpression9.ts @@ -0,0 +1,10 @@ +// @allowjs: true +// @checkjs: true +// @outdir: out +// @target: es3,es6 + +// @filename: fileJs.js +b ? (c) : d => e // Legal JS + +// @filename: fileTs.ts +b ? (c) : d => e diff --git a/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.json deleted file mode 100644 index 486eba4fc59..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 3, - "ctxt": 0 - }, - "body": [ - { - "type": "BlockStatement", - "span": { - "start": 1, - "end": 3, - "ctxt": 0 - }, - "stmts": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.ts deleted file mode 100644 index 9e26dfeeb6e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserBlockStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.json deleted file mode 100644 index 866d770c24b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "body": [ - { - "type": "BreakStatement", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "label": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.ts deleted file mode 100644 index 8cb76cf02d7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserBreakStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -break; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.json b/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.json deleted file mode 100644 index 57d1e3737c1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "TryStatement", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "block": { - "type": "BlockStatement", - "span": { - "start": 5, - "end": 8, - "ctxt": 0 - }, - "stmts": [] - }, - "handler": { - "type": "CatchClause", - "span": { - "start": 9, - "end": 29, - "ctxt": 0 - }, - "param": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 17, - "end": 24, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 19, - "end": 24, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 19, - "end": 24, - "ctxt": 0 - }, - "value": "Error", - "optional": false - }, - "typeParams": null - } - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "stmts": [] - } - }, - "finalizer": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.ts b/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.ts deleted file mode 100644 index 3d8a885f8e8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserCatchClauseWithTypeAnnotation1.ts +++ /dev/null @@ -1,3 +0,0 @@ -try { -} catch (e: Error) { -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.json deleted file mode 100644 index ab511ebc37f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.ts deleted file mode 100644 index bf7586358d4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration1.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A extends B { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.json deleted file mode 100644 index 80f5cb7ad04..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 131, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 15, - "end": 22, - "ctxt": 0 - }, - "value": "FooBase", - "optional": false - }, - "declare": true, - "span": { - "start": 1, - "end": 131, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 29, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 29, - "end": 40, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 42, - "end": 50, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 44, - "end": 50, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "Constructor", - "span": { - "start": 57, - "end": 80, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 57, - "end": 68, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 69, - "end": 78, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 69, - "end": 78, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 70, - "end": 78, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 72, - "end": 78, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "Constructor", - "span": { - "start": 85, - "end": 112, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 85, - "end": 96, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 97, - "end": 103, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 97, - "end": 103, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 98, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 100, - "end": 103, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 105, - "end": 112, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 117, - "end": 129, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 117, - "end": 121, - "ctxt": 0 - }, - "value": "bar1", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 117, - "end": 129, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 123, - "end": 128, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 124, - "end": 128, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.ts deleted file mode 100644 index 898fd3c257e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration18.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare class FooBase { - constructor(s: string); - constructor(n: number); - constructor(x: any) { - } - bar1():void; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.json deleted file mode 100644 index 0d817a466c9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.ts deleted file mode 100644 index 349567a2fd9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration2.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C implements A implements B { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.json deleted file mode 100644 index 5ce80191de2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.ts deleted file mode 100644 index e8021e1e4cf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration3.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C implements A extends B { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.json deleted file mode 100644 index 7e77252e18b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeArguments": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.ts deleted file mode 100644 index afe65747c3e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration4.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A implements B extends C { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.json deleted file mode 100644 index dc549f3f1e9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 48, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeArguments": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.ts deleted file mode 100644 index 85af4cee9a4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration5.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A implements B implements C { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.json deleted file mode 100644 index cd5fe3f254c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 25, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 25, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.ts deleted file mode 100644 index 81d9b5b453f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration6.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A, B { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.json b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.json deleted file mode 100644 index 5d5914d18b6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 18, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 36, - "end": 37, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 22, - "end": 43, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.ts b/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.ts deleted file mode 100644 index 6555fe68a7e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserClassDeclaration7.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module M { - declare class C { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.json deleted file mode 100644 index 8bf7871f93c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 32, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 24, - "end": 31, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "Invalid", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - } - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.ts deleted file mode 100644 index 62e88ca437b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName1.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v = { [e] }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.json deleted file mode 100644 index fa82e23979c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 36, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.ts deleted file mode 100644 index 791d4867d30..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName10.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -class C { - [e] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.json deleted file mode 100644 index 3d7fdd8d556..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 37, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 37, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 29, - "end": 35, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 29, - "end": 35, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.ts deleted file mode 100644 index 724a3d32705..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName11.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -class C { - [e](); -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.json deleted file mode 100644 index 766f8f82a06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 38, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 25, - "end": 36, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 28, - "end": 36, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 30, - "end": 36, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.ts deleted file mode 100644 index 2c86fc05286..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName13.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v: { [e]: number }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.json deleted file mode 100644 index 2cea733d0b4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 41, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 41, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 40, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 40, - "ctxt": 0 - }, - "members": [ - { - "type": "TsMethodSignature", - "span": { - "start": 25, - "end": 38, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 30, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.ts deleted file mode 100644 index 3bff2d94ddd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName14.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v: { [e](): number }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.json deleted file mode 100644 index 3d995637e4f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.json +++ /dev/null @@ -1,158 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 60, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 60, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 59, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 59, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 26, - "end": 35, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 27, - "end": 35, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 29, - "end": 35, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 36, - "end": 44, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "kind": "string" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 25, - "end": 45, - "ctxt": 0 - } - }, - { - "type": "TsPropertySignature", - "span": { - "start": 46, - "end": 57, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 47, - "end": 48, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 49, - "end": 57, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.ts deleted file mode 100644 index be91e4ccb22..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName15.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v: { [e: number]: string; [e]: number }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.json deleted file mode 100644 index e8ccdff7f05..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 27, - "end": 34, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 27, - "end": 30, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.ts deleted file mode 100644 index b3d69e2d5b0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName16.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -enum E { - [e] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.json deleted file mode 100644 index cea1a78727c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 41, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 41, - "ctxt": 0 - }, - "members": [ - { - "type": "TsMethodSignature", - "span": { - "start": 25, - "end": 39, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": true, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 31, - "end": 39, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 33, - "end": 39, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.ts deleted file mode 100644 index 070b7ea7643..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName18.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v: { [e]?(): number }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.json deleted file mode 100644 index 85a819dff04..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 32, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 31, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 25, - "end": 29, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.ts deleted file mode 100644 index ce190be01c4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName19.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v: { [e]? }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.json deleted file mode 100644 index 6cfeaafc185..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 50, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 16, - "end": 50, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 28, - "end": 50, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 34, - "end": 47, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 47, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.ts deleted file mode 100644 index eda5b6054af..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName20.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -interface I { - [e](): number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.json deleted file mode 100644 index b1c26621ecb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 16, - "end": 48, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 28, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 34, - "end": 45, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.ts deleted file mode 100644 index 57ba73afa3c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName21.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -interface I { - [e]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.json deleted file mode 100644 index 59a515dcf28..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 52, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 38, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 49, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 43, - "end": 49, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.ts deleted file mode 100644 index 45831333c62..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName22.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare class C { - [e]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.json deleted file mode 100644 index 5bb2d8acae9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 66, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 66, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 44, - "end": 64, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 44, - "end": 47, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "AssignmentExpression", - "span": { - "start": 50, - "end": 64, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 50, - "end": 60, - "ctxt": 0 - }, - "object": { - "type": "NumericLiteral", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "property": { - "type": "Computed", - "span": { - "start": 56, - "end": 60, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 57, - "end": 59, - "ctxt": 0 - }, - "value": "e2", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 63, - "end": 64, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.ts deleted file mode 100644 index 2db302c284a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName25.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -class C { - // No ASI - [e] = 0 - [e2] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.json deleted file mode 100644 index 74ac7ffe1c7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 43, - "end": 63, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 43, - "end": 46, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "AssignmentExpression", - "span": { - "start": 49, - "end": 63, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 49, - "end": 59, - "ctxt": 0 - }, - "object": { - "type": "NumericLiteral", - "span": { - "start": 49, - "end": 50, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "property": { - "type": "Computed", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 56, - "end": 58, - "ctxt": 0 - }, - "value": "e2", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 62, - "end": 63, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.ts deleted file mode 100644 index f3924b30e48..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName26.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -enum E { - // No ASI - [e] = 0 - [e2] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.json deleted file mode 100644 index 8705d6a2220..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 65, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 30, - "end": 46, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 33, - "end": 41, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 51, - "end": 63, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 51, - "end": 55, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 52, - "end": 54, - "ctxt": 0 - }, - "value": "e2", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 55, - "end": 63, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 57, - "end": 63, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.ts deleted file mode 100644 index 102a0feb812..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName28.ts +++ /dev/null @@ -1,5 +0,0 @@ -//@target: ES6 -class C { - [e]: number = 0; - [e2]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.json deleted file mode 100644 index 94f7ab00908..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 74, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 74, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 45, - "end": 55, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "UpdateExpression", - "span": { - "start": 51, - "end": 55, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 51, - "end": 53, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 60, - "end": 72, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 60, - "end": 64, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 61, - "end": 63, - "ctxt": 0 - }, - "value": "e2", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 64, - "end": 72, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 66, - "end": 72, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.ts deleted file mode 100644 index b4cd1339ca0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName29.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -class C { - // yes ASI - [e] = id++ - [e2]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.json deleted file mode 100644 index 21059930ed6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 84, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 84, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 59, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 65, - "end": 69, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 65, - "end": 67, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - }, - { - "type": "TsEnumMember", - "span": { - "start": 74, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 78, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.ts deleted file mode 100644 index b9e4712fe89..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName30.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -enum E { - // no ASI, comma expected - [e] = id++ - [e2] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.json deleted file mode 100644 index c8c9af40a6e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 75, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 75, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 45, - "end": 56, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 48, - "end": 56, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 50, - "end": 56, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 61, - "end": 73, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 61, - "end": 65, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 62, - "end": 64, - "ctxt": 0 - }, - "value": "e2", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 65, - "end": 73, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 67, - "end": 73, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.ts deleted file mode 100644 index 9f74a3dd370..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName31.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -class C { - // yes ASI - [e]: number - [e2]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.json deleted file mode 100644 index c67dd9d49af..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 54, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 54, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 38, - "end": 51, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 51, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 43, - "end": 51, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 45, - "end": 51, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.ts deleted file mode 100644 index 20c00e34fed..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName32.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -declare class C { - [e](): number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.json deleted file mode 100644 index b72bdef5af8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 85, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 85, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 59, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "UpdateExpression", - "span": { - "start": 65, - "end": 69, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 65, - "end": 67, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - }, - { - "type": "TsEnumMember", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 75, - "end": 79, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 82, - "end": 83, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.ts deleted file mode 100644 index 5614834dce3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName34.ts +++ /dev/null @@ -1,6 +0,0 @@ -//@target: ES6 -enum E { - // no ASI, comma expected - [e] = id++, - [e2] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.json deleted file mode 100644 index ffc1e71dcf2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 43, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 43, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 24, - "end": 43, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Computed", - "span": { - "start": 30, - "end": 36, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 31, - "end": 35, - "ctxt": 0 - }, - "expressions": [ - { - "type": "NumericLiteral", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - { - "type": "NumericLiteral", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - ] - } - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "properties": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.ts deleted file mode 100644 index 0232703ce42..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName35.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -var x = { - [0, 1]: { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.json deleted file mode 100644 index c785350590b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 49, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 49, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 48, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 24, - "end": 48, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 26, - "end": 46, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 46, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.ts deleted file mode 100644 index 44a6ab65d7a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName5.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -var v = { public get [e]() { } }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.json deleted file mode 100644 index fb97a40def2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.ts deleted file mode 100644 index fb601c9794a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName7.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -class C { - [e] -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.json deleted file mode 100644 index 6110c6e364f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 41, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 41, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 39, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.ts deleted file mode 100644 index a3a320846b9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName8.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -class C { - public [e] -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.json b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.json deleted file mode 100644 index c55b2758c3d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 38, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "value": "Type", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.ts b/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.ts deleted file mode 100644 index b62b62992c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserComputedPropertyName9.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -class C { - [e]: Type -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.json b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.json deleted file mode 100644 index 805cb257813..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 13, - "end": 38, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 13, - "end": 24, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.ts b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.ts deleted file mode 100644 index 60665bdb84d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration10.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - constructor(): number { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.json b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.json deleted file mode 100644 index 8b8f75b602c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 13, - "end": 32, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 13, - "end": 24, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.ts b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.ts deleted file mode 100644 index 24b740f41f5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration11.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - constructor<>() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.json deleted file mode 100644 index 672e9e218ed..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 13, - "end": 37, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 20, - "end": 31, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.ts deleted file mode 100644 index 386e856948b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration2.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - static constructor() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.json b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.json deleted file mode 100644 index 0995c143c6e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 13, - "end": 38, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 21, - "end": 32, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.ts b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.ts deleted file mode 100644 index 5fd79ed92c5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration4.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - declare constructor() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.json b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.json deleted file mode 100644 index f90f1eeb347..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 13, - "end": 33, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 13, - "end": 24, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.ts b/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.ts deleted file mode 100644 index d292763990e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserConstructorDeclaration9.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - constructor() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.json deleted file mode 100644 index 4e5ca564199..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "body": [ - { - "type": "ContinueStatement", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "label": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.ts deleted file mode 100644 index 45127c0ad12..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserContinueStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -continue; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.json deleted file mode 100644 index 3187e9d6235..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "body": [ - { - "type": "DebuggerStatement", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.ts deleted file mode 100644 index 9f5fb105ad0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserDebuggerStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -debugger; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.json deleted file mode 100644 index a49674495e0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "body": [ - { - "type": "DoWhileStatement", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 4, - "end": 7, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.ts deleted file mode 100644 index 04ad1f9429b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserDoStatement1.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -do { -} -while (e); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.json deleted file mode 100644 index 59a515dcf28..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 52, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 38, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 49, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 43, - "end": 49, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.ts deleted file mode 100644 index c9bf42cd95d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName1.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -declare class C { - [e]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.json deleted file mode 100644 index fa82e23979c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 36, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.ts deleted file mode 100644 index 0a291755599..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName10.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -class C { - [e] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.json deleted file mode 100644 index 3d7fdd8d556..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 37, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 37, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 29, - "end": 35, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 29, - "end": 35, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.ts deleted file mode 100644 index c8132ced30d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName11.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -class C { - [e](); -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.json deleted file mode 100644 index b1c26621ecb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 16, - "end": 48, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 28, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 34, - "end": 45, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.ts deleted file mode 100644 index d5546554d34..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName5.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -interface I { - [e]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.json deleted file mode 100644 index e8ccdff7f05..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 27, - "end": 34, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 27, - "end": 30, - "ctxt": 0 - }, - "value": "", - "optional": false - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.ts deleted file mode 100644 index 219c661d92e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName6.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -enum E { - [e] = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.json deleted file mode 100644 index fb97a40def2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.ts deleted file mode 100644 index b8042c79bbd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName7.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -class C { - [e] -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.json deleted file mode 100644 index 766f8f82a06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 20, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 23, - "end": 38, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 25, - "end": 36, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 28, - "end": 36, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 30, - "end": 36, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.ts deleted file mode 100644 index 475d6ff4754..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName8.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES5 -var v: { [e]: number }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.json b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.json deleted file mode 100644 index c55b2758c3d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 29, - "end": 38, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "value": "Type", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.ts deleted file mode 100644 index d7fbf4d0479..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ComputedPropertyName9.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -class C { - [e]: Type -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.json deleted file mode 100644 index ce5b95a51a5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 26, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.ts deleted file mode 100644 index 63acdaede07..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement1.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var i of e) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.json deleted file mode 100644 index 246b5d3de48..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.ts deleted file mode 100644 index df8a31afddf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.json deleted file mode 100644 index 8d383404868..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 27, - "ctxt": 0 - }, - "value": "of", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 35, - "end": 37, - "ctxt": 0 - }, - "value": "of", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.ts deleted file mode 100644 index e824bb34a2a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement20.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES5 -for (var of = 0 in of) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.json deleted file mode 100644 index 40d6072951c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 35, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 28, - "end": 30, - "ctxt": 0 - }, - "value": "of", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.ts deleted file mode 100644 index cc43df1effa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement21.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES5 -for (var of of) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.json deleted file mode 100644 index 8eb8fc7dff6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 29, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.ts deleted file mode 100644 index 26ce0422651..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement3.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var a, b of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.json deleted file mode 100644 index a0189e2cd5f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 30, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.ts deleted file mode 100644 index 771b2246428..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement4.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var a = 1 of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.json deleted file mode 100644 index 5a38be02046..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 47, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 47, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 37, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 37, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 36, - "end": 37, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 44, - "end": 47, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.ts deleted file mode 100644 index ccb6af163c2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement6.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var a = 1, b = 2 of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.json b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.json deleted file mode 100644 index 70352982461..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 64, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 64, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 54, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 34, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 40, - "end": 54, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 49, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 43, - "end": 49, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 52, - "end": 54, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 61, - "end": 64, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.ts b/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.ts deleted file mode 100644 index e5d2ec696ae..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5ForOfStatement7.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES5 -for (var a: number = 1, b: string = "" of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.json b/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.json deleted file mode 100644 index f9bae066485..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 66, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": true, - "span": { - "start": 16, - "end": 66, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 38, - "end": 64, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 38, - "end": 55, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 39, - "end": 54, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 46, - "end": 54, - "ctxt": 0 - }, - "value": "isRegExp", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 55, - "end": 63, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 57, - "end": 63, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.ts b/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.ts deleted file mode 100644 index 9c2a2389a9a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty4.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -declare class C { - [Symbol.isRegExp]: string; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.json b/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.json deleted file mode 100644 index 06cd73841ef..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 58, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 30, - "end": 56, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 30, - "end": 47, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 31, - "end": 46, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 38, - "end": 46, - "ctxt": 0 - }, - "value": "isRegExp", - "optional": false - } - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 47, - "end": 55, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 49, - "end": 55, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.ts b/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.ts deleted file mode 100644 index 656db742443..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserES5SymbolProperty5.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES5 -class C { - [Symbol.isRegExp]: string; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.json deleted file mode 100644 index 286235fd10e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - }, - "body": [ - { - "type": "EmptyStatement", - "span": { - "start": 1, - "end": 2, - "ctxt": 0 - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.ts deleted file mode 100644 index 1c8a0e79762..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEmptyStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnum5.json b/crates/swc_ecma_parser/tests/tsc/parserEnum5.json deleted file mode 100644 index 5679e318cfb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnum5.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 66, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 8, - "ctxt": 0 - }, - "value": "E2", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - } - ] - }, - { - "type": "TsEnumDeclaration", - "span": { - "start": 16, - "end": 33, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 21, - "end": 23, - "ctxt": 0 - }, - "value": "E3", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 26, - "end": 28, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "StringLiteral", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - }, - "init": null - } - ] - }, - { - "type": "TsEnumDeclaration", - "span": { - "start": 34, - "end": 66, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 39, - "end": 41, - "ctxt": 0 - }, - "value": "E1", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 44, - "end": 45, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 47, - "end": 49, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 47, - "end": 48, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "id": { - "type": "StringLiteral", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 53, - "end": 54, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 54, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 56, - "end": 58, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "init": null - }, - { - "type": "TsEnumMember", - "span": { - "start": 59, - "end": 64, - "ctxt": 0 - }, - "id": { - "type": "StringLiteral", - "span": { - "start": 59, - "end": 60, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 63, - "end": 64, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnum5.ts b/crates/swc_ecma_parser/tests/tsc/parserEnum5.ts deleted file mode 100644 index 0e740885595..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnum5.ts +++ /dev/null @@ -1,3 +0,0 @@ -enum E2 { a, } -enum E3 { a: 1, } -enum E1 { a, b: 1, c, d: 2 = 3 } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.json deleted file mode 100644 index 8a1a8e4bd05..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 44, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 44, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 18, - "end": 44, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 22, - "end": 42, - "ctxt": 0 - }, - "declare": true, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [] - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.ts deleted file mode 100644 index 5bb32502768..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration2.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module M { - declare enum E { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.json b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.json deleted file mode 100644 index 2ca7d8a91cd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 20, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 20, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 13, - "end": 18, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.ts b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.ts deleted file mode 100644 index 780b5c12d7b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration3.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -enum E { - A = 1 -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.json b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.json deleted file mode 100644 index 2bb1920ab73..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "body": [ - { - "type": "TsEnumDeclaration", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 10, - "ctxt": 0 - }, - "value": "void", - "optional": false - }, - "members": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.ts b/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.ts deleted file mode 100644 index 0db61ec1034..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserEnumDeclaration4.ts +++ /dev/null @@ -1,2 +0,0 @@ -enum void { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.json b/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.json deleted file mode 100644 index f0781e9d5ea..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.json +++ /dev/null @@ -1,980 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 555, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 555, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 37, - "end": 61, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 37, - "end": 48, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 50, - "end": 59, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 53, - "end": 59, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "Constructor", - "span": { - "start": 66, - "end": 90, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 66, - "end": 77, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 79, - "end": 88, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 79, - "end": 88, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 80, - "end": 88, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 82, - "end": 88, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "Constructor", - "span": { - "start": 95, - "end": 125, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 95, - "end": 106, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 108, - "end": 115, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 108, - "end": 115, - "ctxt": 0 - }, - "value": "ns", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 110, - "end": 115, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 117, - "end": 125, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 131, - "end": 147, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "value": "pgF", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 131, - "end": 147, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 147, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 147, - "end": 148, - "ctxt": 0 - } - }, - { - "type": "ClassProperty", - "span": { - "start": 154, - "end": 164, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "value": "pv", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 169, - "end": 210, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 169, - "end": 210, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 184, - "end": 210, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 194, - "end": 204, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 201, - "end": 203, - "ctxt": 0 - }, - "value": 30.0, - "raw": "30" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 215, - "end": 237, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 226, - "end": 227, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 215, - "end": 237, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 230, - "end": 237, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 243, - "end": 306, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 261, - "end": 263, - "ctxt": 0 - }, - "value": "p2", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 243, - "end": 306, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 266, - "end": 306, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 276, - "end": 300, - "ctxt": 0 - }, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 283, - "end": 299, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 288, - "end": 290, - "ctxt": 0 - }, - "value": 30.0, - "raw": "30" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 295, - "end": 297, - "ctxt": 0 - }, - "value": 40.0, - "raw": "40" - } - } - ] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 312, - "end": 339, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 327, - "end": 329, - "ctxt": 0 - }, - "value": "d2", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 312, - "end": 339, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 332, - "end": 339, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 344, - "end": 400, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 363, - "end": 365, - "ctxt": 0 - }, - "value": "p3", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 344, - "end": 400, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 368, - "end": 400, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 378, - "end": 394, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 385, - "end": 393, - "ctxt": 0 - }, - "value": "string", - "raw": "\"string\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 405, - "end": 417, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 413, - "end": 416, - "ctxt": 0 - }, - "value": "pv3", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 423, - "end": 454, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 431, - "end": 434, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 435, - "end": 444, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 435, - "end": 444, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 436, - "end": 444, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 438, - "end": 444, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 423, - "end": 454, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 445, - "end": 453, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 447, - "end": 453, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 459, - "end": 490, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 467, - "end": 470, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 471, - "end": 480, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 471, - "end": 480, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 472, - "end": 480, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 474, - "end": 480, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 459, - "end": 490, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 481, - "end": 489, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 483, - "end": 489, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 495, - "end": 553, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 503, - "end": 506, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 507, - "end": 514, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 507, - "end": 514, - "ctxt": 0 - }, - "value": "ns", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 509, - "end": 514, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 511, - "end": 514, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 495, - "end": 553, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 516, - "end": 553, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 526, - "end": 547, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 533, - "end": 546, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 533, - "end": 544, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 533, - "end": 535, - "ctxt": 0 - }, - "value": "ns", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 536, - "end": 544, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.ts b/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.ts deleted file mode 100644 index 78e7541beb1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrantSemicolonInClass1.ts +++ /dev/null @@ -1,34 +0,0 @@ -class a { - //constructor (); - constructor (n: number); - constructor (s: string); - constructor (ns: any) { - - } - - public pgF() { }; - - public pv; - public get d() { - return 30; - } - public set d() { - } - - public static get p2() { - return { x: 30, y: 40 }; - } - - private static d2() { - } - private static get p3() { - return "string"; - } - private pv3; - - private foo(n: number): string; - private foo(s: string): string; - private foo(ns: any) { - return ns.toString(); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.json deleted file mode 100644 index ee595f4b029..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 63, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 63, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 15, - "end": 35, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 15, - "end": 17, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 15, - "end": 35, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 20, - "end": 35, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 26, - "end": 31, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "consequent": { - "type": "ExpressionStatement", - "span": { - "start": 26, - "end": 31, - "ctxt": 0 - }, - "expression": { - "type": "Invalid", - "span": { - "start": 26, - "end": 31, - "ctxt": 0 - } - } - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 38, - "end": 48, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 38, - "end": 40, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 48, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 48, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 51, - "end": 61, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 51, - "end": 53, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 51, - "end": 61, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 56, - "end": 61, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.ts deleted file mode 100644 index 9647fe1c4e4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement2.ts +++ /dev/null @@ -1,9 +0,0 @@ -class Foo { - f1() { - if (a - } - f2() { - } - f3() { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.json deleted file mode 100644 index daf0fcddeac..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 65, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 15, - "end": 37, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 15, - "end": 17, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 15, - "end": 37, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 20, - "end": 37, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 26, - "end": 33, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "consequent": { - "type": "ExpressionStatement", - "span": { - "start": 26, - "end": 33, - "ctxt": 0 - }, - "expression": { - "type": "Invalid", - "span": { - "start": 26, - "end": 33, - "ctxt": 0 - } - } - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 40, - "end": 50, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 40, - "end": 42, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 40, - "end": 50, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 45, - "end": 50, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 53, - "end": 63, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 53, - "end": 55, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 53, - "end": 63, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 63, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.ts deleted file mode 100644 index 789265998db..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecoveryIfStatement3.ts +++ /dev/null @@ -1,9 +0,0 @@ -class Foo { - f1() { - if (a.b - } - f2() { - } - f3() { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.json deleted file mode 100644 index 006766e6be3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.ts deleted file mode 100644 index fb3a8255f02..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause2.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A, { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.json deleted file mode 100644 index 78c44846bfd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.ts deleted file mode 100644 index 7fb0e713017..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause4.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A implements { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.json deleted file mode 100644 index 2f4f1375793..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 37, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 37, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeArguments": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.ts deleted file mode 100644 index db22b322547..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause5.ts +++ /dev/null @@ -1,2 +0,0 @@ -class C extends A, implements B, { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.json deleted file mode 100644 index 36de175d399..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.ts deleted file mode 100644 index 89c65ca1c8f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_ExtendsOrImplementsClause6.ts +++ /dev/null @@ -1 +0,0 @@ -interface I extends { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.json b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.json deleted file mode 100644 index 5f126a21f9d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.json +++ /dev/null @@ -1,856 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 14, - "end": 519, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 14, - "end": 57, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 24, - "end": 30, - "ctxt": 0 - }, - "value": "IPoint", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 31, - "end": 57, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 37, - "end": 55, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 37, - "end": 44, - "ctxt": 0 - }, - "value": "getDist", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 46, - "end": 54, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 48, - "end": 54, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 69, - "end": 435, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 76, - "end": 82, - "ctxt": 0 - }, - "value": "Shapes", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 83, - "end": 435, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 103, - "end": 432, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "Point", - "optional": false - }, - "declare": false, - "span": { - "start": 110, - "end": 432, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 151, - "end": 163, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - }, - "value": "con", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 164, - "end": 172, - "ctxt": 0 - }, - "key": { - "type": "StringLiteral", - "span": { - "start": 164, - "end": 171, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 204, - "end": 256, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 215, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 217, - "end": 233, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 224, - "end": 233, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 225, - "end": 233, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 227, - "end": 233, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "TsParameterProperty", - "span": { - "start": 235, - "end": 251, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 242, - "end": 251, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 243, - "end": 251, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 245, - "end": 251, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 293, - "end": 359, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 293, - "end": 300, - "ctxt": 0 - }, - "value": "getDist", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 293, - "end": 359, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 303, - "end": 359, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 305, - "end": 357, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 312, - "end": 356, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 312, - "end": 316, - "ctxt": 0 - }, - "value": "Math", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 317, - "end": 321, - "ctxt": 0 - }, - "value": "sqrt", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 322, - "end": 355, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 322, - "end": 337, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "MemberExpression", - "span": { - "start": 322, - "end": 328, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 322, - "end": 326, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 331, - "end": 335, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 336, - "end": 337, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 340, - "end": 355, - "ctxt": 0 - }, - "operator": "*", - "left": { - "type": "MemberExpression", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 340, - "end": 344, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 345, - "end": 346, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 349, - "end": 355, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 394, - "end": 426, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 401, - "end": 407, - "ctxt": 0 - }, - "value": "origin", - "optional": false - }, - "value": { - "type": "NewExpression", - "span": { - "start": 410, - "end": 425, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 414, - "end": 419, - "ctxt": 0 - }, - "value": "Point", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 420, - "end": 421, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 423, - "end": 424, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ], - "typeArguments": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "value": "IPoint", - "optional": false - }, - "typeArguments": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 456, - "end": 495, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 460, - "end": 494, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 460, - "end": 461, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 461, - "end": 469, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "value": "IPoint", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "NewExpression", - "span": { - "start": 472, - "end": 494, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 476, - "end": 488, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 476, - "end": 482, - "ctxt": 0 - }, - "value": "Shapes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 483, - "end": 488, - "ctxt": 0 - }, - "value": "Point", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 492, - "end": 493, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 496, - "end": 519, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 500, - "end": 518, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 500, - "end": 504, - "ctxt": 0 - }, - "value": "dist", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 507, - "end": 518, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 507, - "end": 516, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 507, - "end": 508, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 509, - "end": 516, - "ctxt": 0 - }, - "value": "getDist", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.ts b/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.ts deleted file mode 100644 index d754d451df3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserErrorRecovery_IncompleteMemberVariable2.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Interface -interface IPoint { - getDist(): number; -} - -// Module -module Shapes { - - // Class - export class Point implements IPoint { - - public con:C "hello"; - // Constructor - constructor (public x: number, public y: number) { } - - // Instance member - getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - - // Static member - static origin = new Point(0, 0); - } - -} - -// Local variables -var p: IPoint = new Shapes.Point(3, 4); -var dist = p.getDist(); diff --git a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.json b/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.json deleted file mode 100644 index 9bbaf1e5dd9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 8, - "end": 9, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 10, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "TsExportAssignment", - "span": { - "start": 16, - "end": 27, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.ts b/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.ts deleted file mode 100644 index b8e59568568..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment5.ts +++ /dev/null @@ -1,3 +0,0 @@ -module M { - export = A; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.json b/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.json deleted file mode 100644 index d42ab4e2c5e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 78, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 14, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 15, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultExpression", - "span": { - "start": 19, - "end": 38, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 42, - "end": 78, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 53, - "end": 78, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultExpression", - "span": { - "start": 57, - "end": 76, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.ts b/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.ts deleted file mode 100644 index 6940b150b08..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExportAssignment9.ts +++ /dev/null @@ -1,7 +0,0 @@ -namespace Foo { - export default foo; -} - -module Bar { - export default bar; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.json deleted file mode 100644 index 1fcef1a2fcb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1, - "end": 6, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.ts deleted file mode 100644 index a6aeccb1944..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserExpressionStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -Foo(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.json deleted file mode 100644 index 9e7a5a175f5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 11, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.ts deleted file mode 100644 index 30d04824dd1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var i in e) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.json deleted file mode 100644 index 08247c833c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 9, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 16, - "end": 19, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.ts deleted file mode 100644 index 1036ece5a53..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement2.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var in X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.json deleted file mode 100644 index 62e3fd3067b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 14, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.ts deleted file mode 100644 index 5c27d236d47..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement3.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var a, b in X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.json deleted file mode 100644 index 8aae44c0e77..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 25, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 25, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 15, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 15, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 14, - "end": 15, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 22, - "end": 25, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.ts deleted file mode 100644 index c954463f613..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement4.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var a = 1 in X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.json deleted file mode 100644 index 4badd7ff0ee..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 22, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 15, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 14, - "end": 15, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 17, - "end": 22, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 17, - "end": 18, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.ts deleted file mode 100644 index 0fdc153541d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement6.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var a = 1, b = 2 in X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.json b/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.json deleted file mode 100644 index 53cbfd76419..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 49, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 1, - "end": 49, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 39, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 10, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 10, - "end": 11, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 11, - "end": 19, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 13, - "end": 19, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 39, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 34, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 37, - "end": 39, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.ts b/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.ts deleted file mode 100644 index d4cdf1e74a3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForInStatement7.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (var a: number = 1, b: string = "" in X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.json deleted file mode 100644 index ce5b95a51a5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 36, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 26, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.ts deleted file mode 100644 index 96ced8333c3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement1.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var i of e) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.json deleted file mode 100644 index 246b5d3de48..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 34, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.ts deleted file mode 100644 index 6d61b843780..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.json deleted file mode 100644 index 8d383404868..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "body": [ - { - "type": "ForInStatement", - "span": { - "start": 16, - "end": 42, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 27, - "ctxt": 0 - }, - "value": "of", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 35, - "end": 37, - "ctxt": 0 - }, - "value": "of", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.ts deleted file mode 100644 index 7342df0b56f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement20.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -for (var of = 0 in of) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.json deleted file mode 100644 index 40d6072951c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 35, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - }, - "right": { - "type": "Identifier", - "span": { - "start": 28, - "end": 30, - "ctxt": 0 - }, - "value": "of", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.ts deleted file mode 100644 index 587fc4b8310..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement21.ts +++ /dev/null @@ -1,2 +0,0 @@ -//@target: ES6 -for (var of of) { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.json deleted file mode 100644 index c55404d3797..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 56, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 31, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "value": "async", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ForOfStatement", - "span": { - "start": 32, - "end": 56, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "Identifier", - "span": { - "start": 37, - "end": 42, - "ctxt": 0 - }, - "value": "async", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ArrayExpression", - "span": { - "start": 46, - "end": 52, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 47, - "end": 48, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 54, - "end": 56, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.ts deleted file mode 100644 index 9da24a97d67..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement22.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: esnext - -var async; -for (async of [1, 2]) {} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.json deleted file mode 100644 index 8eb8fc7dff6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 39, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 29, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.ts deleted file mode 100644 index 0356b933ad1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement3.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var a, b of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.json deleted file mode 100644 index a0189e2cd5f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 40, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 30, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 34, - "end": 35, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.ts deleted file mode 100644 index 33dbc47f71b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement4.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var a = 1 of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.json deleted file mode 100644 index 5a38be02046..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 47, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 47, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 37, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 37, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 36, - "end": 37, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 44, - "end": 47, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.ts deleted file mode 100644 index c79f4eb9839..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement6.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var a = 1, b = 2 of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.json b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.json deleted file mode 100644 index 70352982461..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 64, - "ctxt": 0 - }, - "body": [ - { - "type": "ForOfStatement", - "span": { - "start": 16, - "end": 64, - "ctxt": 0 - }, - "await": null, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 54, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 25, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 25, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 26, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 28, - "end": 34, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 40, - "end": 54, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 40, - "end": 41, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 41, - "end": 49, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 43, - "end": 49, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 52, - "end": 54, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "definite": false - } - ] - }, - "right": { - "type": "Identifier", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 61, - "end": 64, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.ts b/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.ts deleted file mode 100644 index 2a579881a88..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForOfStatement7.ts +++ /dev/null @@ -1,3 +0,0 @@ -//@target: ES6 -for (var a: number = 1, b: string = "" of X) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.json deleted file mode 100644 index b354343a9bc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "body": [ - { - "type": "ForStatement", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "init": null, - "test": null, - "update": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 10, - "end": 13, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.ts deleted file mode 100644 index 902225ba448..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserForStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -for (;;) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.json b/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.json deleted file mode 100644 index e031ee181d9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 45, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 18, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 22, - "end": 43, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.ts deleted file mode 100644 index 614d1d5877c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration1.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module M { - declare function F(); -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.ts b/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.ts deleted file mode 100644 index df7da613971..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -function F() { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.json deleted file mode 100644 index e682dd1d8f6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 24, - "end": 27, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.ts deleted file mode 100644 index 41a293898f3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserFunctionDeclaration2.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function Foo() { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.json b/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.json deleted file mode 100644 index 4f421c3b7a2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 47, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 47, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 29, - "end": 45, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 29, - "end": 45, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 42, - "end": 45, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.ts b/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.ts deleted file mode 100644 index 66304fa9106..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserGetAccessorWithTypeParameters1.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - get foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.json deleted file mode 100644 index bf4824a9e81..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "body": [ - { - "type": "IfStatement", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 5, - "end": 8, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 10, - "end": 13, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.ts deleted file mode 100644 index e3e3ca4246d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIfStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -if (foo) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.json b/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.json deleted file mode 100644 index 6ab00efbca8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 50, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 50, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 29, - "end": 38, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 30, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 32, - "end": 38, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 47, - "ctxt": 0 - }, - "kind": "string" - } - }, - "readonly": false, - "static": true, - "span": { - "start": 14, - "end": 48, - "ctxt": 0 - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.ts deleted file mode 100644 index af7b0aa28ae..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexMemberDeclaration10.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - static static [x: string]: string; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.json deleted file mode 100644 index ef0d2468771..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 13, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 19, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 20, - "end": 23, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 24, - "end": 32, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 26, - "end": 32, - "ctxt": 0 - }, - "kind": "number" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 18, - "end": 32, - "ctxt": 0 - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.ts deleted file mode 100644 index e25aabcd8c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature10.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface I { - [a, b]: number -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.json deleted file mode 100644 index 64c6154974f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 79, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 13, - "end": 79, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 17, - "end": 24, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "AssignmentExpression", - "span": { - "start": 18, - "end": 23, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.ts deleted file mode 100644 index 8468742a82b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature4.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface I { - [a = 0] // Used to be indexer, now it is a computed property -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.json deleted file mode 100644 index 4737fef2a03..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 75, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 75, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 13, - "end": 75, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 17, - "end": 20, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.ts deleted file mode 100644 index 0a992dd3a83..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature5.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface I { - [a] // Used to be indexer, now it is a computed property -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.json deleted file mode 100644 index 4f7cae72553..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 30, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 30, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 13, - "end": 30, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 18, - "end": 27, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 19, - "end": 27, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 20, - "end": 27, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - ], - "typeAnnotation": null, - "readonly": false, - "static": false, - "span": { - "start": 17, - "end": 28, - "ctxt": 0 - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.ts deleted file mode 100644 index 8448e54dcd6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature6.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface I { - [a:boolean] -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.json deleted file mode 100644 index 895c476a465..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 13, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 18, - "end": 26, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 19, - "end": 26, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 20, - "end": 26, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": null, - "readonly": false, - "static": false, - "span": { - "start": 17, - "end": 27, - "ctxt": 0 - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.ts deleted file mode 100644 index 5cc7bd9d8c3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature7.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface I { - [a:string] -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.json b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.json deleted file mode 100644 index 29764e9f80b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 84, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 28, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 27, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 8, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 8, - "end": 27, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 10, - "end": 27, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 13, - "end": 23, - "ctxt": 0 - }, - "value": "index", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 18, - "end": 23, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 20, - "end": 23, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "typeAnnotation": null, - "readonly": false, - "static": false, - "span": { - "start": 12, - "end": 25, - "ctxt": 0 - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 53, - "end": 84, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 57, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 61, - "ctxt": 0 - }, - "value": "foo2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 61, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 63, - "end": 83, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 66, - "end": 79, - "ctxt": 0 - }, - "value": "index", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 71, - "end": 79, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 73, - "end": 79, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 73, - "end": 79, - "ctxt": 0 - }, - "value": "RegExp", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeAnnotation": null, - "readonly": false, - "static": false, - "span": { - "start": 65, - "end": 81, - "ctxt": 0 - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.ts b/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.ts deleted file mode 100644 index aba7e2006f8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserIndexSignature8.ts +++ /dev/null @@ -1,2 +0,0 @@ -var foo: { [index: any]; }; // expect an error here -var foo2: { [index: RegExp]; }; // expect an error here diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.json b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.json deleted file mode 100644 index 0d498e8e6f6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 36, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.ts deleted file mode 100644 index 1101181487a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration1.ts +++ /dev/null @@ -1,2 +0,0 @@ -interface I extends A extends B { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.json b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.json deleted file mode 100644 index 23a8a843ad1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 20, - "end": 23, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.ts b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.ts deleted file mode 100644 index 39f1b251fb2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration3.ts +++ /dev/null @@ -1,2 +0,0 @@ -public interface I { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.json b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.json deleted file mode 100644 index 23a8a843ad1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 23, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 20, - "end": 23, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.ts b/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.ts deleted file mode 100644 index 61b8cf1e420..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserInterfaceDeclaration4.ts +++ /dev/null @@ -1,2 +0,0 @@ -static interface I { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.json deleted file mode 100644 index 3d631881b7c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "body": { - "type": "ExpressionStatement", - "span": { - "start": 8, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 8, - "end": 11, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.ts deleted file mode 100644 index fe24e3e2c0e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserLabeledStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -foo: - bar(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.json deleted file mode 100644 index 3e0d887531d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 55, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1, - "end": 9, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "arguments": [], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 4, - "end": 7, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 11, - "end": 24, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 11, - "end": 23, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 11, - "end": 18, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 11, - "end": 14, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 15, - "end": 18, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - }, - "arguments": [], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 25, - "end": 38, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 25, - "end": 37, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 25, - "end": 35, - "ctxt": 0 - }, - "object": { - "type": "TsInstantiation", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 28, - "end": 31, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 29, - "end": 30, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 39, - "end": 55, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 39, - "end": 54, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 39, - "end": 49, - "ctxt": 0 - }, - "object": { - "type": "TsInstantiation", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 42, - "end": 45, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - }, - "arguments": [], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.ts deleted file mode 100644 index 5f222b40a3b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessExpression1.ts +++ /dev/null @@ -1,4 +0,0 @@ -Foo(); -Foo.Bar(); -Foo.Bar(); -Foo.Bar(); diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.json deleted file mode 100644 index 4bc1eac6641..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 33, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 9, - "end": 33, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 9, - "end": 31, - "ctxt": 0 - }, - "object": { - "type": "TsInstantiation", - "span": { - "start": 9, - "end": 21, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 9, - "end": 13, - "ctxt": 0 - }, - "value": "List", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 13, - "end": 21, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 14, - "end": 20, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 22, - "end": 31, - "ctxt": 0 - }, - "value": "makeChild", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.ts deleted file mode 100644 index 8b1319a181e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessOffOfGenericType1.ts +++ /dev/null @@ -1 +0,0 @@ -var v = List.makeChild(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.json deleted file mode 100644 index 38511acd8bf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 54, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 54, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 31, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 43, - "end": 46, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 31, - "end": 52, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.ts deleted file mode 100644 index a92e2c6ca78..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration11.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - declare get Foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.json deleted file mode 100644 index 784f8fd7126..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 54, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 54, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 47, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 47, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 47, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 52, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.ts deleted file mode 100644 index ac4f54469a9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration12.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - get Foo(a: number) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.json deleted file mode 100644 index 1e5208f8c2e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 45, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 45, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 43, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 30, - "end": 43, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 40, - "end": 43, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.ts deleted file mode 100644 index 6755f426e3b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration13.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set Foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.json deleted file mode 100644 index a45a9d6c001..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 65, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 63, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 47, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 47, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 47, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 50, - "end": 58, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 52, - "end": 58, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 63, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 60, - "end": 63, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.ts deleted file mode 100644 index b0dc57ccf85..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration14.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set Foo(a: number, b: number) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.json deleted file mode 100644 index ad08075f304..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 50, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 50, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 48, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 43, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 38, - "end": 43, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 42, - "end": 43, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 48, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.ts deleted file mode 100644 index 827fcdc8a98..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration16.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set Foo(a = 1) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.json deleted file mode 100644 index 6302bbc46cd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 55, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 55, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 53, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 48, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 48, - "ctxt": 0 - }, - "value": "a", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 40, - "end": 48, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 42, - "end": 48, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 53, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 50, - "end": 53, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.ts deleted file mode 100644 index 23938d43c40..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration17.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set Foo(a?: number) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.json deleted file mode 100644 index aca15d08087..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 49, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 49, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 47, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 42, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 38, - "end": 42, - "ctxt": 0 - }, - "rest": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 47, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 44, - "end": 47, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.ts deleted file mode 100644 index adc9df869a5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration18.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set Foo(...a) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.json b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.json deleted file mode 100644 index c3a51683837..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 60, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 60, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 31, - "end": 58, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 31, - "end": 58, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 55, - "end": 58, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.ts deleted file mode 100644 index bf0ce75e31a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberAccessorDeclaration8.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - static static get Foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.json deleted file mode 100644 index 925a445d576..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 15, - "end": 38, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 15, - "end": 38, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.ts deleted file mode 100644 index 1a7ecbcc926..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration2.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - static static Foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.json b/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.json deleted file mode 100644 index 88722a079e9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 34, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 15, - "end": 32, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 23, - "end": 26, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 15, - "end": 32, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.ts deleted file mode 100644 index def788266d2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberFunctionDeclaration5.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - declare Foo() { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.json b/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.json deleted file mode 100644 index f7728bbfe5d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 13, - "end": 31, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 27, - "end": 30, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.ts b/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.ts deleted file mode 100644 index 333c58f75ba..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserMemberVariableDeclaration2.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - static static Foo; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.json b/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.json deleted file mode 100644 index 3e6db987b9d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "BlockStatement", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 6, - "end": 27, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 18, - "end": 26, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 18, - "end": 19, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ThisExpression", - "span": { - "start": 22, - "end": 26, - "ctxt": 0 - } - }, - "definite": false - } - ] - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.ts b/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.ts deleted file mode 100644 index 82882f9e75e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModifierOnStatementInBlock2.ts +++ /dev/null @@ -1,3 +0,0 @@ -{ - declare var x = this; -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.json deleted file mode 100644 index be28395f339..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "value": "Foo", - "raw": "\"Foo\"" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 14, - "end": 17, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.ts deleted file mode 100644 index 9064a5a3537..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -module "Foo" { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.json deleted file mode 100644 index be28395f339..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "value": "Foo", - "raw": "\"Foo\"" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 14, - "end": 17, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.ts deleted file mode 100644 index 9064a5a3537..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration1.ts +++ /dev/null @@ -1,2 +0,0 @@ -module "Foo" { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.json deleted file mode 100644 index bd5a61d26cc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 8, - "end": 9, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 10, - "end": 13, - "ctxt": 0 - }, - "body": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.ts deleted file mode 100644 index d01d5bcfe1e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration2.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -module M { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.json deleted file mode 100644 index 03e962db199..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 47, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 47, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 18, - "end": 47, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 22, - "end": 45, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 39, - "ctxt": 0 - }, - "value": "M2", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 40, - "end": 45, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.ts deleted file mode 100644 index 25c181c5b0e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration3.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module M { - declare module M2 { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.json deleted file mode 100644 index 9942b1639bf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 8, - "end": 9, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 10, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 14, - "end": 37, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 29, - "end": 31, - "ctxt": 0 - }, - "value": "M1", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 32, - "end": 37, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.ts deleted file mode 100644 index 9861a07ccb0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration4.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -module M { - declare module M1 { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.json b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.json deleted file mode 100644 index 0286fe24124..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 70, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 70, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 8, - "end": 10, - "ctxt": 0 - }, - "value": "M1", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 11, - "end": 70, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 15, - "end": 68, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 30, - "end": 32, - "ctxt": 0 - }, - "value": "M2", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 33, - "end": 68, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 64, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 56, - "ctxt": 0 - }, - "value": "M3", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 57, - "end": 64, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.ts b/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.ts deleted file mode 100644 index a8d361b389c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserModuleDeclaration5.ts +++ /dev/null @@ -1,6 +0,0 @@ -module M1 { - declare module M2 { - declare module M3 { - } - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.json b/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.json deleted file mode 100644 index 6c13734646a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 3, - "end": 122, - "ctxt": 0 - }, - "body": [ - { - "type": "IfStatement", - "span": { - "start": 3, - "end": 122, - "ctxt": 0 - }, - "test": { - "type": "CallExpression", - "span": { - "start": 7, - "end": 24, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 7, - "end": 16, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 9, - "end": 16, - "ctxt": 0 - }, - "value": "indexOf", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 17, - "end": 23, - "ctxt": 0 - }, - "operator": "-", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 18, - "end": 23, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "operator": "/", - "left": { - "type": "NumericLiteral", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - } - } - } - ], - "typeArguments": null - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 100, - "end": 122, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 106, - "end": 118, - "ctxt": 0 - }, - "argument": { - "type": "BooleanLiteral", - "span": { - "start": 113, - "end": 117, - "ctxt": 0 - }, - "value": true - } - } - ] - }, - "alternate": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.ts b/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.ts deleted file mode 100644 index 5e079d8da1f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserNotRegex1.ts +++ /dev/null @@ -1,4 +0,0 @@ - if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment. - { - return true; - } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList1.json b/crates/swc_ecma_parser/tests/tsc/parserParameterList1.json deleted file mode 100644 index de9c4a43d14..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList1.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 30, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 30, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 14, - "end": 28, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 14, - "end": 15, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "rest": { - "start": 16, - "end": 19, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "A", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "B", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 14, - "end": 28, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList1.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList1.ts deleted file mode 100644 index 185b154e78c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList1.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - F(...A, B) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList10.json b/crates/swc_ecma_parser/tests/tsc/parserParameterList10.json deleted file mode 100644 index dbab9e2381c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList10.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 14, - "end": 33, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 14, - "end": 17, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 18, - "end": 28, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 18, - "end": 28, - "ctxt": 0 - }, - "rest": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "argument": { - "type": "AssignmentPattern", - "span": { - "start": 18, - "end": 28, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "value": "bar", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 14, - "end": 33, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList10.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList10.ts deleted file mode 100644 index eecd4e29b8d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList10.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - foo(...bar = 0) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList11.json b/crates/swc_ecma_parser/tests/tsc/parserParameterList11.json deleted file mode 100644 index 4bd115788b6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList11.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "params": [ - { - "type": "RestElement", - "span": { - "start": 2, - "end": 9, - "ctxt": 0 - }, - "rest": { - "start": 2, - "end": 5, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 5, - "end": 8, - "ctxt": 0 - }, - "value": "arg", - "optional": true, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "body": { - "type": "NumericLiteral", - "span": { - "start": 14, - "end": 17, - "ctxt": 0 - }, - "value": 102.0, - "raw": "102" - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList11.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList11.ts deleted file mode 100644 index 05f378f963b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList11.ts +++ /dev/null @@ -1 +0,0 @@ -(...arg?) => 102; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList2.json b/crates/swc_ecma_parser/tests/tsc/parserParameterList2.json deleted file mode 100644 index 169fc4b8b4e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList2.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 13, - "end": 25, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 13, - "end": 14, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 15, - "end": 20, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "AssignmentPattern", - "span": { - "start": 15, - "end": 20, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "A", - "optional": true, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 13, - "end": 25, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 22, - "end": 25, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList2.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList2.ts deleted file mode 100644 index 08917977f85..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList2.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - F(A?= 0) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList3.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList3.ts deleted file mode 100644 index c6401668519..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList3.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - F(A?, B) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList9.json b/crates/swc_ecma_parser/tests/tsc/parserParameterList9.json deleted file mode 100644 index 64ad6b69e6f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList9.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 14, - "end": 30, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 14, - "end": 17, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 18, - "end": 25, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 18, - "end": 24, - "ctxt": 0 - }, - "rest": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "value": "bar", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 14, - "end": 30, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 27, - "end": 30, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserParameterList9.ts b/crates/swc_ecma_parser/tests/tsc/parserParameterList9.ts deleted file mode 100644 index e23b15822cc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserParameterList9.ts +++ /dev/null @@ -1,3 +0,0 @@ -class C { - foo(...bar?) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.json b/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.json deleted file mode 100644 index 398c8261f60..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 46, - "ctxt": 0 - }, - "body": [ - { - "type": "ReturnStatement", - "span": { - "start": 1, - "end": 46, - "ctxt": 0 - }, - "argument": { - "type": "RegExpLiteral", - "span": { - "start": 8, - "end": 45, - "ctxt": 0 - }, - "pattern": "(#?-?\\d*\\.\\d\\w*%?)|(@?#?[\\w-?]+%?)", - "flags": "g" - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.ts b/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.ts deleted file mode 100644 index 456e62f4696..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserRegularExpression1.ts +++ /dev/null @@ -1 +0,0 @@ -return /(#?-?\d*\.\d\w*%?)|(@?#?[\w-?]+%?)/g; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserRegularExpressionDivideAmbiguity3.json b/crates/swc_ecma_parser/tests/tsc/parserRegularExpressionDivideAmbiguity3.json deleted file mode 100644 index 78b4095930b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserRegularExpressionDivideAmbiguity3.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 0, - "end": 23, - "ctxt": 0 - }, - "body": [ - { - "type": "IfStatement", - "span": { - "start": 0, - "end": 23, - "ctxt": 0 - }, - "test": { - "type": "NumericLiteral", - "span": { - "start": 4, - "end": 5, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "consequent": { - "type": "ExpressionStatement", - "span": { - "start": 7, - "end": 23, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 7, - "end": 22, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 7, - "end": 20, - "ctxt": 0 - }, - "object": { - "type": "RegExpLiteral", - "span": { - "start": 7, - "end": 16, - "ctxt": 0 - }, - "pattern": "regexp", - "flags": "a" - }, - "property": { - "type": "Identifier", - "span": { - "start": 17, - "end": 20, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "alternate": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.json deleted file mode 100644 index 6e93005f48c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "body": [ - { - "type": "ReturnStatement", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "argument": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.ts deleted file mode 100644 index 699755fe912..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -return; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.json b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.json deleted file mode 100644 index 6e93005f48c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "body": [ - { - "type": "ReturnStatement", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "argument": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.ts b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.ts deleted file mode 100644 index 699755fe912..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement1.ts +++ /dev/null @@ -1 +0,0 @@ -return; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.json b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.json deleted file mode 100644 index c2dc5e37fd4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "body": [ - { - "type": "BlockStatement", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 6, - "end": 13, - "ctxt": 0 - }, - "argument": null - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.ts deleted file mode 100644 index 73437f47658..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserReturnStatement2.ts +++ /dev/null @@ -1,3 +0,0 @@ -{ - return; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserS7.2_A1.5_T2.ts b/crates/swc_ecma_parser/tests/tsc/parserS7.2_A1.5_T2.ts index e4635e69710..23215cb5751 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserS7.2_A1.5_T2.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserS7.2_A1.5_T2.ts @@ -1,4 +1,4 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** diff --git a/crates/swc_ecma_parser/tests/tsc/parserS7.6_A4.2_T1.ts b/crates/swc_ecma_parser/tests/tsc/parserS7.6_A4.2_T1.ts index e588b8c1578..15392475354 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserS7.6_A4.2_T1.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserS7.6_A4.2_T1.ts @@ -1,4 +1,4 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** diff --git a/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.json b/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.json deleted file mode 100644 index 4c7fdc2b443..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 518, - "end": 548, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 518, - "end": 531, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 522, - "end": 525, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 522, - "end": 523, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 524, - "end": 525, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 527, - "end": 530, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 527, - "end": 528, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 529, - "end": 530, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 532, - "end": 540, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 536, - "end": 540, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 541, - "end": 548, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 541, - "end": 548, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UpdateExpression", - "span": { - "start": 544, - "end": 548, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 547, - "end": 548, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.ts b/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.ts deleted file mode 100644 index 696ba3c323a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserS7.9_A5.7_T1.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/** - * Since LineTerminator(LT) between Postfix Increment/Decrement Operator(I/DO) and operand is not allowed, two IO(just as two DO and their combination) - * between two references separated by [LT] after automatic semicolon insertion lead to syntax error - * - * @path ch07/7.9/S7.9_A5.7_T1.js - * @description Try use Variable1 \n ++ \n ++ \n Variable2 construction - * @negative - */ - -var x=0, y=0; -var z= -x -++ -++ -y - diff --git a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.json b/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.json deleted file mode 100644 index 2c829571638..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 57, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 57, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 55, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 55, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 55, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 40, - "end": 48, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 42, - "end": 48, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.ts b/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.ts deleted file mode 100644 index a48ae3fdfb9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeAnnotation1.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es5 -class C { - set foo(v): number { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.json b/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.json deleted file mode 100644 index a7301cae303..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 49, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 49, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 30, - "end": 47, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 30, - "end": 47, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 44, - "end": 47, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.ts b/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.ts deleted file mode 100644 index 8381f078b8d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSetAccessorWithTypeParameters1.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @target: es5 -class C { - set foo(v) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.json b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.json deleted file mode 100644 index 32cd81cbba4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 14, - "end": 110, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 26, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 27, - "end": 61, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 27, - "end": 61, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 30, - "end": 61, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 32, - "end": 61, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 34, - "end": 48, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 47, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 49, - "end": 59, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 49, - "end": 51, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 53, - "end": 59, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 14, - "end": 66, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 63, - "end": 66, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 67, - "end": 89, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 71, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 75, - "ctxt": 0 - }, - "value": "name", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 75, - "end": 79, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 81, - "end": 88, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 81, - "end": 83, - "ctxt": 0 - }, - "value": "id", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 83, - "end": 88, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 85, - "end": 88, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 90, - "end": 110, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 90, - "end": 109, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 94, - "end": 108, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 96, - "end": 100, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 103, - "end": 105, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - ] - } - } - ], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.ts b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.ts deleted file mode 100644 index 1a6e19a16cd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment1.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @lib: es5 -function foo(obj: { name?: string; id: number }) { } -var name:any, id: any; -foo({ name?, id? }); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.json b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.json deleted file mode 100644 index a3684028dd9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 19, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 18, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 9, - "end": 18, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 11, - "end": 16, - "ctxt": 0 - }, - "value": "class", - "optional": false - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.ts b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.ts deleted file mode 100644 index ca28c05016b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment2.ts +++ /dev/null @@ -1 +0,0 @@ -var v = { class }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.json b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.json deleted file mode 100644 index 1c5a80971b2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 15, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 9, - "end": 15, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 11, - "end": 13, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - }, - "value": { - "type": "Invalid", - "span": { - "start": 11, - "end": 13, - "ctxt": 0 - } - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.ts b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.ts deleted file mode 100644 index de2a94b194e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment3.ts +++ /dev/null @@ -1 +0,0 @@ -var v = { "" }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.json b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.json deleted file mode 100644 index 4048e7aa620..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 14, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 9, - "end": 14, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "NumericLiteral", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "value": { - "type": "Invalid", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - } - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.ts b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.ts deleted file mode 100644 index 5479b23b32b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment4.ts +++ /dev/null @@ -1 +0,0 @@ -var v = { 0 }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.json b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.json deleted file mode 100644 index 2acb3e13269..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 43, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 21, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 20, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 10, - "ctxt": 0 - }, - "value": "greet", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 13, - "end": 20, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 22, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 26, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 29, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 32, - "end": 42, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 34, - "end": 39, - "ctxt": 0 - }, - "value": "greet", - "optional": false - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.ts b/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.ts deleted file mode 100644 index f25e3ddbc57..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserShorthandPropertyAssignment5.ts +++ /dev/null @@ -1,2 +0,0 @@ -var greet = "hello"; -var obj = { greet? }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.json b/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.json deleted file mode 100644 index 415af31e118..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 145, - "ctxt": 0 - }, - "body": [ - { - "type": "ReturnStatement", - "span": { - "start": 1, - "end": 145, - "ctxt": 0 - }, - "argument": { - "type": "ObjectExpression", - "span": { - "start": 8, - "end": 144, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 13, - "end": 18, - "ctxt": 0 - }, - "value": "set", - "raw": "\"set\"" - }, - "value": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "value": "key", - "optional": false, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 35, - "end": 40, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 35, - "end": 40, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 20, - "end": 141, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 42, - "end": 141, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 115, - "end": 136, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 115, - "end": 135, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 115, - "end": 127, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 115, - "end": 122, - "ctxt": 0 - }, - "value": "private", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 123, - "end": 126, - "ctxt": 0 - }, - "value": "key", - "optional": false - } - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 130, - "end": 135, - "ctxt": 0 - }, - "value": "value", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.ts b/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.ts deleted file mode 100644 index 8b81fb098ee..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStatementIsNotAMemberVariableDeclaration1.ts +++ /dev/null @@ -1,10 +0,0 @@ -return { - - "set": function (key, value) { - - // 'private' should not be considered a member variable here. - private[key] = value; - - } - -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.json deleted file mode 100644 index cbd5deb181f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 35, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 26, - "end": 30, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 26, - "end": 30, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 15, - "end": 35, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.ts deleted file mode 100644 index 70881e97353..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode10.ts +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -function f(eval) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.json deleted file mode 100644 index 970ed918d0b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 44, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 15, - "end": 44, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 19, - "end": 43, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 32, - "end": 33, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 23, - "end": 43, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 40, - "end": 43, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.ts deleted file mode 100644 index 7888be785e7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode11.ts +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -var v = function f(eval) { -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.json deleted file mode 100644 index 7f412bac54b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 60, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 17, - "end": 30, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 17, - "end": 29, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 31, - "end": 60, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 35, - "end": 60, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 39, - "end": 60, - "ctxt": 0 - }, - "properties": [ - { - "type": "SetterProperty", - "span": { - "start": 41, - "end": 58, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 45, - "end": 48, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 49, - "end": 53, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 55, - "end": 58, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.ts deleted file mode 100644 index 5a1baa480d6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode12.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @target: ES5 -"use strict"; -var v = { set foo(eval) { } } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.json deleted file mode 100644 index cfce379924d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "TryStatement", - "span": { - "start": 15, - "end": 38, - "ctxt": 0 - }, - "block": { - "type": "BlockStatement", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "stmts": [] - }, - "handler": { - "type": "CatchClause", - "span": { - "start": 23, - "end": 38, - "ctxt": 0 - }, - "param": { - "type": "Identifier", - "span": { - "start": 29, - "end": 33, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "stmts": [] - } - }, - "finalizer": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.ts deleted file mode 100644 index a284e353df1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode13.ts +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -try { -} -catch(eval) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.json deleted file mode 100644 index 4d393a0a819..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "WithStatement", - "span": { - "start": 15, - "end": 27, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 21, - "end": 22, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 24, - "end": 27, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.ts deleted file mode 100644 index ef6862889c7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode14.ts +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -with (a) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.json deleted file mode 100644 index 8e7a7d35416..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 15, - "end": 23, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.ts deleted file mode 100644 index 620010141d9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode15.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -delete a; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.json deleted file mode 100644 index a41d7af6e67..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 48, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 22, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 15, - "end": 21, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 15, - "end": 19, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 23, - "end": 30, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 23, - "end": 29, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 23, - "end": 27, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 31, - "end": 38, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 31, - "end": 35, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 39, - "end": 48, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 39, - "end": 47, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "value": "static", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.ts deleted file mode 100644 index 079a2d93221..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode2.ts +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -foo1(); -foo1(); -foo1(); -static(); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.json deleted file mode 100644 index 5cbc5555276..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 24, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 15, - "end": 23, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 15, - "end": 19, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.ts deleted file mode 100644 index 7abb04deb46..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode3.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -eval = 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.json deleted file mode 100644 index cf6886377cf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 29, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 29, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 15, - "end": 28, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "value": "arguments", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.ts deleted file mode 100644 index ff5f8932edf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode4.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -arguments = 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.json deleted file mode 100644 index 213b057f33c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 25, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 25, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 15, - "end": 24, - "ctxt": 0 - }, - "operator": "+=", - "left": { - "type": "Identifier", - "span": { - "start": 15, - "end": 19, - "ctxt": 0 - }, - "value": "eval", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.ts deleted file mode 100644 index 238300bbe29..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode5.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -eval += 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.json deleted file mode 100644 index 2540a6f01d9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 22, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 22, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 15, - "end": 21, - "ctxt": 0 - }, - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "span": { - "start": 15, - "end": 19, - "ctxt": 0 - }, - "value": "eval", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.ts deleted file mode 100644 index 8caab6e9695..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode6.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -eval++; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.json deleted file mode 100644 index 658876f7aa6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 22, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 15, - "end": 22, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 15, - "end": 21, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "Identifier", - "span": { - "start": 17, - "end": 21, - "ctxt": 0 - }, - "value": "eval", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.ts deleted file mode 100644 index d28e9bcdbf7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode7.ts +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -++eval; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.json deleted file mode 100644 index de6d4e41021..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 32, - "end": 65, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 32, - "end": 45, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 32, - "end": 44, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "value": "eval", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 46, - "end": 65, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.ts deleted file mode 100644 index 84c10a615ab..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode8.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @skipDefaultLibCheck: false -"use strict"; -function eval() { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.json b/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.json deleted file mode 100644 index 096312ab965..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 43, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "value": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 15, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 19, - "end": 42, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 19, - "end": 20, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 32, - "end": 36, - "ctxt": 0 - }, - "value": "eval", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 23, - "end": 42, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.ts b/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.ts deleted file mode 100644 index 9851a5f6c2c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserStrictMode9.ts +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -var v = function eval() { -}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.json deleted file mode 100644 index cff7c5d29b2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "body": [ - { - "type": "SwitchStatement", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "discriminant": { - "type": "Identifier", - "span": { - "start": 9, - "end": 12, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "cases": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.ts deleted file mode 100644 index 31b80669948..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserSwitchStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -switch (foo) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserSyntaxWalker.generated.ts b/crates/swc_ecma_parser/tests/tsc/parserSyntaxWalker.generated.ts index 9e7bd32d5e0..2edf08e6ada 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserSyntaxWalker.generated.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserSyntaxWalker.generated.ts @@ -1,4 +1,4 @@ -//declare module "fs" { +//declare module "fs" { // export class File { // constructor(filename: string); // public ReadAllText(): string; diff --git a/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.json deleted file mode 100644 index 1fb01c982e4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 9, - "ctxt": 0 - }, - "body": [ - { - "type": "ThrowStatement", - "span": { - "start": 1, - "end": 9, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "e", - "optional": false - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.ts deleted file mode 100644 index 81af6dd15da..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserThrowStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -throw e; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.json deleted file mode 100644 index c320e1b3655..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 22, - "ctxt": 0 - }, - "body": [ - { - "type": "TryStatement", - "span": { - "start": 1, - "end": 22, - "ctxt": 0 - }, - "block": { - "type": "BlockStatement", - "span": { - "start": 5, - "end": 8, - "ctxt": 0 - }, - "stmts": [] - }, - "handler": { - "type": "CatchClause", - "span": { - "start": 9, - "end": 22, - "ctxt": 0 - }, - "param": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 19, - "end": 22, - "ctxt": 0 - }, - "stmts": [] - } - }, - "finalizer": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.ts deleted file mode 100644 index 8bda0e04746..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTryStatement1.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -try { -} -catch (e) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.json b/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.json deleted file mode 100644 index 4eeafd808dc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 13, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 5, - "end": 13, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "BinaryExpression", - "span": { - "start": 5, - "end": 7, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Invalid", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "T", - "optional": false - } - }, - "right": { - "type": "CallExpression", - "span": { - "start": 8, - "end": 13, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 8, - "end": 11, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.ts b/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.ts deleted file mode 100644 index df1c910039f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeAssertionInObjectCreationExpression1.ts +++ /dev/null @@ -1 +0,0 @@ -new Foo() \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.json b/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.json deleted file mode 100644 index f06d6146ded..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 6, - "end": 17, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 8, - "end": 17, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.ts b/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.ts deleted file mode 100644 index 618199668a0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery3.ts +++ /dev/null @@ -1 +0,0 @@ -var v: typeof A. \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.json b/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.json deleted file mode 100644 index bc25fc7463b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 17, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 6, - "end": 17, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 8, - "end": 17, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 15, - "end": 16, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.ts b/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.ts deleted file mode 100644 index 1c08ea7c0c3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserTypeQuery4.ts +++ /dev/null @@ -1 +0,0 @@ -var v: typeof A.; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.json b/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.json deleted file mode 100644 index 519f6b9e70c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "expression": { - "type": "UpdateExpression", - "span": { - "start": 1, - "end": 18, - "ctxt": 0 - }, - "operator": "++", - "prefix": true, - "argument": { - "type": "UnaryExpression", - "span": { - "start": 4, - "end": 18, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "MemberExpression", - "span": { - "start": 11, - "end": 18, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 11, - "end": 14, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 15, - "end": 18, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.ts b/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.ts deleted file mode 100644 index be4cdbb33a1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserUnaryExpression5.ts +++ /dev/null @@ -1 +0,0 @@ -++ delete foo.bar \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserUnicode2.ts b/crates/swc_ecma_parser/tests/tsc/parserUnicode2.ts index 52f2588b0c2..f2947352d76 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserUnicode2.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserUnicode2.ts @@ -1 +1 @@ -var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 1; \ No newline at end of file +var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserUnicode3.ts b/crates/swc_ecma_parser/tests/tsc/parserUnicode3.ts index d50f5be5da8..66c1fbdc767 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserUnicode3.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserUnicode3.ts @@ -1,2 +1,2 @@ -class 剩下 { +class 剩下 { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.json b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.json deleted file mode 100644 index 52e8a8d4e11..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 8, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.ts deleted file mode 100644 index 5c7a4b11c9c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration10.ts +++ /dev/null @@ -1 +0,0 @@ -var a,; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.json b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.json deleted file mode 100644 index 7000d2fd16d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 16, - "end": 17, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 18, - "end": 39, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 23, - "end": 37, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.ts deleted file mode 100644 index 879b765e073..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration4.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module M { - declare var v; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.ts deleted file mode 100644 index 42f017736fa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.ts +++ /dev/null @@ -1 +0,0 @@ -var a, \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.json b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.json deleted file mode 100644 index a6a8e0f3429..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.ts deleted file mode 100644 index 0362a8a9514..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration6.ts +++ /dev/null @@ -1 +0,0 @@ -var \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.json b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.json deleted file mode 100644 index a2403a22fce..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 6, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 6, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.ts deleted file mode 100644 index eaa8675fe6c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration8.ts +++ /dev/null @@ -1 +0,0 @@ -var ; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.json deleted file mode 100644 index bdf07c7f6e4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 11, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 11, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 10, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 9, - "end": 10, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.ts deleted file mode 100644 index 7aa0a38bdd1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement1.d.ts +++ /dev/null @@ -1 +0,0 @@ -var v = 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.json b/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.json deleted file mode 100644 index 11840ff4727..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.ts b/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.ts deleted file mode 100644 index 991b2055c20..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableStatement2.d.ts +++ /dev/null @@ -1 +0,0 @@ -var v; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.json deleted file mode 100644 index 1080ce77818..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "body": [ - { - "type": "WhileStatement", - "span": { - "start": 1, - "end": 14, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 8, - "end": 9, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 11, - "end": 14, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.ts deleted file mode 100644 index d96620705d0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserWhileStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -while (e) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.json b/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.json deleted file mode 100644 index 9f7c7e2367c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "body": [ - { - "type": "WithStatement", - "span": { - "start": 1, - "end": 15, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 7, - "end": 10, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 12, - "end": 15, - "ctxt": 0 - }, - "stmts": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.ts b/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.ts deleted file mode 100644 index aa2399eaf6a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parserWithStatement1.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -with (foo) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.json b/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.json deleted file mode 100644 index 866d770c24b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "body": [ - { - "type": "BreakStatement", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "label": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.ts b/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.ts deleted file mode 100644 index 8cb76cf02d7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement1.ts +++ /dev/null @@ -1 +0,0 @@ -break; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.json b/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.json deleted file mode 100644 index 871315d570e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 49, - "ctxt": 0 - }, - "body": [ - { - "type": "WhileStatement", - "span": { - "start": 1, - "end": 49, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 8, - "end": 12, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 14, - "end": 49, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 18, - "end": 47, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 31, - "end": 47, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 37, - "end": 43, - "ctxt": 0 - }, - "label": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.ts deleted file mode 100644 index e2895ee7ea2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakNotInIterationOrSwitchStatement2.ts +++ /dev/null @@ -1,5 +0,0 @@ -while (true) { - function f() { - break; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.json b/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.json deleted file mode 100644 index 30065722ffd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 91, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 91, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 9, - "end": 91, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 22, - "end": 91, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 26, - "end": 89, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 89, - "ctxt": 0 - }, - "stmts": [ - { - "type": "WhileStatement", - "span": { - "start": 45, - "end": 85, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 85, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 66, - "end": 79, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 72, - "end": 78, - "ctxt": 0 - }, - "value": "target", - "optional": false - } - } - ] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.ts b/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.ts deleted file mode 100644 index 0da8ea519bd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget5.ts +++ /dev/null @@ -1,8 +0,0 @@ -target: -while (true) { - function f() { - while (true) { - break target; - } - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.json b/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.json deleted file mode 100644 index 364ee8930f4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "body": [ - { - "type": "WhileStatement", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 8, - "end": 12, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 14, - "end": 33, - "ctxt": 0 - }, - "stmts": [ - { - "type": "BreakStatement", - "span": { - "start": 18, - "end": 31, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 24, - "end": 30, - "ctxt": 0 - }, - "value": "target", - "optional": false - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.ts b/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.ts deleted file mode 100644 index 3dcf504f519..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_breakTarget6.ts +++ /dev/null @@ -1,3 +0,0 @@ -while (true) { - break target; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.json b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.json deleted file mode 100644 index 4e5ca564199..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "body": [ - { - "type": "ContinueStatement", - "span": { - "start": 1, - "end": 10, - "ctxt": 0 - }, - "label": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.ts deleted file mode 100644 index 45127c0ad12..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement1.ts +++ /dev/null @@ -1 +0,0 @@ -continue; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.json b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.json deleted file mode 100644 index 99dcb2ac10a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 52, - "ctxt": 0 - }, - "body": [ - { - "type": "WhileStatement", - "span": { - "start": 1, - "end": 52, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 8, - "end": 12, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 14, - "end": 52, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 18, - "end": 50, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 31, - "end": 50, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 37, - "end": 46, - "ctxt": 0 - }, - "label": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.ts deleted file mode 100644 index 6eb28afb5ea..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement2.ts +++ /dev/null @@ -1,5 +0,0 @@ -while (true) { - function f() { - continue; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.json b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.json deleted file mode 100644 index 6b52d637f58..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "body": [ - { - "type": "SwitchStatement", - "span": { - "start": 1, - "end": 40, - "ctxt": 0 - }, - "discriminant": { - "type": "NumericLiteral", - "span": { - "start": 9, - "end": 10, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "cases": [ - { - "type": "SwitchCase", - "span": { - "start": 16, - "end": 38, - "ctxt": 0 - }, - "test": null, - "consequent": [ - { - "type": "ContinueStatement", - "span": { - "start": 29, - "end": 38, - "ctxt": 0 - }, - "label": null - } - ] - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.ts deleted file mode 100644 index c0e410df5c6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement3.ts +++ /dev/null @@ -1,4 +0,0 @@ -switch (0) { - default: - continue; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.json b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.json deleted file mode 100644 index 8789f594d47..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 61, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 61, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 4, - "ctxt": 0 - }, - "value": "TWO", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 6, - "end": 61, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 13, - "end": 17, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 18, - "end": 61, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 22, - "end": 59, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 26, - "end": 59, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 30, - "end": 59, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 36, - "end": 59, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 42, - "end": 55, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "TWO", - "optional": false - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.ts deleted file mode 100644 index db50c329594..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueNotInIterationStatement4.ts +++ /dev/null @@ -1,6 +0,0 @@ -TWO: -while (true){ - var x = () => { - continue TWO; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.json b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.json deleted file mode 100644 index 81545680bc1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 27, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "ContinueStatement", - "span": { - "start": 11, - "end": 27, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 20, - "end": 26, - "ctxt": 0 - }, - "value": "target", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.ts deleted file mode 100644 index 51bd4d20ad6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget1.ts +++ /dev/null @@ -1,2 +0,0 @@ -target: - continue target; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.json b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.json deleted file mode 100644 index 5852bb0a164..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 94, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 94, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 9, - "end": 94, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 22, - "end": 94, - "ctxt": 0 - }, - "stmts": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 26, - "end": 92, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 92, - "ctxt": 0 - }, - "stmts": [ - { - "type": "WhileStatement", - "span": { - "start": 45, - "end": 88, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 88, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 66, - "end": 82, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 75, - "end": 81, - "ctxt": 0 - }, - "value": "target", - "optional": false - } - } - ] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.ts deleted file mode 100644 index f6c551f3f68..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget5.ts +++ /dev/null @@ -1,8 +0,0 @@ -target: -while (true) { - function f() { - while (true) { - continue target; - } - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.json b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.json deleted file mode 100644 index 6214f5c08a4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 36, - "ctxt": 0 - }, - "body": [ - { - "type": "WhileStatement", - "span": { - "start": 1, - "end": 36, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 8, - "end": 12, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 14, - "end": 36, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ContinueStatement", - "span": { - "start": 18, - "end": 34, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 27, - "end": 33, - "ctxt": 0 - }, - "value": "target", - "optional": false - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.ts b/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.ts deleted file mode 100644 index dc5724e6035..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_continueTarget6.ts +++ /dev/null @@ -1,3 +0,0 @@ -while (true) { - continue target; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.json b/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.json deleted file mode 100644 index 55c29810099..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 33, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "LabeledStatement", - "span": { - "start": 9, - "end": 33, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 9, - "end": 15, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 17, - "end": 33, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 24, - "end": 28, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "stmts": [] - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.ts b/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.ts deleted file mode 100644 index bc6133ebb28..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel1.ts +++ /dev/null @@ -1,4 +0,0 @@ -target: -target: -while (true) { -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.json b/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.json deleted file mode 100644 index 0232178a3d0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 56, - "ctxt": 0 - }, - "body": [ - { - "type": "LabeledStatement", - "span": { - "start": 1, - "end": 56, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 1, - "end": 7, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 9, - "end": 56, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 22, - "end": 56, - "ctxt": 0 - }, - "stmts": [ - { - "type": "LabeledStatement", - "span": { - "start": 26, - "end": 54, - "ctxt": 0 - }, - "label": { - "type": "Identifier", - "span": { - "start": 26, - "end": 32, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "body": { - "type": "WhileStatement", - "span": { - "start": 36, - "end": 54, - "ctxt": 0 - }, - "test": { - "type": "BooleanLiteral", - "span": { - "start": 43, - "end": 47, - "ctxt": 0 - }, - "value": true - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 49, - "end": 54, - "ctxt": 0 - }, - "stmts": [] - } - } - } - ] - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.ts b/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.ts deleted file mode 100644 index 530c5a63911..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parser_duplicateLabel2.ts +++ /dev/null @@ -1,6 +0,0 @@ -target: -while (true) { - target: - while (true) { - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/parserindenter.ts b/crates/swc_ecma_parser/tests/tsc/parserindenter.ts index cfea938be60..05bc1344451 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserindenter.ts +++ b/crates/swc_ecma_parser/tests/tsc/parserindenter.ts @@ -1,4 +1,4 @@ -// +// // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.json b/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.json deleted file mode 100644 index cc764b04841..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 16, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 15, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 7, - "end": 15, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 9, - "end": 15, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 9, - "end": 13, - "ctxt": 0 - }, - "value": "void", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 14, - "end": 15, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.ts b/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.ts deleted file mode 100644 index 945cb56b4fd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/parservoidInQualifiedName1.ts +++ /dev/null @@ -1 +0,0 @@ -var v : void.x; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.json b/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.json new file mode 100644 index 00000000000..2c7170234fe --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.json @@ -0,0 +1,80 @@ +{ + "type": "Module", + "span": { + "start": 134, + "end": 231, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDefaultExpression", + "span": { + "start": 134, + "end": 151, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 149, + "end": 150, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 196, + "end": 231, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 205, + "end": 217, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 205, + "end": 212, + "ctxt": 0 + }, + "value": "default", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 216, + "end": 217, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 225, + "end": 230, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.ts b/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.ts new file mode 100644 index 00000000000..73dfb48001e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/plainJSGrammarErrors2.ts @@ -0,0 +1,14 @@ +// @outdir: out/ +// @target: esnext +// @module: esnext +// @allowJs: true +// @filename: plainJSGrammarErrors2.js + +// @filename: /a.js +export default 1; + +// @filename: /b.js +/** + * @deprecated + */ +export { default as A } from "./a"; diff --git a/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.json b/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.json deleted file mode 100644 index c2c5d770fb7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.json +++ /dev/null @@ -1,2264 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 28, - "end": 1115, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 28, - "end": 41, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 32, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 32, - "end": 35, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 40, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 42, - "end": 51, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 46, - "end": 50, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 46, - "end": 50, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 52, - "end": 79, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 56, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 56, - "end": 60, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 60, - "end": 67, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 62, - "end": 67, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 70, - "end": 78, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 71, - "end": 73, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 75, - "end": 77, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 80, - "end": 97, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 84, - "end": 97, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 84, - "end": 87, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 87, - "end": 97, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 89, - "end": 97, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 92, - "end": 97, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 95, - "end": 97, - "ctxt": 0 - }, - "members": [] - } - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 98, - "end": 150, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 102, - "end": 149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 102, - "end": 106, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 109, - "end": 149, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 114, - "end": 132, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 115, - "end": 124, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 116, - "end": 124, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 118, - "end": 124, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 137, - "end": 148, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 138, - "end": 140, - "ctxt": 0 - }, - "value": "s1", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 145, - "end": 148, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 161, - "end": 164, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 152, - "end": 200, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 172, - "end": 200, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 178, - "end": 184, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 189, - "end": 198, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 166, - "end": 171, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 201, - "end": 289, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 215, - "end": 229, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 222, - "end": 223, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 225, - "end": 228, - "ctxt": 0 - }, - "kind": "any" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 234, - "end": 287, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 241, - "end": 244, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 234, - "end": 287, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 247, - "end": 287, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 257, - "end": 263, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 272, - "end": 281, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 279, - "end": 280, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 290, - "end": 325, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 297, - "end": 298, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 299, - "end": 325, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 305, - "end": 323, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 316, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 317, - "end": 322, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 326, - "end": 345, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 330, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 330, - "end": 334, - "ctxt": 0 - }, - "value": "objA", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 337, - "end": 344, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 369, - "end": 397, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 373, - "end": 396, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 373, - "end": 388, - "ctxt": 0 - }, - "value": "ResultIsNumber1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 391, - "end": 396, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 392, - "end": 396, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 398, - "end": 426, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 402, - "end": 425, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 402, - "end": 417, - "ctxt": 0 - }, - "value": "ResultIsNumber2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 420, - "end": 425, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 421, - "end": 425, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 427, - "end": 452, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 431, - "end": 451, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 431, - "end": 446, - "ctxt": 0 - }, - "value": "ResultIsNumber3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 449, - "end": 451, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 450, - "end": 451, - "ctxt": 0 - }, - "value": "A", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 453, - "end": 478, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 457, - "end": 477, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 457, - "end": 472, - "ctxt": 0 - }, - "value": "ResultIsNumber4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 475, - "end": 477, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 476, - "end": 477, - "ctxt": 0 - }, - "value": "M", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 479, - "end": 506, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 483, - "end": 505, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 483, - "end": 498, - "ctxt": 0 - }, - "value": "ResultIsNumber5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 501, - "end": 505, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 502, - "end": 505, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 507, - "end": 535, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 511, - "end": 534, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 511, - "end": 526, - "ctxt": 0 - }, - "value": "ResultIsNumber6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 529, - "end": 534, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 557, - "end": 590, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 561, - "end": 589, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 561, - "end": 576, - "ctxt": 0 - }, - "value": "ResultIsNumber7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 579, - "end": 589, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 580, - "end": 589, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 591, - "end": 619, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 595, - "end": 618, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 595, - "end": 610, - "ctxt": 0 - }, - "value": "ResultIsNumber8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 613, - "end": 618, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "NullLiteral", - "span": { - "start": 614, - "end": 618, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 645, - "end": 676, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 649, - "end": 675, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 649, - "end": 664, - "ctxt": 0 - }, - "value": "ResultIsNumber9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 667, - "end": 675, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 668, - "end": 675, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 668, - "end": 672, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 672, - "end": 675, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 673, - "end": 674, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 677, - "end": 708, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 681, - "end": 707, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 681, - "end": 697, - "ctxt": 0 - }, - "value": "ResultIsNumber10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 700, - "end": 707, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 701, - "end": 707, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 701, - "end": 705, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 706, - "end": 707, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 709, - "end": 740, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 713, - "end": 739, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 713, - "end": 729, - "ctxt": 0 - }, - "value": "ResultIsNumber11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 732, - "end": 739, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 733, - "end": 739, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 733, - "end": 737, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 738, - "end": 739, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 741, - "end": 772, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 745, - "end": 771, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 745, - "end": 761, - "ctxt": 0 - }, - "value": "ResultIsNumber12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 764, - "end": 771, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 765, - "end": 771, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 765, - "end": 769, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 770, - "end": 771, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 773, - "end": 801, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 777, - "end": 800, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 777, - "end": 793, - "ctxt": 0 - }, - "value": "ResultIsNumber13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 796, - "end": 800, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 797, - "end": 800, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 797, - "end": 798, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 799, - "end": 800, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 802, - "end": 832, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 806, - "end": 831, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 806, - "end": 822, - "ctxt": 0 - }, - "value": "ResultIsNumber14", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 825, - "end": 831, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "CallExpression", - "span": { - "start": 826, - "end": 831, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 826, - "end": 829, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 833, - "end": 865, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 837, - "end": 864, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 837, - "end": 853, - "ctxt": 0 - }, - "value": "ResultIsNumber15", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 856, - "end": 864, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "CallExpression", - "span": { - "start": 857, - "end": 864, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 857, - "end": 862, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 857, - "end": 858, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 859, - "end": 862, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 866, - "end": 903, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 870, - "end": 902, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 870, - "end": 886, - "ctxt": 0 - }, - "value": "ResultIsNumber16", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 889, - "end": 902, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 890, - "end": 902, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 891, - "end": 901, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 891, - "end": 894, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 897, - "end": 901, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 904, - "end": 947, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 908, - "end": 946, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 908, - "end": 924, - "ctxt": 0 - }, - "value": "ResultIsNumber17", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 927, - "end": 946, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 928, - "end": 946, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 929, - "end": 945, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 929, - "end": 933, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 936, - "end": 945, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 948, - "end": 986, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 952, - "end": 985, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 952, - "end": 968, - "ctxt": 0 - }, - "value": "ResultIsNumber18", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 971, - "end": 985, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 972, - "end": 985, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 973, - "end": 984, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "NullLiteral", - "span": { - "start": 973, - "end": 977, - "ctxt": 0 - } - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 980, - "end": 984, - "ctxt": 0 - } - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 987, - "end": 1035, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 991, - "end": 1034, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 991, - "end": 1007, - "ctxt": 0 - }, - "value": "ResultIsNumber19", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 1010, - "end": 1034, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 1011, - "end": 1034, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 1012, - "end": 1033, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 1012, - "end": 1021, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1024, - "end": 1033, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1066, - "end": 1071, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1066, - "end": 1070, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 1067, - "end": 1070, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1072, - "end": 1078, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1072, - "end": 1077, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 1073, - "end": 1077, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1079, - "end": 1088, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1079, - "end": 1087, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1080, - "end": 1087, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1080, - "end": 1084, - "ctxt": 0 - }, - "value": "ANY2", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 1084, - "end": 1087, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1085, - "end": 1086, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1089, - "end": 1100, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 1089, - "end": 1099, - "ctxt": 0 - }, - "expressions": [ - { - "type": "UnaryExpression", - "span": { - "start": 1089, - "end": 1093, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "Identifier", - "span": { - "start": 1090, - "end": 1093, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - } - }, - { - "type": "Identifier", - "span": { - "start": 1095, - "end": 1099, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1101, - "end": 1109, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1101, - "end": 1108, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1102, - "end": 1108, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1102, - "end": 1106, - "ctxt": 0 - }, - "value": "objA", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1107, - "end": 1108, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1110, - "end": 1115, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 1110, - "end": 1114, - "ctxt": 0 - }, - "operator": "+", - "argument": { - "type": "MemberExpression", - "span": { - "start": 1111, - "end": 1114, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1111, - "end": 1112, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1113, - "end": 1114, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.ts b/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.ts deleted file mode 100644 index ec90e29f50a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/plusOperatorWithAnyOtherType.ts +++ /dev/null @@ -1,56 +0,0 @@ -// + operator on any type - -var ANY: any; -var ANY1; -var ANY2: any[] = ["", ""]; -var obj: () => {} -var obj1 = { x: (s: string) => { }, y: (s1) => { }}; - -function foo(): any { - var a; - return a; -} -class A { - public a: any; - static foo() { - var a; - return a; - } -} -module M { - export var n: any; -} -var objA = new A(); - -// any other type var -var ResultIsNumber1 = +ANY1; -var ResultIsNumber2 = +ANY2; -var ResultIsNumber3 = +A; -var ResultIsNumber4 = +M; -var ResultIsNumber5 = +obj; -var ResultIsNumber6 = +obj1; - -// any type literal -var ResultIsNumber7 = +undefined; -var ResultIsNumber8 = +null; - -// any type expressions -var ResultIsNumber9 = +ANY2[0]; -var ResultIsNumber10 = +obj1.x; -var ResultIsNumber11 = +obj1.y; -var ResultIsNumber12 = +objA.a; -var ResultIsNumber13 = +M.n; -var ResultIsNumber14 = +foo(); -var ResultIsNumber15 = +A.foo(); -var ResultIsNumber16 = +(ANY + ANY1); -var ResultIsNumber17 = +(null + undefined); -var ResultIsNumber18 = +(null + null); -var ResultIsNumber19 = +(undefined + undefined); - -// miss assignment operators -+ANY; -+ANY1; -+ANY2[0]; -+ANY, ANY1; -+objA.a; -+M.n; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.json b/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.json deleted file mode 100644 index 2c47a7b5e1e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.json +++ /dev/null @@ -1,497 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 73, - "end": 289, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 73, - "end": 289, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 87, - "end": 92, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 87, - "end": 88, - "ctxt": 0 - }, - "value": "a", - "optional": true - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 91, - "end": 92, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 91, - "end": 92, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": true, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "PrivateProperty", - "span": { - "start": 97, - "end": 104, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 97, - "end": 99, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 98, - "end": 99, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 100, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 102, - "end": 103, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 102, - "end": 103, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": true, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 109, - "end": 150, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 109, - "end": 113, - "ctxt": 0 - }, - "value": "getA", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 109, - "end": 150, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 119, - "end": 150, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 129, - "end": 144, - "ctxt": 0 - }, - "argument": { - "type": "NewExpression", - "span": { - "start": 136, - "end": 143, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 118, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "Constructor", - "span": { - "start": 155, - "end": 287, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 155, - "end": 166, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 169, - "end": 287, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 179, - "end": 188, - "ctxt": 0 - }, - "expression": { - "type": "OptionalChainingExpression", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "questionDotToken": { - "start": 183, - "end": 184, - "ctxt": 0 - }, - "base": { - "type": "MemberExpression", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 179, - "end": 183, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 185, - "end": 187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 216, - "end": 227, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 216, - "end": 226, - "ctxt": 0 - }, - "object": { - "type": "OptionalChainingExpression", - "span": { - "start": 216, - "end": 223, - "ctxt": 0 - }, - "questionDotToken": { - "start": 220, - "end": 221, - "ctxt": 0 - }, - "base": { - "type": "MemberExpression", - "span": { - "start": 216, - "end": 223, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 216, - "end": 220, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 222, - "end": 223, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 224, - "end": 226, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 253, - "end": 269, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 253, - "end": 268, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 253, - "end": 265, - "ctxt": 0 - }, - "callee": { - "type": "OptionalChainingExpression", - "span": { - "start": 253, - "end": 263, - "ctxt": 0 - }, - "questionDotToken": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "base": { - "type": "MemberExpression", - "span": { - "start": 253, - "end": 263, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 253, - "end": 257, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 259, - "end": 263, - "ctxt": 0 - }, - "value": "getA", - "optional": false - } - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 266, - "end": 268, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.ts b/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.ts deleted file mode 100644 index e98eeba739d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateIdentifierChain.1.ts +++ /dev/null @@ -1,16 +0,0 @@ -// @strict: true -// @target: esnext -// @useDefineForClassFields: false - -class A { - a?: A - #b?: A; - getA(): A { - return new A(); - } - constructor() { - this?.#b; // Error - this?.a.#b; // Error - this?.getA().#b; // Error - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.json b/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.json deleted file mode 100644 index 2261adeb71b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 273, - "ctxt": 0 - }, - "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 6, - "end": 7, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 10, - "end": 51, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 16, - "end": 29, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 16, - "end": 20, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 17, - "end": 20, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 20, - "end": 28, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 22, - "end": 28, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 34, - "end": 49, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 34, - "end": 38, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 40, - "end": 48, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 42, - "end": 48, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 53, - "end": 106, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 63, - "end": 64, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 65, - "end": 106, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 71, - "end": 84, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 71, - "end": 75, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 77, - "end": 83, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 89, - "end": 104, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 89, - "end": 93, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 90, - "end": 93, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 95, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 97, - "end": 103, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 108, - "end": 230, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 122, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 123, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 123, - "end": 229, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 125, - "end": 229, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 131, - "end": 144, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 131, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 149, - "end": 207, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 152, - "end": 207, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 154, - "end": 207, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 164, - "end": 177, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 164, - "end": 168, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 168, - "ctxt": 0 - }, - "value": "baz", - "optional": false - } - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 168, - "end": 176, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 170, - "end": 176, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 186, - "end": 201, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 186, - "end": 190, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "value": "taz", - "optional": false - } - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 192, - "end": 200, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 194, - "end": 200, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 212, - "end": 227, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "baz", - "optional": false - } - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 218, - "end": 226, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 220, - "end": 226, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 232, - "end": 273, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 246, - "end": 272, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 247, - "end": 272, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 249, - "end": 272, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 250, - "end": 271, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeLiteral", - "span": { - "start": 250, - "end": 271, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 252, - "end": 269, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 252, - "end": 255, - "ctxt": 0 - }, - "value": "qux", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 255, - "end": 269, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 257, - "end": 269, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 259, - "end": 267, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "PrivateName", - "span": { - "start": 259, - "end": 264, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "quux", - "optional": false - } - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.ts b/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.ts deleted file mode 100644 index 7df86911851..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameAndPropertySignature.ts +++ /dev/null @@ -1,20 +0,0 @@ -type A = { - #foo: string; - #bar(): string; -} - -interface B { - #foo: string; - #bar(): string; -} - -declare const x: { - #foo: number; - bar: { - #baz: string; - #taz(): string; - } - #baz(): string; -}; - -declare const y: [{ qux: { #quux: 3 } }]; diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.json b/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.json deleted file mode 100644 index 5c736995ff9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 20, - "end": 104, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 20, - "end": 30, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 38, - "end": 39, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 32, - "end": 104, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 54, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 60, - "end": 102, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 60, - "end": 71, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 74, - "end": 102, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 80, - "end": 85, - "ctxt": 0 - }, - "expression": { - "type": "ThisExpression", - "span": { - "start": 80, - "end": 84, - "ctxt": 0 - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 90, - "end": 97, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 90, - "end": 95, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.ts b/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.ts deleted file mode 100644 index b3930010db7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuper.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @target: es2015 -class B {}; -class A extends B { - #x; - constructor() { - this; - super(); - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.json b/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.json deleted file mode 100644 index a2456819858..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 62, - "end": 146, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 68, - "end": 69, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 62, - "end": 72, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "EmptyStatement", - "span": { - "start": 72, - "end": 73, - "ctxt": 0 - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 74, - "end": 146, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 96, - "end": 98, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 97, - "end": 98, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 102, - "end": 144, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 102, - "end": 113, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 116, - "end": 144, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "expression": { - "type": "ThisExpression", - "span": { - "start": 122, - "end": 126, - "ctxt": 0 - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 132, - "end": 140, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 132, - "end": 139, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 132, - "end": 137, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 90, - "end": 91, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.ts b/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.ts deleted file mode 100644 index bb110342444..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameBadSuperUseDefineForClassFields.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: esnext, es2022 -// @useDefineForClassFields: true -class B {}; -class A extends B { - #x; - constructor() { - this; - super(); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.json b/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.json deleted file mode 100644 index 837b7222897..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 101, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 24, - "end": 25, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 18, - "end": 101, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateMethod", - "span": { - "start": 32, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 32, - "end": 44, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 33, - "end": 44, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 32, - "end": 49, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 47, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.ts b/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.ts deleted file mode 100644 index 4db28f8ed7f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameConstructorReserved.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @target: es6 - -class A { - #constructor() {} // Error: `#constructor` is a reserved word. -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.json b/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.json deleted file mode 100644 index 996a07fc493..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.json +++ /dev/null @@ -1,1587 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 80, - "end": 1270, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 86, - "end": 100, - "ctxt": 0 - }, - "value": "TestWithErrors", - "optional": false - }, - "declare": false, - "span": { - "start": 80, - "end": 690, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 107, - "end": 116, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 107, - "end": 112, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 108, - "end": 112, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 122, - "end": 161, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 129, - "end": 131, - "ctxt": 0 - }, - "value": "dd", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 134, - "end": 160, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 134, - "end": 154, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 138, - "end": 152, - "ctxt": 0 - }, - "value": "TestWithErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 155, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 160, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 173, - "end": 688, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 180, - "end": 192, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 181, - "end": 191, - "ctxt": 0 - }, - "value": "X_ z_ zz", - "raw": "\"X_ z_ zz\"" - } - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 201, - "end": 206, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "span": { - "start": 195, - "end": 688, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 217, - "end": 227, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 218, - "end": 221, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 225, - "end": 227, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 239, - "end": 300, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 239, - "end": 300, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 243, - "end": 300, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 257, - "end": 283, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 257, - "end": 283, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 257, - "end": 277, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 261, - "end": 275, - "ctxt": 0 - }, - "value": "TestWithErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 278, - "end": 283, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 279, - "end": 283, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 309, - "end": 471, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 326, - "end": 336, - "ctxt": 0 - }, - "value": "InnerInner", - "optional": false - }, - "span": { - "start": 320, - "end": 471, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 351, - "end": 461, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 351, - "end": 352, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 351, - "end": 461, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 355, - "end": 461, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 373, - "end": 399, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 373, - "end": 399, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 373, - "end": 393, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 377, - "end": 391, - "ctxt": 0 - }, - "value": "TestWithErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 394, - "end": 399, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 395, - "end": 399, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 423, - "end": 440, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 423, - "end": 439, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 423, - "end": 434, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 427, - "end": 432, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 435, - "end": 439, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 436, - "end": 439, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 481, - "end": 681, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 488, - "end": 489, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 481, - "end": 681, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 491, - "end": 681, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 505, - "end": 671, - "ctxt": 0 - }, - "argument": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 512, - "end": 671, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 536, - "end": 657, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 536, - "end": 657, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 540, - "end": 657, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 562, - "end": 588, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 562, - "end": 588, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 562, - "end": 582, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 566, - "end": 580, - "ctxt": 0 - }, - "value": "TestWithErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 583, - "end": 588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 584, - "end": 588, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 616, - "end": 633, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 616, - "end": 632, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 616, - "end": 627, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 620, - "end": 625, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 628, - "end": 632, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 629, - "end": 632, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 698, - "end": 710, - "ctxt": 0 - }, - "value": "TestNoErrors", - "optional": false - }, - "declare": false, - "span": { - "start": 692, - "end": 1270, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 717, - "end": 726, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 717, - "end": 722, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 718, - "end": 722, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 732, - "end": 762, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 732, - "end": 734, - "ctxt": 0 - }, - "value": "dd", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 737, - "end": 761, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 737, - "end": 755, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 741, - "end": 753, - "ctxt": 0 - }, - "value": "TestNoErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 756, - "end": 761, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 757, - "end": 761, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 773, - "end": 1266, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 773, - "end": 785, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 774, - "end": 784, - "ctxt": 0 - }, - "value": "X_ z_ zz", - "raw": "\"X_ z_ zz\"" - } - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 794, - "end": 799, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "span": { - "start": 788, - "end": 1266, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 810, - "end": 820, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 810, - "end": 814, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 811, - "end": 814, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 818, - "end": 820, - "ctxt": 0 - }, - "value": 10.0, - "raw": "10" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 832, - "end": 890, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 832, - "end": 833, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 832, - "end": 890, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 836, - "end": 890, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 850, - "end": 874, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 850, - "end": 874, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 850, - "end": 868, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 854, - "end": 866, - "ctxt": 0 - }, - "value": "TestNoErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 869, - "end": 874, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 870, - "end": 874, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 899, - "end": 1050, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 899, - "end": 900, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 909, - "end": 919, - "ctxt": 0 - }, - "value": "InnerInner", - "optional": false - }, - "span": { - "start": 903, - "end": 1050, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 934, - "end": 1040, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 934, - "end": 935, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 934, - "end": 1040, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 938, - "end": 1040, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 956, - "end": 980, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 956, - "end": 980, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 956, - "end": 974, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 960, - "end": 972, - "ctxt": 0 - }, - "value": "TestNoErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 975, - "end": 980, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 976, - "end": 980, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1003, - "end": 1020, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1003, - "end": 1019, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 1003, - "end": 1014, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1007, - "end": 1012, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 1015, - "end": 1019, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1016, - "end": 1019, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1062, - "end": 1259, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1069, - "end": 1070, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1062, - "end": 1259, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1072, - "end": 1259, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 1086, - "end": 1249, - "ctxt": 0 - }, - "argument": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1093, - "end": 1249, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1117, - "end": 1235, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1117, - "end": 1118, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1117, - "end": 1235, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1121, - "end": 1235, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1143, - "end": 1167, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1143, - "end": 1167, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 1143, - "end": 1161, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1147, - "end": 1159, - "ctxt": 0 - }, - "value": "TestNoErrors", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 1162, - "end": 1167, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1163, - "end": 1167, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1194, - "end": 1211, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1194, - "end": 1210, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 1194, - "end": 1205, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1198, - "end": 1203, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 1206, - "end": 1210, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1207, - "end": 1210, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts b/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts deleted file mode 100644 index 1a14a53773a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameErrorsOnNotUseDefineForClassFieldsInEsNext.ts +++ /dev/null @@ -1,55 +0,0 @@ -// @strict: true -// @target: esNext,es2020 -// @useDefineForClassFields: false - -class TestWithErrors { - #prop = 0 - static dd = new TestWithErrors().#prop; // Err - static ["X_ z_ zz"] = class Inner { - #foo = 10 - m() { - new TestWithErrors().#prop // Err - } - static C = class InnerInner { - m() { - new TestWithErrors().#prop // Err - new Inner().#foo; // Err - } - } - - static M(){ - return class { - m() { - new TestWithErrors().#prop // Err - new Inner().#foo; // OK - } - } - } - } -} - -class TestNoErrors { - #prop = 0 - dd = new TestNoErrors().#prop; // OK - ["X_ z_ zz"] = class Inner { - #foo = 10 - m() { - new TestNoErrors().#prop // Ok - } - C = class InnerInner { - m() { - new TestNoErrors().#prop // Ok - new Inner().#foo; // Ok - } - } - - static M(){ - return class { - m() { - new TestNoErrors().#prop // OK - new Inner().#foo; // OK - } - } - } - } - } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.json b/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.json deleted file mode 100644 index ea5ff4f2fde..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.json +++ /dev/null @@ -1,3527 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 80, - "end": 2911, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 86, - "end": 89, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 80, - "end": 2751, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 96, - "end": 107, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 96, - "end": 102, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 97, - "end": 102, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateProperty", - "span": { - "start": 112, - "end": 136, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 119, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 131, - "ctxt": 0 - }, - "value": "staticField", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 141, - "end": 153, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 141, - "end": 148, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 142, - "end": 148, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 141, - "end": 153, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 151, - "end": 153, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 158, - "end": 183, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 165, - "end": 178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 166, - "end": 178, - "ctxt": 0 - }, - "value": "staticMethod", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 158, - "end": 183, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 181, - "end": 183, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 189, - "end": 479, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 189, - "end": 196, - "ctxt": 0 - }, - "value": "goodRhs", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 197, - "end": 203, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 197, - "end": 203, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 198, - "end": 203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 189, - "end": 479, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 205, - "end": 479, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 215, - "end": 237, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 221, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 221, - "end": 222, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 225, - "end": 236, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 225, - "end": 231, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 226, - "end": 231, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 247, - "end": 275, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 253, - "end": 274, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 257, - "end": 274, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 257, - "end": 263, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 258, - "end": 263, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 267, - "end": 274, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 267, - "end": 271, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 271, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 272, - "end": 274, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 285, - "end": 315, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 291, - "end": 314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 291, - "end": 292, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 295, - "end": 314, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "ParenthesisExpression", - "span": { - "start": 305, - "end": 314, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 306, - "end": 313, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 311, - "end": 313, - "ctxt": 0 - }, - "members": [] - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 325, - "end": 356, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 331, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 335, - "end": 355, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 335, - "end": 341, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 336, - "end": 341, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "ParenthesisExpression", - "span": { - "start": 345, - "end": 355, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 346, - "end": 354, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 351, - "end": 354, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 351, - "end": 354, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 366, - "end": 399, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 372, - "end": 398, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 372, - "end": 373, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 376, - "end": 398, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 376, - "end": 382, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "ParenthesisExpression", - "span": { - "start": 386, - "end": 398, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 387, - "end": 397, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 387, - "end": 388, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 392, - "end": 397, - "ctxt": 0 - }, - "kind": "never" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "ForInStatement", - "span": { - "start": 409, - "end": 451, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 414, - "end": 419, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 418, - "end": 419, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 418, - "end": 419, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 423, - "end": 441, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 423, - "end": 434, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 423, - "end": 429, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 424, - "end": 429, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 433, - "end": 434, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 438, - "end": 441, - "ctxt": 0 - }, - "kind": "any" - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 443, - "end": 451, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 484, - "end": 888, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 484, - "end": 490, - "ctxt": 0 - }, - "value": "badRhs", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 491, - "end": 497, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 491, - "end": 497, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 492, - "end": 497, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 484, - "end": 888, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 499, - "end": 888, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 509, - "end": 544, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 515, - "end": 543, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 515, - "end": 516, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 519, - "end": 543, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 519, - "end": 525, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 520, - "end": 525, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "ParenthesisExpression", - "span": { - "start": 529, - "end": 543, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 530, - "end": 542, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 530, - "end": 531, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 535, - "end": 542, - "ctxt": 0 - }, - "kind": "unknown" - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 600, - "end": 621, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 606, - "end": 620, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 610, - "end": 620, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 610, - "end": 615, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 611, - "end": 615, - "ctxt": 0 - }, - "value": "fiel", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 619, - "end": 620, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 658, - "end": 682, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 664, - "end": 681, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 664, - "end": 665, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 668, - "end": 681, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "ParenthesisExpression", - "span": { - "start": 668, - "end": 676, - "ctxt": 0 - }, - "expression": { - "type": "PrivateName", - "span": { - "start": 669, - "end": 675, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 670, - "end": 675, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 680, - "end": 681, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "ForInStatement", - "span": { - "start": 743, - "end": 769, - "ctxt": 0 - }, - "left": { - "type": "PrivateName", - "span": { - "start": 748, - "end": 754, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 749, - "end": 754, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 758, - "end": 759, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 761, - "end": 769, - "ctxt": 0 - }, - "stmts": [] - } - }, - { - "type": "ForInStatement", - "span": { - "start": 805, - "end": 840, - "ctxt": 0 - }, - "left": { - "type": "VariableDeclaration", - "span": { - "start": 810, - "end": 815, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 814, - "end": 815, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 814, - "end": 815, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 819, - "end": 830, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 819, - "end": 825, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 820, - "end": 825, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 829, - "end": 830, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 832, - "end": 840, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 893, - "end": 1012, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 893, - "end": 903, - "ctxt": 0 - }, - "value": "whitespace", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 904, - "end": 910, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 904, - "end": 910, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 905, - "end": 910, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 907, - "end": 910, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 893, - "end": 1012, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 912, - "end": 1012, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 922, - "end": 1001, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 928, - "end": 1001, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 928, - "end": 929, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 932, - "end": 1001, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "Identifier", - "span": { - "start": 932, - "end": 933, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 942, - "end": 1001, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 942, - "end": 948, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 943, - "end": 948, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1000, - "end": 1001, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - } - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1017, - "end": 2749, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1017, - "end": 1021, - "ctxt": 0 - }, - "value": "flow", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 1022, - "end": 1032, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1032, - "ctxt": 0 - }, - "value": "u", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1023, - "end": 1032, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1025, - "end": 1032, - "ctxt": 0 - }, - "kind": "unknown" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1034, - "end": 1042, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1034, - "end": 1042, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1035, - "end": 1042, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1037, - "end": 1042, - "ctxt": 0 - }, - "kind": "never" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1044, - "end": 1057, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1044, - "end": 1057, - "ctxt": 0 - }, - "value": "fb", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1046, - "end": 1057, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1048, - "end": 1057, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1048, - "end": 1051, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1048, - "end": 1051, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1054, - "end": 1057, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1054, - "end": 1057, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1059, - "end": 1069, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1059, - "end": 1069, - "ctxt": 0 - }, - "value": "fs", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1061, - "end": 1069, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1063, - "end": 1069, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1063, - "end": 1069, - "ctxt": 0 - }, - "value": "FooSub", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1071, - "end": 1077, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1077, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1072, - "end": 1077, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1074, - "end": 1077, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1074, - "end": 1077, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1079, - "end": 1096, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1079, - "end": 1096, - "ctxt": 0 - }, - "value": "fsb", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1082, - "end": 1096, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1084, - "end": 1096, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1084, - "end": 1090, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1084, - "end": 1090, - "ctxt": 0 - }, - "value": "FooSub", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1093, - "end": 1096, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1093, - "end": 1096, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1098, - "end": 1122, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1098, - "end": 1122, - "ctxt": 0 - }, - "value": "fsfb", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1102, - "end": 1122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 1104, - "end": 1122, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1104, - "end": 1107, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1104, - "end": 1107, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1110, - "end": 1116, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1116, - "ctxt": 0 - }, - "value": "FooSub", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1119, - "end": 1122, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1122, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1017, - "end": 2749, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1124, - "end": 2749, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 1135, - "end": 1921, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1139, - "end": 1160, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "UnaryExpression", - "span": { - "start": 1139, - "end": 1147, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Identifier", - "span": { - "start": 1146, - "end": 1147, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1152, - "end": 1160, - "ctxt": 0 - }, - "value": "object", - "raw": "'object'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1162, - "end": 1921, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 1176, - "end": 1246, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1180, - "end": 1191, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1180, - "end": 1186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1181, - "end": 1186, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1190, - "end": 1191, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1193, - "end": 1246, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1211, - "end": 1213, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1211, - "end": 1212, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 1260, - "end": 1395, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1264, - "end": 1275, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1264, - "end": 1270, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1265, - "end": 1270, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1275, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1277, - "end": 1328, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1295, - "end": 1297, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1295, - "end": 1296, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 1334, - "end": 1395, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1352, - "end": 1354, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1352, - "end": 1353, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 1409, - "end": 1911, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1413, - "end": 1423, - "ctxt": 0 - }, - "operator": "!==", - "left": { - "type": "Identifier", - "span": { - "start": 1413, - "end": 1414, - "ctxt": 0 - }, - "value": "u", - "optional": false - }, - "right": { - "type": "NullLiteral", - "span": { - "start": 1419, - "end": 1423, - "ctxt": 0 - } - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1425, - "end": 1911, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 1443, - "end": 1587, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1447, - "end": 1458, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1447, - "end": 1453, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1448, - "end": 1453, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1457, - "end": 1458, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1460, - "end": 1519, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1482, - "end": 1484, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1482, - "end": 1483, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 1525, - "end": 1587, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1547, - "end": 1549, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1547, - "end": 1548, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 1605, - "end": 1682, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1609, - "end": 1621, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1609, - "end": 1616, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1610, - "end": 1616, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1620, - "end": 1621, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1623, - "end": 1682, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1645, - "end": 1647, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1645, - "end": 1646, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 1700, - "end": 1789, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1704, - "end": 1721, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1704, - "end": 1716, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1705, - "end": 1716, - "ctxt": 0 - }, - "value": "staticField", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1720, - "end": 1721, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1723, - "end": 1789, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1745, - "end": 1747, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1745, - "end": 1746, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 1807, - "end": 1897, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1811, - "end": 1829, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1811, - "end": 1824, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1812, - "end": 1824, - "ctxt": 0 - }, - "value": "staticMethod", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1828, - "end": 1829, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1831, - "end": 1897, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1853, - "end": 1855, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1853, - "end": 1854, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - } - ] - }, - "alternate": null - } - ] - }, - "alternate": null - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 1931, - "end": 2045, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 1935, - "end": 1947, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 1935, - "end": 1941, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1936, - "end": 1941, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 1945, - "end": 1947, - "ctxt": 0 - }, - "value": "fb", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1949, - "end": 1994, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1963, - "end": 1966, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1963, - "end": 1965, - "ctxt": 0 - }, - "value": "fb", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 2000, - "end": 2045, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2014, - "end": 2017, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2014, - "end": 2016, - "ctxt": 0 - }, - "value": "fb", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 2055, - "end": 2174, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 2059, - "end": 2071, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2059, - "end": 2065, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2060, - "end": 2065, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2069, - "end": 2071, - "ctxt": 0 - }, - "value": "fs", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 2073, - "end": 2121, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2087, - "end": 2090, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2087, - "end": 2089, - "ctxt": 0 - }, - "value": "fs", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 2127, - "end": 2174, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2141, - "end": 2144, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2141, - "end": 2143, - "ctxt": 0 - }, - "value": "fs", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 2184, - "end": 2301, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 2188, - "end": 2199, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2188, - "end": 2194, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2189, - "end": 2194, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2198, - "end": 2199, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 2201, - "end": 2252, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2215, - "end": 2217, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2215, - "end": 2216, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 2258, - "end": 2301, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2272, - "end": 2274, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2272, - "end": 2273, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 2311, - "end": 2433, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 2315, - "end": 2328, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2315, - "end": 2321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2316, - "end": 2321, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2325, - "end": 2328, - "ctxt": 0 - }, - "value": "fsb", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 2330, - "end": 2380, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2344, - "end": 2348, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2344, - "end": 2347, - "ctxt": 0 - }, - "value": "fsb", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 2386, - "end": 2433, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2400, - "end": 2404, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2400, - "end": 2403, - "ctxt": 0 - }, - "value": "fsb", - "optional": false - } - } - ] - } - }, - { - "type": "IfStatement", - "span": { - "start": 2443, - "end": 2578, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 2447, - "end": 2461, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2447, - "end": 2453, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2448, - "end": 2453, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2457, - "end": 2461, - "ctxt": 0 - }, - "value": "fsfb", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 2463, - "end": 2523, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2477, - "end": 2482, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2477, - "end": 2481, - "ctxt": 0 - }, - "value": "fsfb", - "optional": false - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 2529, - "end": 2578, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2543, - "end": 2548, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2543, - "end": 2547, - "ctxt": 0 - }, - "value": "fsfb", - "optional": false - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2594, - "end": 2600, - "ctxt": 0 - }, - "value": "Nested", - "optional": false - }, - "declare": false, - "span": { - "start": 2588, - "end": 2743, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 2615, - "end": 2733, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2615, - "end": 2616, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 2617, - "end": 2623, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2617, - "end": 2623, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2618, - "end": 2623, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2620, - "end": 2623, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2615, - "end": 2733, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2625, - "end": 2733, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 2643, - "end": 2719, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 2647, - "end": 2658, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2647, - "end": 2653, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2648, - "end": 2653, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2657, - "end": 2658, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 2660, - "end": 2719, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 2682, - "end": 2684, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 2682, - "end": 2683, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - } - ] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2759, - "end": 2765, - "ctxt": 0 - }, - "value": "FooSub", - "optional": false - }, - "declare": false, - "span": { - "start": 2753, - "end": 2801, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2780, - "end": 2799, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2780, - "end": 2792, - "ctxt": 0 - }, - "value": "subTypeOfFoo", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2795, - "end": 2799, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2774, - "end": 2777, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2808, - "end": 2811, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "declare": false, - "span": { - "start": 2802, - "end": 2829, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2814, - "end": 2827, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2814, - "end": 2820, - "ctxt": 0 - }, - "value": "notFoo", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 2823, - "end": 2827, - "ctxt": 0 - }, - "value": true - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2840, - "end": 2849, - "ctxt": 0 - }, - "value": "badSyntax", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2850, - "end": 2856, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2850, - "end": 2856, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2851, - "end": 2856, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2853, - "end": 2856, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2853, - "end": 2856, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2831, - "end": 2911, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2858, - "end": 2911, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 2864, - "end": 2883, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 2871, - "end": 2882, - "ctxt": 0 - }, - "operator": "in", - "left": { - "type": "PrivateName", - "span": { - "start": 2871, - "end": 2877, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2872, - "end": 2877, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 2881, - "end": 2882, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.ts b/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.ts deleted file mode 100644 index cc8c876e81f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameInInExpression.ts +++ /dev/null @@ -1,119 +0,0 @@ -// @strict: true -// @target: esnext, es2022 -// @useDefineForClassFields: true - -class Foo { - #field = 1; - static #staticField = 2; - #method() {} - static #staticMethod() {} - - goodRhs(v: any) { - const a = #field in v; - - const b = #field in v.p1.p2; - - const c = #field in (v as {}); - - const d = #field in (v as Foo); - - const e = #field in (v as never); - - for (let f in #field in v as any) { /**/ } // unlikely but valid - } - badRhs(v: any) { - const a = #field in (v as unknown); // Bad - RHS of in must be object type or any - - const b = #fiel in v; // Bad - typo in privateID - - const c = (#field) in v; // Bad - privateID is not an expression on its own - - for (#field in v) { /**/ } // Bad - 'in' not allowed - - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any - } - whitespace(v: any) { - const a = v && /*0*/#field/*1*/ - /*2*/in/*3*/ - /*4*/v/*5*/ - } - flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) { - - if (typeof u === 'object') { - if (#field in n) { - n; // good n is never - } - - if (#field in u) { - u; // good u is Foo - } else { - u; // good u is object | null - } - - if (u !== null) { - if (#field in u) { - u; // good u is Foo - } else { - u; // good u is object - } - - if (#method in u) { - u; // good u is Foo - } - - if (#staticField in u) { - u; // good u is typeof Foo - } - - if (#staticMethod in u) { - u; // good u is typeof Foo - } - } - } - - if (#field in fb) { - fb; // good fb is Foo - } else { - fb; // good fb is Bar - } - - if (#field in fs) { - fs; // good fs is FooSub - } else { - fs; // good fs is never - } - - if (#field in b) { - b; // good b is 'Bar & Foo' - } else { - b; // good b is Bar - } - - if (#field in fsb) { - fsb; // good fsb is FooSub - } else { - fsb; // good fsb is Bar - } - - if (#field in fsfb) { - fsfb; // good fsfb is 'Foo | FooSub' - } else { - fsfb; // good fsfb is Bar - } - - class Nested { - m(v: any) { - if (#field in v) { - v; // good v is Foo - } - } - } - } -} - -class FooSub extends Foo { subTypeOfFoo = true } -class Bar { notFoo = true } - -function badSyntax(v: Foo) { - return #field in v; // Bad - outside of class -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.json b/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.json deleted file mode 100644 index 977beca6bbb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.json +++ /dev/null @@ -1,643 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 282, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 182, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 27, - "end": 182, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "C", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 31, - "end": 182, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 43, - "end": 67, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 43, - "end": 49, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 44, - "end": 49, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "value": { - "type": "CallExpression", - "span": { - "start": 52, - "end": 66, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 52, - "end": 64, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 57, - "end": 64, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 58, - "end": 64, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - }, - "arguments": [], - "typeArguments": null - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 72, - "end": 96, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 72, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 73, - "end": 79, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 72, - "end": 96, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 82, - "end": 96, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 84, - "end": 94, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 91, - "end": 93, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 101, - "end": 141, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 108, - "end": 119, - "ctxt": 0 - }, - "value": "getInstance", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 101, - "end": 141, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 122, - "end": 141, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 124, - "end": 139, - "ctxt": 0 - }, - "argument": { - "type": "NewExpression", - "span": { - "start": 131, - "end": 138, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 146, - "end": 179, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "value": "getField", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 146, - "end": 179, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 157, - "end": 179, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 159, - "end": 177, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 166, - "end": 177, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 171, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 179, - "end": 180, - "ctxt": 0 - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 184, - "end": 224, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 184, - "end": 223, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 184, - "end": 195, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 184, - "end": 191, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 196, - "end": 222, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 196, - "end": 220, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 196, - "end": 211, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 196, - "end": 209, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 198, - "end": 209, - "ctxt": 0 - }, - "value": "getInstance", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "value": "getField", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 225, - "end": 249, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 225, - "end": 248, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 225, - "end": 240, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 225, - "end": 238, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 227, - "end": 238, - "ctxt": 0 - }, - "value": "getInstance", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 241, - "end": 248, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 242, - "end": 248, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 259, - "end": 282, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 259, - "end": 281, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 259, - "end": 274, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 259, - "end": 272, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 259, - "end": 260, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 261, - "end": 272, - "ctxt": 0 - }, - "value": "getInstance", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 275, - "end": 281, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 276, - "end": 281, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.ts b/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.ts deleted file mode 100644 index 503761c7341..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameMethodClassExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -// @target: es2015 - -const C = class { - #field = this.#method(); - #method() { return 42; } - static getInstance() { return new C(); } - getField() { return this.#field }; -} - -console.log(C.getInstance().getField()); -C.getInstance().#method; // Error -C.getInstance().#field; // Error - diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.json b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.json deleted file mode 100644 index 9fc144e933a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.json +++ /dev/null @@ -1,618 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 327, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 31, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 21, - "end": 327, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateMethod", - "span": { - "start": 38, - "end": 60, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 42, - "end": 44, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 60, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 47, - "end": 60, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 49, - "end": 58, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 60, - "end": 61, - "ctxt": 0 - } - }, - { - "type": "Constructor", - "span": { - "start": 66, - "end": 325, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 66, - "end": 77, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 80, - "end": 325, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 96, - "end": 103, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "declare": false, - "span": { - "start": 90, - "end": 319, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateMethod", - "span": { - "start": 118, - "end": 140, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 122, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 124, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 118, - "end": 140, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 127, - "end": 140, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 129, - "end": 138, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 136, - "end": 137, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - } - }, - { - "type": "ClassMethod", - "span": { - "start": 154, - "end": 222, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "value": "testBase", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 163, - "end": 170, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 163, - "end": 170, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 170, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 154, - "end": 222, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 172, - "end": 222, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 190, - "end": 208, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 190, - "end": 207, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 190, - "end": 201, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 190, - "end": 197, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 202, - "end": 206, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 202, - "end": 203, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 204, - "end": 206, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 235, - "end": 309, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 246, - "ctxt": 0 - }, - "value": "testDerived", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 247, - "end": 257, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 247, - "end": 257, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 248, - "end": 257, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 250, - "end": 257, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 250, - "end": 257, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 235, - "end": 309, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 259, - "end": 309, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 277, - "end": 295, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 277, - "end": 294, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 277, - "end": 288, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 277, - "end": 284, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 289, - "end": 293, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 291, - "end": 293, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.ts b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.ts deleted file mode 100644 index b5d235f5a11..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassAccessorsShadowing.ts +++ /dev/null @@ -1,16 +0,0 @@ -// @target: es2015 - -class Base { - get #x() { return 1; }; - constructor() { - class Derived { - get #x() { return 1; }; - testBase(x: Base) { - console.log(x.#x); - } - testDerived(x: Derived) { - console.log(x.#x); - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.json b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.json deleted file mode 100644 index 5bdbb74f281..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.json +++ /dev/null @@ -1,526 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 287, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 31, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 21, - "end": 287, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 38, - "end": 41, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 38, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 46, - "end": 285, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 46, - "end": 57, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 60, - "end": 285, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 76, - "end": 83, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "declare": false, - "span": { - "start": 70, - "end": 279, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 98, - "end": 101, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 98, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 114, - "end": 182, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 114, - "end": 122, - "ctxt": 0 - }, - "value": "testBase", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 123, - "end": 130, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 123, - "end": 130, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 130, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 114, - "end": 182, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 132, - "end": 182, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 150, - "end": 168, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 150, - "end": 167, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 150, - "end": 161, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 150, - "end": 157, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 162, - "end": 166, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 164, - "end": 166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 195, - "end": 269, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 195, - "end": 206, - "ctxt": 0 - }, - "value": "testDerived", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 207, - "end": 217, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 207, - "end": 217, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 208, - "end": 217, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 217, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 210, - "end": 217, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 195, - "end": 269, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 219, - "end": 269, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 237, - "end": 255, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 237, - "end": 254, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 237, - "end": 248, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 237, - "end": 244, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 249, - "end": 253, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 251, - "end": 253, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 252, - "end": 253, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.ts b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.ts deleted file mode 100644 index e7d55345dbe..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassFieldShadowing.ts +++ /dev/null @@ -1,16 +0,0 @@ -// @target: es2015 - -class Base { - #x; - constructor() { - class Derived { - #x; - testBase(x: Base) { - console.log(x.#x); - } - testDerived(x: Derived) { - console.log(x.#x); - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.json b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.json deleted file mode 100644 index 1e2a598f29d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.json +++ /dev/null @@ -1,580 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 299, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 31, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 21, - "end": 299, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateMethod", - "span": { - "start": 38, - "end": 46, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 38, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 38, - "end": 46, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 43, - "end": 46, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - } - }, - { - "type": "Constructor", - "span": { - "start": 52, - "end": 297, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 52, - "end": 63, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 66, - "end": 297, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 82, - "end": 89, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "declare": false, - "span": { - "start": 76, - "end": 291, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateMethod", - "span": { - "start": 104, - "end": 112, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 104, - "end": 106, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 104, - "end": 112, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 109, - "end": 112, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 112, - "end": 113, - "ctxt": 0 - } - }, - { - "type": "ClassMethod", - "span": { - "start": 126, - "end": 194, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 126, - "end": 134, - "ctxt": 0 - }, - "value": "testBase", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 142, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 138, - "end": 142, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 138, - "end": 142, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 126, - "end": 194, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 194, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 162, - "end": 180, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 162, - "end": 179, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 162, - "end": 173, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 162, - "end": 169, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 170, - "end": 173, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 174, - "end": 178, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 174, - "end": 175, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 176, - "end": 178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 207, - "end": 281, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 207, - "end": 218, - "ctxt": 0 - }, - "value": "testDerived", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 219, - "end": 229, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 219, - "end": 229, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 220, - "end": 229, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "value": "Derived", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 207, - "end": 281, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 231, - "end": 281, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 249, - "end": 267, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 249, - "end": 266, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 249, - "end": 260, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 249, - "end": 256, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 257, - "end": 260, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "MemberExpression", - "span": { - "start": 261, - "end": 265, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 263, - "end": 265, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 264, - "end": 265, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.ts b/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.ts deleted file mode 100644 index c05301955e4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNestedClassMethodShadowing.ts +++ /dev/null @@ -1,16 +0,0 @@ -// @target: es2015 - -class Base { - #x() { }; - constructor() { - class Derived { - #x() { }; - testBase(x: Base) { - console.log(x.#x); - } - testDerived(x: Derived) { - console.log(x.#x); - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.json b/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.json deleted file mode 100644 index cc26f7f9340..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 87, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 68, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 49, - "end": 66, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 49, - "end": 53, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 50, - "end": 53, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 64, - "end": 65, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 61, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 55, - "end": 61, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 70, - "end": 87, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 70, - "end": 86, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 70, - "end": 82, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 70, - "end": 77, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 78, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.ts b/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.ts deleted file mode 100644 index 1c0b3f5900a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameNotAccessibleOutsideDefiningClass.ts +++ /dev/null @@ -1,8 +0,0 @@ -// @strict: true -// @target: es6 - -class A { - #foo: number = 3; -} - -new A().#foo = 4; // Error diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorsDerivedClasses.json b/crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorssDerivedClasses.json similarity index 100% rename from crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorsDerivedClasses.json rename to crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorssDerivedClasses.json diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorsDerivedClasses.ts b/crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorssDerivedClasses.ts similarity index 100% rename from crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorsDerivedClasses.ts rename to crates/swc_ecma_parser/tests/tsc/privateNameStaticAccessorssDerivedClasses.ts diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.json b/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.json deleted file mode 100644 index 8bfaa43f170..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.json +++ /dev/null @@ -1,646 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 281, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 190, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 27, - "end": 190, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "C", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "span": { - "start": 31, - "end": 190, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 45, - "end": 73, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 52, - "end": 58, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 58, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - }, - "value": { - "type": "CallExpression", - "span": { - "start": 61, - "end": 72, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 61, - "end": 70, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 63, - "end": 70, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 64, - "end": 70, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - }, - "arguments": [], - "typeArguments": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 78, - "end": 109, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 85, - "end": 92, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 86, - "end": 92, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 78, - "end": 109, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 95, - "end": 109, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 97, - "end": 107, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 104, - "end": 106, - "ctxt": 0 - }, - "value": 42.0, - "raw": "42" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 114, - "end": 145, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "value": "getClass", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 114, - "end": 145, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 132, - "end": 145, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 134, - "end": 143, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "value": "D", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 150, - "end": 187, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 157, - "end": 165, - "ctxt": 0 - }, - "value": "getField", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 150, - "end": 187, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 168, - "end": 187, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 170, - "end": 185, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 177, - "end": 185, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 180, - "end": 185, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "EmptyStatement", - "span": { - "start": 187, - "end": 188, - "ctxt": 0 - } - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 192, - "end": 229, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 192, - "end": 228, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 192, - "end": 203, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 192, - "end": 199, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 204, - "end": 227, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 204, - "end": 225, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 204, - "end": 216, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 204, - "end": 214, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 204, - "end": 205, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "getClass", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 217, - "end": 225, - "ctxt": 0 - }, - "value": "getField", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 230, - "end": 251, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 230, - "end": 250, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 230, - "end": 242, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 230, - "end": 240, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 232, - "end": 240, - "ctxt": 0 - }, - "value": "getClass", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 243, - "end": 250, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 244, - "end": 250, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 261, - "end": 281, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 261, - "end": 280, - "ctxt": 0 - }, - "object": { - "type": "CallExpression", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 261, - "end": 271, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 263, - "end": 271, - "ctxt": 0 - }, - "value": "getClass", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "PrivateName", - "span": { - "start": 274, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "value": "field", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.ts b/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.ts deleted file mode 100644 index 1b8a5c082cc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNameStaticMethodClassExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -// @target: es2015 - -const C = class D { - static #field = D.#method(); - static #method() { return 42; } - static getClass() { return D; } - static getField() { return C.#field }; -} - -console.log(C.getClass().getField()); -C.getClass().#method; // Error -C.getClass().#field; // Error - diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.json b/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.json deleted file mode 100644 index aa45698aef1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 153, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 18, - "end": 21, - "ctxt": 0 - }, - "value": "dec", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 25, - "end": 34, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 25, - "end": 34, - "ctxt": 0 - }, - "value": "target", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 31, - "end": 34, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1, - "end": 39, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 21, - "end": 24, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 35, - "end": 38, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 37, - "end": 38, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 47, - "end": 48, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 41, - "end": 153, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 55, - "end": 97, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 88, - "end": 92, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 92, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 95, - "end": 96, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 56, - "end": 59, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 102, - "end": 151, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 135, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 136, - "end": 139, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 102, - "end": 106, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 103, - "end": 106, - "ctxt": 0 - }, - "value": "dec", - "optional": false - } - } - ], - "span": { - "start": 102, - "end": 151, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 148, - "end": 151, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 141, - "end": 147, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 143, - "end": 147, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.ts deleted file mode 100644 index d82e05ef973..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndDecorators.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare function dec(target: T): T; - -class A { - @dec // Error - #foo = 1; - @dec // Error - #bar(): void { } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.json b/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.json deleted file mode 100644 index d292ac5a544..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.json +++ /dev/null @@ -1,1118 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 528, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 279, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 52, - "end": 60, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 52, - "end": 56, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 56, - "end": 59, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 65, - "end": 106, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 65, - "end": 69, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 66, - "end": 69, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 65, - "end": 106, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 75, - "end": 106, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 83, - "end": 100, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 90, - "end": 99, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 90, - "end": 94, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 95, - "end": 99, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 71, - "end": 74, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 73, - "end": 74, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 73, - "end": 74, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "Constructor", - "span": { - "start": 111, - "end": 180, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 111, - "end": 122, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 123, - "end": 127, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 123, - "end": 127, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 127, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 129, - "end": 180, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 137, - "end": 151, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 137, - "end": 150, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 137, - "end": 146, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 137, - "end": 141, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 142, - "end": 146, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 158, - "end": 174, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 158, - "end": 173, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "CallExpression", - "span": { - "start": 162, - "end": 173, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 162, - "end": 171, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 162, - "end": 166, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 167, - "end": 171, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - } - }, - "arguments": [], - "typeArguments": null - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 185, - "end": 228, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 189, - "end": 192, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 193, - "end": 197, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 193, - "end": 197, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 185, - "end": 228, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 199, - "end": 228, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 207, - "end": 221, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 207, - "end": 220, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 207, - "end": 216, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 233, - "end": 277, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 237, - "end": 240, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 233, - "end": 277, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 246, - "end": 277, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 254, - "end": 271, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 261, - "end": 270, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 261, - "end": 265, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 266, - "end": 270, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 242, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 42, - "end": 45, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 281, - "end": 298, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 285, - "end": 297, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 289, - "end": 297, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 293, - "end": 294, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 295, - "end": 296, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 299, - "end": 322, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 303, - "end": 321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 307, - "end": 321, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 313, - "end": 320, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 324, - "end": 333, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 324, - "end": 333, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 324, - "end": 329, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 324, - "end": 325, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 326, - "end": 329, - "ctxt": 0 - }, - "value": "baz", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 372, - "end": 395, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 378, - "end": 395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 379, - "end": 387, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 390, - "end": 395, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 392, - "end": 395, - "ctxt": 0 - }, - "value": "baz", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 420, - "end": 427, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 420, - "end": 426, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 420, - "end": 421, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 422, - "end": 426, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 471, - "end": 477, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 471, - "end": 476, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 471, - "end": 472, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 475, - "end": 476, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 522, - "end": 528, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 522, - "end": 527, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 522, - "end": 523, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 526, - "end": 527, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.ts deleted file mode 100644 index 07949a13392..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndGenericClasses-2.ts +++ /dev/null @@ -1,29 +0,0 @@ -// @strict: true -// @target: es6 - -class C { - #foo: T; - #bar(): T { - return this.#foo; - } - constructor(t: T) { - this.#foo = t; - t = this.#bar(); - } - set baz(t: T) { - this.#foo = t; - - } - get baz(): T { - return this.#foo; - } -} - -let a = new C(3); -let b = new C("hello"); - -a.baz = 5 // OK -const x: number = a.baz // OK -a.#foo; // Error -a = b; // Error -b = a; // Error diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.json b/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.json deleted file mode 100644 index 7b5ef6c5ea9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.json +++ /dev/null @@ -1,603 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 521, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 193, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 49, - "end": 69, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 56, - "end": 60, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 60, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 60, - "end": 68, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 62, - "end": 68, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateProperty", - "span": { - "start": 74, - "end": 94, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 81, - "end": 85, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 82, - "end": 85, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 85, - "end": 93, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 87, - "end": 93, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 99, - "end": 191, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 99, - "end": 110, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 114, - "end": 191, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 124, - "end": 135, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 124, - "end": 134, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 124, - "end": 130, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 124, - "end": 125, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 127, - "end": 130, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": 3.0, - "raw": "3" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 144, - "end": 151, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 144, - "end": 150, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 146, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 169, - "end": 176, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 169, - "end": 175, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 169, - "end": 170, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 172, - "end": 175, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 195, - "end": 317, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 219, - "end": 239, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 226, - "end": 230, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 227, - "end": 230, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 230, - "end": 238, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 244, - "end": 315, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 244, - "end": 255, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 259, - "end": 315, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 269, - "end": 277, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 269, - "end": 276, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 286, - "end": 309, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 286, - "end": 308, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 286, - "end": 292, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 288, - "end": 292, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 289, - "end": 292, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 295, - "end": 308, - "ctxt": 0 - }, - "value": "some string", - "raw": "\"some string\"" - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 477, - "end": 521, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 483, - "end": 520, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 483, - "end": 499, - "ctxt": 0 - }, - "value": "willErrorSomeDay", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 499, - "end": 509, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeQuery", - "span": { - "start": 501, - "end": 509, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 508, - "end": 509, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeArguments": null - } - } - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 512, - "end": 520, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.ts deleted file mode 100644 index 6ca19bec62b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticFields.ts +++ /dev/null @@ -1,24 +0,0 @@ -// @strict: true -// @target: es6 - -class A { - static #foo: number; - static #bar: number; - constructor () { - A.#foo = 3; - B.#foo; // Error - B.#bar; // Error - } -} - -class B extends A { - static #foo: string; - constructor () { - super(); - B.#foo = "some string"; - } -} - -// We currently filter out static private identifier fields in `getUnmatchedProperties`. -// We will need a more robust solution when we support static fields -const willErrorSomeDay: typeof A = class {}; // OK for now diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.json b/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.json deleted file mode 100644 index 77f3bc08d86..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.json +++ /dev/null @@ -1,2346 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 75, - "end": 960, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 75, - "end": 696, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 92, - "end": 100, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 92, - "end": 96, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 93, - "end": 96, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 98, - "end": 99, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 98, - "end": 99, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 105, - "end": 139, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 105, - "end": 112, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 106, - "end": 112, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 105, - "end": 139, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 118, - "end": 139, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 120, - "end": 137, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 127, - "end": 136, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 127, - "end": 131, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 132, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 133, - "end": 136, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 144, - "end": 180, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 144, - "end": 180, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 159, - "end": 180, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 161, - "end": 178, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 168, - "end": 177, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 168, - "end": 172, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 173, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "PrivateMethod", - "span": { - "start": 185, - "end": 228, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 189, - "end": 194, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 190, - "end": 194, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 195, - "end": 204, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 195, - "end": 204, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 201, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 185, - "end": 228, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 206, - "end": 228, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 208, - "end": 226, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 208, - "end": 225, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 208, - "end": 217, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 208, - "end": 212, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 213, - "end": 217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 220, - "end": 225, - "ctxt": 0 - }, - "value": "value", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 238, - "end": 269, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 242, - "end": 249, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 242, - "end": 249, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 243, - "end": 249, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 245, - "end": 249, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 245, - "end": 246, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 246, - "end": 249, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 238, - "end": 269, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 251, - "end": 269, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 253, - "end": 267, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 260, - "end": 266, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 260, - "end": 261, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 262, - "end": 266, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 289, - "end": 326, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 289, - "end": 293, - "ctxt": 0 - }, - "value": "bar2", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 294, - "end": 301, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 294, - "end": 301, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 297, - "end": 301, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 297, - "end": 298, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 289, - "end": 326, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 303, - "end": 326, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 305, - "end": 324, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 312, - "end": 323, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 315, - "end": 321, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 340, - "end": 373, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 340, - "end": 344, - "ctxt": 0 - }, - "value": "bar3", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 345, - "end": 352, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 345, - "end": 352, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 346, - "end": 352, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 348, - "end": 349, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 349, - "end": 352, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 340, - "end": 373, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 354, - "end": 373, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 356, - "end": 371, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 363, - "end": 370, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 363, - "end": 364, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 365, - "end": 370, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 392, - "end": 428, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 392, - "end": 395, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 396, - "end": 408, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 396, - "end": 408, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 397, - "end": 408, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 399, - "end": 408, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 399, - "end": 400, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 400, - "end": 408, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 401, - "end": 407, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 392, - "end": 428, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 410, - "end": 428, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 412, - "end": 426, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 419, - "end": 425, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 421, - "end": 425, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 422, - "end": 425, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 443, - "end": 483, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 443, - "end": 447, - "ctxt": 0 - }, - "value": "baz2", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 448, - "end": 460, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 448, - "end": 460, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 449, - "end": 460, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 451, - "end": 460, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 452, - "end": 460, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 453, - "end": 459, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 443, - "end": 483, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 462, - "end": 483, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 464, - "end": 481, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 471, - "end": 480, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 471, - "end": 472, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 473, - "end": 480, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 474, - "end": 480, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 494, - "end": 532, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 494, - "end": 498, - "ctxt": 0 - }, - "value": "baz3", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 499, - "end": 511, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 499, - "end": 511, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 500, - "end": 511, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 502, - "end": 511, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 502, - "end": 503, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 503, - "end": 511, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 504, - "end": 510, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 494, - "end": 532, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 513, - "end": 532, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 515, - "end": 530, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 522, - "end": 529, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 522, - "end": 523, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 524, - "end": 529, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 525, - "end": 529, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 546, - "end": 583, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 546, - "end": 550, - "ctxt": 0 - }, - "value": "quux", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 551, - "end": 563, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 551, - "end": 563, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 552, - "end": 563, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 554, - "end": 563, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 554, - "end": 555, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 555, - "end": 563, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 556, - "end": 562, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 546, - "end": 583, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 565, - "end": 583, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 567, - "end": 581, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 574, - "end": 580, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 574, - "end": 575, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 576, - "end": 580, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 577, - "end": 580, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 597, - "end": 638, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 597, - "end": 602, - "ctxt": 0 - }, - "value": "quux2", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 603, - "end": 615, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 603, - "end": 615, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 604, - "end": 615, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 606, - "end": 615, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 607, - "end": 615, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 608, - "end": 614, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 597, - "end": 638, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 617, - "end": 638, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 619, - "end": 636, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 626, - "end": 635, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 626, - "end": 627, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 628, - "end": 635, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 629, - "end": 635, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 648, - "end": 687, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 648, - "end": 653, - "ctxt": 0 - }, - "value": "quux3", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 654, - "end": 666, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 654, - "end": 666, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 655, - "end": 666, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 657, - "end": 666, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 657, - "end": 658, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 658, - "end": 666, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 659, - "end": 665, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 648, - "end": 687, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 668, - "end": 687, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 670, - "end": 685, - "ctxt": 0 - }, - "argument": { - "type": "MemberExpression", - "span": { - "start": 677, - "end": 684, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 677, - "end": 678, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 679, - "end": 684, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 680, - "end": 684, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 82, - "end": 85, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 83, - "end": 84, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 83, - "end": 84, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 698, - "end": 723, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 710, - "end": 722, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 710, - "end": 711, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 711, - "end": 722, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 713, - "end": 722, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 713, - "end": 714, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 714, - "end": 722, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 715, - "end": 721, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 724, - "end": 749, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 736, - "end": 748, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 736, - "end": 737, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 737, - "end": 748, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 739, - "end": 748, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 739, - "end": 740, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 740, - "end": 748, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 741, - "end": 747, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 750, - "end": 757, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 750, - "end": 756, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 750, - "end": 751, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 752, - "end": 756, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 753, - "end": 756, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 801, - "end": 811, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 801, - "end": 810, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 801, - "end": 802, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 803, - "end": 810, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 804, - "end": 810, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 852, - "end": 860, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 852, - "end": 859, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 852, - "end": 853, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 854, - "end": 859, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 855, - "end": 859, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 903, - "end": 909, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 903, - "end": 908, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 903, - "end": 904, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 907, - "end": 908, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 954, - "end": 960, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 954, - "end": 959, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 954, - "end": 955, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 958, - "end": 959, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.ts deleted file mode 100644 index 6cf7b3304d9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInGenericClasses.ts +++ /dev/null @@ -1,30 +0,0 @@ -// @strict: true -// @target: es6 -// @strictPropertyInitialization: false - -class C { - #foo: T; - #method(): T { return this.#foo; } - get #prop(): T { return this.#foo; } - set #prop(value : T) { this.#foo = value; } - - bar(x: C) { return x.#foo; } // OK - bar2(x: C) { return x.#method(); } // OK - bar3(x: C) { return x.#prop; } // OK - - baz(x: C) { return x.#foo; } // OK - baz2(x: C) { return x.#method; } // OK - baz3(x: C) { return x.#prop; } // OK - - quux(x: C) { return x.#foo; } // OK - quux2(x: C) { return x.#method; }// OK - quux3(x: C) { return x.#prop; } // OK -} - -declare let a: C; -declare let b: C; -a.#foo; // Error -a.#method; // Error -a.#prop; // Error -a = b; // Error -b = a; // Error diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.json b/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.json deleted file mode 100644 index 3d6d26fb7c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.json +++ /dev/null @@ -1,1018 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 581, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 562, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 48, - "end": 66, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 48, - "end": 52, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 55, - "end": 65, - "ctxt": 0 - }, - "value": "A's #foo", - "raw": "\"A's #foo\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "PrivateProperty", - "span": { - "start": 70, - "end": 88, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 70, - "end": 74, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 74, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 77, - "end": 87, - "ctxt": 0 - }, - "value": "A's #bar", - "raw": "\"A's #bar\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 92, - "end": 560, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 92, - "end": 98, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 92, - "end": 560, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 102, - "end": 560, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 111, - "end": 433, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 132, - "end": 150, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 132, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 133, - "end": 136, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 139, - "end": 149, - "ctxt": 0 - }, - "value": "B's #foo", - "raw": "\"B's #foo\"" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 162, - "end": 265, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 167, - "end": 173, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 167, - "end": 173, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 168, - "end": 173, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 170, - "end": 173, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 162, - "end": 265, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 175, - "end": 265, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 192, - "end": 199, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 192, - "end": 198, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 194, - "end": 198, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 277, - "end": 357, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 282, - "end": 286, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 282, - "end": 286, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 277, - "end": 357, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 288, - "end": 357, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 305, - "end": 312, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 305, - "end": 311, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 307, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 369, - "end": 424, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 369, - "end": 373, - "ctxt": 0 - }, - "value": "quux", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 375, - "end": 379, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 375, - "end": 379, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 369, - "end": 424, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 381, - "end": 424, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 398, - "end": 405, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 398, - "end": 404, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 400, - "end": 404, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 441, - "end": 459, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 447, - "end": 458, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 447, - "end": 448, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 451, - "end": 458, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 455, - "end": 456, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 467, - "end": 482, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 467, - "end": 481, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 467, - "end": 478, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 467, - "end": 474, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 471, - "end": 472, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "value": "bar", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 479, - "end": 480, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 490, - "end": 505, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 490, - "end": 504, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 490, - "end": 501, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 490, - "end": 497, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "value": "baz", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 502, - "end": 503, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "typeArguments": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 531, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 519, - "end": 530, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 519, - "end": 520, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 523, - "end": 530, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 527, - "end": 528, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 539, - "end": 555, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 539, - "end": 554, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 539, - "end": 551, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 539, - "end": 546, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 543, - "end": 544, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 547, - "end": 551, - "ctxt": 0 - }, - "value": "quux", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 552, - "end": 553, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 564, - "end": 581, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 564, - "end": 580, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 564, - "end": 578, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 564, - "end": 571, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 568, - "end": 569, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "arguments": [], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 572, - "end": 578, - "ctxt": 0 - }, - "value": "method", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.ts deleted file mode 100644 index 2f9466477e8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-1.ts +++ /dev/null @@ -1,28 +0,0 @@ -// @strict: true -// @target: es6 - -class A { - #foo = "A's #foo"; - #bar = "A's #bar"; - method () { - class B { - #foo = "B's #foo"; - bar (a: any) { - a.#foo; // OK, no compile-time error, don't know what `a` is - } - baz (a: A) { - a.#foo; // compile-time error, shadowed - } - quux (b: B) { - b.#foo; // OK - } - } - const a = new A(); - new B().bar(a); - new B().baz(a); - const b = new B(); - new B().quux(b); - } -} - -new A().method(); diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.json b/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.json deleted file mode 100644 index 6e066963098..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 322, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 322, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 49, - "end": 63, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 56, - "end": 58, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 58, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 68, - "end": 320, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 68, - "end": 79, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 83, - "end": 320, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 99, - "end": 100, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 93, - "end": 314, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 115, - "end": 122, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 115, - "end": 117, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": 5.0, - "raw": "5" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 135, - "end": 304, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 135, - "end": 146, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 149, - "end": 304, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 173, - "end": 174, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 167, - "end": 290, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 197, - "end": 272, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 197, - "end": 208, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 211, - "end": 272, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 237, - "end": 241, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 237, - "end": 241, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 237, - "end": 238, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 239, - "end": 241, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 240, - "end": 241, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.ts deleted file mode 100644 index 385356b9f11..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInNestedClasses-2.ts +++ /dev/null @@ -1,18 +0,0 @@ -// @strict: true -// @target: es6 - -class A { - static #x = 5; - constructor () { - class B { - #x = 5; - constructor() { - class C { - constructor() { - A.#x // error - } - } - } - } - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.json b/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.json deleted file mode 100644 index 5222c9856e9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.json +++ /dev/null @@ -1,425 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 21, - "end": 158, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 28, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 21, - "end": 89, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 35, - "end": 40, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 40, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 46, - "end": 87, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 46, - "end": 50, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 51, - "end": 55, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 51, - "end": 55, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 54, - "end": 55, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 54, - "end": 55, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 46, - "end": 87, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 57, - "end": 87, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 67, - "end": 81, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 67, - "end": 80, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 67, - "end": 74, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 67, - "end": 68, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 69, - "end": 74, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 70, - "end": 74, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 77, - "end": 80, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 90, - "end": 114, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 100, - "end": 101, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 114, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 125, - "end": 129, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 131, - "end": 134, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 116, - "end": 158, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 136, - "end": 158, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 142, - "end": 156, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 142, - "end": 155, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "PrivateName", - "span": { - "start": 144, - "end": 149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 145, - "end": 149, - "ctxt": 0 - }, - "value": "prop", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.ts deleted file mode 100644 index c330e117003..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesInterfaceExtendingClass.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @target: es2015 - -class C { - #prop; - func(x: I) { - x.#prop = 123; - } -} -interface I extends C {} - -function func(x: I) { - x.#prop = 123; -} - diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.json b/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.json deleted file mode 100644 index 907cb93569f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 35, - "end": 177, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "span": { - "start": 35, - "end": 177, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "PrivateProperty", - "span": { - "start": 49, - "end": 56, - "ctxt": 0 - }, - "key": { - "type": "PrivateName", - "span": { - "start": 49, - "end": 51, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 54, - "end": 55, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isOptional": false, - "isOverride": false, - "readonly": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 61, - "end": 175, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 61, - "end": 72, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 75, - "end": 175, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 85, - "end": 100, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 85, - "end": 99, - "ctxt": 0 - }, - "operator": "delete", - "argument": { - "type": "MemberExpression", - "span": { - "start": 92, - "end": 99, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 92, - "end": 96, - "ctxt": 0 - } - }, - "property": { - "type": "PrivateName", - "span": { - "start": 97, - "end": 99, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 98, - "end": 99, - "ctxt": 0 - }, - "value": "v", - "optional": false - } - } - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.ts b/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.ts deleted file mode 100644 index e9801a2a047..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/privateNamesNoDelete.ts +++ /dev/null @@ -1,9 +0,0 @@ -// @strict: true -// @target: es6 - -class A { - #v = 1; - constructor() { - delete this.#v; // Error: The operand of a delete operator cannot be a private name. - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.json b/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.json new file mode 100644 index 00000000000..bb80d517666 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.json @@ -0,0 +1,162 @@ +{ + "type": "Module", + "span": { + "start": 68, + "end": 207, + "ctxt": 0 + }, + "body": [ + { + "type": "ExpressionStatement", + "span": { + "start": 68, + "end": 101, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 68, + "end": 100, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 68, + "end": 82, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 68, + "end": 74, + "ctxt": 0 + }, + "value": "module", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 75, + "end": 82, + "ctxt": 0 + }, + "value": "exports", + "optional": false + } + }, + "right": { + "type": "ObjectExpression", + "span": { + "start": 85, + "end": 100, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 89, + "end": 92, + "ctxt": 0 + }, + "value": "str", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 94, + "end": 97, + "ctxt": 0 + }, + "value": "x", + "raw": "'x'" + } + } + ] + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 135, + "end": 183, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "span": { + "start": 142, + "end": 158, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 147, + "end": 158, + "ctxt": 0 + }, + "value": "tsConstants", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 164, + "end": 182, + "ctxt": 0 + }, + "value": "../lib/constants", + "raw": "\"../lib/constants\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 184, + "end": 207, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 193, + "end": 204, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 193, + "end": 204, + "ctxt": 0 + }, + "value": "tsConstants", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.ts b/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.ts new file mode 100644 index 00000000000..860692e393a --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/reExportJsFromTs.ts @@ -0,0 +1,11 @@ +// @allowJs: true +// @outDir: out + +// @Filename: /lib/constants.js +module.exports = { + str: 'x', +}; + +// @Filename: /src/constants.ts +import * as tsConstants from "../lib/constants"; +export { tsConstants }; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.json b/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.json deleted file mode 100644 index f047d6c7057..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 198, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 15, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 15, - "end": 26, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 27, - "end": 45, - "ctxt": 0 - }, - "decorators": [], - "accessibility": null, - "override": false, - "readonly": true, - "param": { - "type": "Identifier", - "span": { - "start": 36, - "end": 45, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 37, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 47, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 52, - "end": 67, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 52, - "end": 66, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 52, - "end": 62, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 52, - "end": 60, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 58, - "end": 59, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 65, - "end": 66, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 75, - "end": 76, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": false, - "span": { - "start": 69, - "end": 126, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 83, - "end": 124, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 83, - "end": 94, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 95, - "end": 120, - "ctxt": 0 - }, - "decorators": [], - "accessibility": null, - "override": false, - "readonly": true, - "param": { - "type": "Identifier", - "span": { - "start": 111, - "end": 120, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 112, - "end": 120, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 114, - "end": 120, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 122, - "end": 124, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "declare": false, - "span": { - "start": 128, - "end": 186, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 142, - "end": 184, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 142, - "end": 153, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 154, - "end": 180, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "private", - "override": false, - "readonly": true, - "param": { - "type": "Identifier", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 182, - "end": 184, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 187, - "end": 198, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 187, - "end": 197, - "ctxt": 0 - }, - "object": { - "type": "NewExpression", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - }, - "property": { - "type": "Identifier", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.ts b/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.ts deleted file mode 100644 index d625d14a4a2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.ts +++ /dev/null @@ -1,13 +0,0 @@ -class C { - constructor(readonly x: number) {} -} -new C(1).x = 2; - -class E { - constructor(readonly public x: number) {} -} - -class F { - constructor(private readonly x: number) {} -} -new F(1).x; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.json b/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.json deleted file mode 100644 index a61f92d19aa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 93, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 93, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 15, - "end": 43, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 33, - "end": 34, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 34, - "end": 42, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 36, - "end": 42, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": true, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 48, - "end": 91, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 48, - "end": 59, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 60, - "end": 87, - "ctxt": 0 - }, - "decorators": [], - "accessibility": null, - "override": false, - "readonly": true, - "param": { - "type": "Identifier", - "span": { - "start": 78, - "end": 87, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 81, - "end": 87, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 89, - "end": 91, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.ts b/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.ts deleted file mode 100644 index 727754f0d26..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/readonlyReadonly.ts +++ /dev/null @@ -1,4 +0,0 @@ -class C { - readonly readonly x: number; - constructor(readonly readonly y: number) {} -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/recursiveIntersectionTypes.ts b/crates/swc_ecma_parser/tests/tsc/recursiveIntersectionTypes.ts index fceeb7e2afc..4118723b76a 100644 --- a/crates/swc_ecma_parser/tests/tsc/recursiveIntersectionTypes.ts +++ b/crates/swc_ecma_parser/tests/tsc/recursiveIntersectionTypes.ts @@ -1,4 +1,4 @@ -type LinkedList = T & { next: LinkedList }; +type LinkedList = T & { next: LinkedList }; interface Entity { name: string; diff --git a/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.json b/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.json new file mode 100644 index 00000000000..27b83803785 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.json @@ -0,0 +1,667 @@ +{ + "type": "Module", + "span": { + "start": 110, + "end": 417, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 110, + "end": 183, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 126, + "end": 129, + "ctxt": 0 + }, + "value": "art", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 130, + "end": 140, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 130, + "end": 140, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 135, + "end": 140, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 137, + "end": 140, + "ctxt": 0 + }, + "kind": "any" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 142, + "end": 166, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 142, + "end": 166, + "ctxt": 0 + }, + "value": "message", + "optional": true, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 150, + "end": 166, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 152, + "end": 166, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 152, + "end": 158, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 161, + "end": 166, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 161, + "end": 166, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 117, + "end": 183, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 167, + "end": 182, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypePredicate", + "span": { + "start": 169, + "end": 182, + "ctxt": 0 + }, + "asserts": true, + "paramName": { + "type": "Identifier", + "span": { + "start": 177, + "end": 182, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "typeAnnotation": null + } + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 224, + "end": 227, + "ctxt": 0 + }, + "value": "art", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 228, + "end": 238, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 228, + "end": 238, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 233, + "end": 238, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 235, + "end": 238, + "ctxt": 0 + }, + "kind": "any" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 240, + "end": 264, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 240, + "end": 264, + "ctxt": 0 + }, + "value": "message", + "optional": true, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 248, + "end": 264, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 250, + "end": 264, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 250, + "end": 256, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 259, + "end": 264, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 259, + "end": 264, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "typeParams": null + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 207, + "end": 281, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 265, + "end": 280, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypePredicate", + "span": { + "start": 267, + "end": 280, + "ctxt": 0 + }, + "asserts": true, + "paramName": { + "type": "Identifier", + "span": { + "start": 275, + "end": 280, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "typeAnnotation": null + } + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 282, + "end": 295, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 291, + "end": 294, + "ctxt": 0 + }, + "value": "art", + "optional": false + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 319, + "end": 350, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 325, + "end": 350, + "ctxt": 0 + }, + "id": { + "type": "ObjectPattern", + "span": { + "start": 325, + "end": 332, + "ctxt": 0 + }, + "properties": [ + { + "type": "AssignmentPatternProperty", + "span": { + "start": 327, + "end": 330, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 327, + "end": 330, + "ctxt": 0 + }, + "value": "art", + "optional": false + }, + "value": null + } + ], + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 335, + "end": 350, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 335, + "end": 342, + "ctxt": 0 + }, + "value": "require", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 343, + "end": 349, + "ctxt": 0 + }, + "value": "./ex", + "raw": "'./ex'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 351, + "end": 381, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 357, + "end": 381, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 357, + "end": 362, + "ctxt": 0 + }, + "value": "artoo", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 365, + "end": 381, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 365, + "end": 372, + "ctxt": 0 + }, + "value": "require", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 373, + "end": 380, + "ctxt": 0 + }, + "value": "./ex2", + "raw": "'./ex2'" + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 382, + "end": 391, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 386, + "end": 391, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 386, + "end": 387, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 390, + "end": 391, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 392, + "end": 398, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 392, + "end": 398, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 392, + "end": 395, + "ctxt": 0 + }, + "value": "art", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 396, + "end": 397, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 399, + "end": 408, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 403, + "end": 408, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 403, + "end": 404, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 407, + "end": 408, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 409, + "end": 417, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 409, + "end": 417, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 409, + "end": 414, + "ctxt": 0 + }, + "value": "artoo", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 415, + "end": 416, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.ts b/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.ts new file mode 100644 index 00000000000..ccdd8353ba8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/requireAssertsFromTypescript.ts @@ -0,0 +1,16 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @Filename: ex.d.ts +// based on assert in @types/node +export function art(value: any, message?: string | Error): asserts value; +// @Filename: ex2.d.ts +declare function art(value: any, message?: string | Error): asserts value; +export = art; +// @Filename: 38379.js +const { art } = require('./ex') +const artoo = require('./ex2') +let x = 1 +art(x) +let y = 1 +artoo(y) diff --git a/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.json b/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.json deleted file mode 100644 index bf6112dec1c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 50, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 17, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 5, - "end": 16, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 5, - "end": 6, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 6, - "end": 16, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 8, - "end": 16, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 8, - "end": 14, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 18, - "end": 34, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 22, - "end": 33, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 23, - "end": 33, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 25, - "end": 33, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 25, - "end": 31, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 35, - "end": 50, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 35, - "end": 49, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "ArrayPattern", - "span": { - "start": 35, - "end": 45, - "ctxt": 0 - }, - "elements": [ - { - "type": "RestElement", - "span": { - "start": 39, - "end": 44, - "ctxt": 0 - }, - "rest": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "argument": { - "type": "AssignmentPattern", - "span": { - "start": 39, - "end": 44, - "ctxt": 0 - }, - "left": { - "type": "Identifier", - "span": { - "start": 39, - "end": 40, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "Identifier", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.ts b/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.ts deleted file mode 100644 index f5792435ff7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/restElementWithInitializer2.ts +++ /dev/null @@ -1,3 +0,0 @@ -var a: number[]; -var x: number[]; -[...x = a] = a; // Error, rest element cannot have initializer diff --git a/crates/swc_ecma_parser/tests/tsc/scannerS7.2_A1.5_T2.ts b/crates/swc_ecma_parser/tests/tsc/scannerS7.2_A1.5_T2.ts index e4635e69710..23215cb5751 100644 --- a/crates/swc_ecma_parser/tests/tsc/scannerS7.2_A1.5_T2.ts +++ b/crates/swc_ecma_parser/tests/tsc/scannerS7.2_A1.5_T2.ts @@ -1,4 +1,4 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** diff --git a/crates/swc_ecma_parser/tests/tsc/scannerS7.6_A4.2_T1.ts b/crates/swc_ecma_parser/tests/tsc/scannerS7.6_A4.2_T1.ts index e588b8c1578..15392475354 100644 --- a/crates/swc_ecma_parser/tests/tsc/scannerS7.6_A4.2_T1.ts +++ b/crates/swc_ecma_parser/tests/tsc/scannerS7.6_A4.2_T1.ts @@ -1,4 +1,4 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** diff --git a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.json b/crates/swc_ecma_parser/tests/tsc/seeTag4.json similarity index 72% rename from crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.json rename to crates/swc_ecma_parser/tests/tsc/seeTag4.json index 8a3bcfb9771..3767b343c04 100644 --- a/crates/swc_ecma_parser/tests/tsc/parserVariableDeclaration5.json +++ b/crates/swc_ecma_parser/tests/tsc/seeTag4.json @@ -1,36 +1,36 @@ { "type": "Script", "span": { - "start": 1, - "end": 7, + "start": 180, + "end": 188, "ctxt": 0 }, "body": [ { "type": "VariableDeclaration", "span": { - "start": 1, - "end": 7, + "start": 180, + "end": 188, "ctxt": 0 }, - "kind": "var", + "kind": "let", "declare": false, "declarations": [ { "type": "VariableDeclarator", "span": { - "start": 5, - "end": 6, + "start": 184, + "end": 187, "ctxt": 0 }, "id": { "type": "Identifier", "span": { - "start": 5, - "end": 6, + "start": 184, + "end": 187, "ctxt": 0 }, - "value": "a", + "value": "foo", "optional": false, "typeAnnotation": null }, diff --git a/crates/swc_ecma_parser/tests/tsc/seeTag4.ts b/crates/swc_ecma_parser/tests/tsc/seeTag4.ts new file mode 100644 index 00000000000..d7973751555 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/seeTag4.ts @@ -0,0 +1,15 @@ +// @checkJs: true +// @allowJs: true +// @outdir: out/ +// @filename: seeTag4.js + +/** + * @typedef {any} A + */ + +/** + * @see {@link A} + * @see {@linkcode A} + * @see {@linkplain A} + */ +let foo; diff --git a/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.json b/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.json index 40d99f08a58..a312ca893d2 100644 --- a/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.json +++ b/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 63, - "end": 481, + "end": 772, "ctxt": 0 }, "body": [ @@ -786,6 +786,564 @@ } ] } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 487, + "end": 525, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 494, + "end": 495, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 496, + "end": 525, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 500, + "end": 523, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 507, + "end": 523, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 512, + "end": 513, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 516, + "end": 522, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 527, + "end": 585, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 534, + "end": 535, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 536, + "end": 585, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 540, + "end": 562, + "ctxt": 0 + }, + "declare": false, + "isExport": true, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 554, + "end": 555, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 558, + "end": 559, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 560, + "end": 561, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 565, + "end": 583, + "ctxt": 0 + }, + "declaration": { + "type": "TsModuleDeclaration", + "span": { + "start": 572, + "end": 583, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 579, + "end": 580, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 581, + "end": 583, + "ctxt": 0 + }, + "body": [] + } + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 587, + "end": 619, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 594, + "end": 595, + "ctxt": 0 + }, + "value": "c", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 596, + "end": 619, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 600, + "end": 617, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 607, + "end": 610, + "ctxt": 0 + }, + "value": "any", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 613, + "end": 614, + "ctxt": 0 + }, + "value": "b", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 615, + "end": 616, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 625, + "end": 660, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 632, + "end": 633, + "ctxt": 0 + }, + "value": "q", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 634, + "end": 660, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 638, + "end": 658, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 645, + "end": 658, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 651, + "end": 657, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 651, + "end": 652, + "ctxt": 0 + }, + "value": "Q", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 655, + "end": 657, + "ctxt": 0 + }, + "properties": [] + }, + "definite": false + } + ] + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 662, + "end": 725, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 669, + "end": 670, + "ctxt": 0 + }, + "value": "r", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 671, + "end": 725, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 675, + "end": 697, + "ctxt": 0 + }, + "declare": false, + "isExport": true, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 689, + "end": 690, + "ctxt": 0 + }, + "value": "Q", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 693, + "end": 694, + "ctxt": 0 + }, + "value": "q", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 695, + "end": 696, + "ctxt": 0 + }, + "value": "Q", + "optional": false + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 700, + "end": 723, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 707, + "end": 723, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 712, + "end": 713, + "ctxt": 0 + }, + "value": "Q", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 716, + "end": 722, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 727, + "end": 772, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 734, + "end": 735, + "ctxt": 0 + }, + "value": "s", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 736, + "end": 772, + "ctxt": 0 + }, + "body": [ + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 740, + "end": 755, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 747, + "end": 748, + "ctxt": 0 + }, + "value": "Q", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 751, + "end": 752, + "ctxt": 0 + }, + "value": "r", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 753, + "end": 754, + "ctxt": 0 + }, + "value": "Q", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 758, + "end": 770, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 764, + "end": 769, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 764, + "end": 765, + "ctxt": 0 + }, + "value": "Q", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 768, + "end": 769, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + } + ] + } } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.ts b/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.ts index 2bc170f90e9..3a0aec1e394 100644 --- a/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.ts +++ b/crates/swc_ecma_parser/tests/tsc/shadowedInternalModule.ts @@ -30,4 +30,35 @@ module Z { import Y = X.Y; var Y = 12; -} \ No newline at end of file +} + +// + +module a { + export type A = number; +} + +module b { + export import A = a.A; + export module A {} +} + +module c { + import any = b.A; +} + +// + +module q { + export const Q = {}; +} + +module r { + export import Q = q.Q; + export type Q = number; +} + +module s { + import Q = r.Q; + const Q = 0; +} diff --git a/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.json b/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.json deleted file mode 100644 index 84115d5f364..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.json +++ /dev/null @@ -1,4127 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 25, - "end": 3696, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 31, - "end": 41, - "ctxt": 0 - }, - "value": "StaticName", - "optional": false - }, - "declare": false, - "span": { - "start": 25, - "end": 103, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 48, - "end": 68, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 59, - "end": 67, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 61, - "end": 67, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 82, - "end": 95, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 82, - "end": 86, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 86, - "end": 94, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 88, - "end": 94, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 111, - "end": 123, - "ctxt": 0 - }, - "value": "StaticNameFn", - "optional": false - }, - "declare": false, - "span": { - "start": 105, - "end": 177, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 137, - "end": 141, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 144, - "end": 146, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 160, - "end": 169, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 160, - "end": 164, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 160, - "end": 169, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 167, - "end": 169, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 195, - "end": 207, - "ctxt": 0 - }, - "value": "StaticLength", - "optional": false - }, - "declare": false, - "span": { - "start": 189, - "end": 273, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 214, - "end": 236, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 221, - "end": 227, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 227, - "end": 235, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 229, - "end": 235, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 250, - "end": 265, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 250, - "end": 256, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 256, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 258, - "end": 264, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 281, - "end": 295, - "ctxt": 0 - }, - "value": "StaticLengthFn", - "optional": false - }, - "declare": false, - "span": { - "start": 275, - "end": 353, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 302, - "end": 320, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 309, - "end": 315, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 302, - "end": 320, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 318, - "end": 320, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 334, - "end": 345, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 334, - "end": 340, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 334, - "end": 345, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 343, - "end": 345, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 374, - "end": 389, - "ctxt": 0 - }, - "value": "StaticPrototype", - "optional": false - }, - "declare": false, - "span": { - "start": 368, - "end": 461, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 396, - "end": 421, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 403, - "end": 412, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 412, - "end": 420, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 414, - "end": 420, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 435, - "end": 453, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 435, - "end": 444, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 444, - "end": 452, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 446, - "end": 452, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 469, - "end": 486, - "ctxt": 0 - }, - "value": "StaticPrototypeFn", - "optional": false - }, - "declare": false, - "span": { - "start": 463, - "end": 550, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 493, - "end": 514, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 500, - "end": 509, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 493, - "end": 514, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 512, - "end": 514, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 528, - "end": 542, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 528, - "end": 537, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 528, - "end": 542, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 540, - "end": 542, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 568, - "end": 580, - "ctxt": 0 - }, - "value": "StaticCaller", - "optional": false - }, - "declare": false, - "span": { - "start": 562, - "end": 646, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 587, - "end": 609, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 594, - "end": 600, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 600, - "end": 608, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 602, - "end": 608, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 623, - "end": 638, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 623, - "end": 629, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 629, - "end": 637, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 631, - "end": 637, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 654, - "end": 668, - "ctxt": 0 - }, - "value": "StaticCallerFn", - "optional": false - }, - "declare": false, - "span": { - "start": 648, - "end": 726, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 675, - "end": 693, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 682, - "end": 688, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 675, - "end": 693, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 691, - "end": 693, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 707, - "end": 718, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 707, - "end": 713, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 707, - "end": 718, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 716, - "end": 718, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 747, - "end": 762, - "ctxt": 0 - }, - "value": "StaticArguments", - "optional": false - }, - "declare": false, - "span": { - "start": 741, - "end": 834, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 769, - "end": 794, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 776, - "end": 785, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 785, - "end": 793, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 787, - "end": 793, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 808, - "end": 826, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 808, - "end": 817, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 817, - "end": 825, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 819, - "end": 825, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 842, - "end": 859, - "ctxt": 0 - }, - "value": "StaticArgumentsFn", - "optional": false - }, - "declare": false, - "span": { - "start": 836, - "end": 923, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 866, - "end": 887, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 873, - "end": 882, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 866, - "end": 887, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 885, - "end": 887, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 901, - "end": 915, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 901, - "end": 910, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 901, - "end": 915, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 913, - "end": 915, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 986, - "end": 1080, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 990, - "end": 1080, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 990, - "end": 1010, - "ctxt": 0 - }, - "value": "StaticName_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1013, - "end": 1080, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1025, - "end": 1045, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1032, - "end": 1036, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1036, - "end": 1044, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1038, - "end": 1044, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1059, - "end": 1072, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1059, - "end": 1063, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1063, - "end": 1071, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1065, - "end": 1071, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1082, - "end": 1170, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1086, - "end": 1170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1086, - "end": 1108, - "ctxt": 0 - }, - "value": "StaticNameFn_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1111, - "end": 1170, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1123, - "end": 1139, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1130, - "end": 1134, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1123, - "end": 1139, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1137, - "end": 1139, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1153, - "end": 1162, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1153, - "end": 1157, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1153, - "end": 1162, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1160, - "end": 1162, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1182, - "end": 1282, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1186, - "end": 1282, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1186, - "end": 1208, - "ctxt": 0 - }, - "value": "StaticLength_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1211, - "end": 1282, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1223, - "end": 1245, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1230, - "end": 1236, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1236, - "end": 1244, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1238, - "end": 1244, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1259, - "end": 1274, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1259, - "end": 1265, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1265, - "end": 1273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1267, - "end": 1273, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1284, - "end": 1378, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1288, - "end": 1378, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1288, - "end": 1312, - "ctxt": 0 - }, - "value": "StaticLengthFn_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1315, - "end": 1378, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1327, - "end": 1345, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1334, - "end": 1340, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1327, - "end": 1345, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1343, - "end": 1345, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1359, - "end": 1370, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1359, - "end": 1365, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1359, - "end": 1370, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1368, - "end": 1370, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1393, - "end": 1502, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1397, - "end": 1502, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1397, - "end": 1422, - "ctxt": 0 - }, - "value": "StaticPrototype_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1425, - "end": 1502, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1437, - "end": 1462, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1444, - "end": 1453, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1453, - "end": 1461, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1455, - "end": 1461, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1476, - "end": 1494, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1476, - "end": 1485, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1485, - "end": 1493, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1487, - "end": 1493, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1504, - "end": 1607, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1508, - "end": 1607, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1508, - "end": 1535, - "ctxt": 0 - }, - "value": "StaticPrototypeFn_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1538, - "end": 1607, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1550, - "end": 1571, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1557, - "end": 1566, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1550, - "end": 1571, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1569, - "end": 1571, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1585, - "end": 1599, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1585, - "end": 1594, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1585, - "end": 1599, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1597, - "end": 1599, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1619, - "end": 1719, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1623, - "end": 1719, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1645, - "ctxt": 0 - }, - "value": "StaticCaller_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1648, - "end": 1719, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1660, - "end": 1682, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1667, - "end": 1673, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1673, - "end": 1681, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1675, - "end": 1681, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1696, - "end": 1711, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1696, - "end": 1702, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1702, - "end": 1710, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1704, - "end": 1710, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1721, - "end": 1815, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1725, - "end": 1815, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1725, - "end": 1749, - "ctxt": 0 - }, - "value": "StaticCallerFn_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1752, - "end": 1815, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1764, - "end": 1782, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1777, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1764, - "end": 1782, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1780, - "end": 1782, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1796, - "end": 1807, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1796, - "end": 1802, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1796, - "end": 1807, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1805, - "end": 1807, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1830, - "end": 1939, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1834, - "end": 1939, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1834, - "end": 1859, - "ctxt": 0 - }, - "value": "StaticArguments_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1862, - "end": 1939, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1874, - "end": 1899, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1881, - "end": 1890, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1890, - "end": 1898, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1892, - "end": 1898, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1913, - "end": 1931, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1913, - "end": 1922, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1922, - "end": 1930, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1924, - "end": 1930, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1941, - "end": 2044, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1945, - "end": 2044, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1945, - "end": 1972, - "ctxt": 0 - }, - "value": "StaticArgumentsFn_Anonymous", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 1975, - "end": 2044, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 1987, - "end": 2008, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1994, - "end": 2003, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1987, - "end": 2008, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2006, - "end": 2008, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 2022, - "end": 2036, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2022, - "end": 2031, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2022, - "end": 2036, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2034, - "end": 2036, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "definite": false - } - ] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2113, - "end": 2247, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2120, - "end": 2148, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_1", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2149, - "end": 2247, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2161, - "end": 2171, - "ctxt": 0 - }, - "value": "StaticName", - "optional": false - }, - "declare": false, - "span": { - "start": 2155, - "end": 2245, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2182, - "end": 2202, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2189, - "end": 2193, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2193, - "end": 2201, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2195, - "end": 2201, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 2220, - "end": 2233, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2220, - "end": 2224, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2224, - "end": 2232, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2226, - "end": 2232, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2249, - "end": 2377, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2256, - "end": 2284, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_2", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2285, - "end": 2377, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2297, - "end": 2309, - "ctxt": 0 - }, - "value": "StaticNameFn", - "optional": false - }, - "declare": false, - "span": { - "start": 2291, - "end": 2375, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 2320, - "end": 2336, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2327, - "end": 2331, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2320, - "end": 2336, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2334, - "end": 2336, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 2354, - "end": 2363, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2354, - "end": 2358, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2354, - "end": 2363, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2361, - "end": 2363, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2389, - "end": 2544, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2396, - "end": 2424, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_3", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2425, - "end": 2544, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 2431, - "end": 2542, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 2452, - "end": 2464, - "ctxt": 0 - }, - "value": "StaticLength", - "optional": false - }, - "span": { - "start": 2446, - "end": 2542, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2475, - "end": 2497, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2482, - "end": 2488, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2488, - "end": 2496, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2490, - "end": 2496, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 2515, - "end": 2530, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2515, - "end": 2521, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2521, - "end": 2529, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2523, - "end": 2529, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2546, - "end": 2695, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2553, - "end": 2581, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_4", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2582, - "end": 2695, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 2588, - "end": 2693, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 2609, - "end": 2623, - "ctxt": 0 - }, - "value": "StaticLengthFn", - "optional": false - }, - "span": { - "start": 2603, - "end": 2693, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 2634, - "end": 2652, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2641, - "end": 2647, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2634, - "end": 2652, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2650, - "end": 2652, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 2670, - "end": 2681, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2670, - "end": 2676, - "ctxt": 0 - }, - "value": "length", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2670, - "end": 2681, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2679, - "end": 2681, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2710, - "end": 2878, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2717, - "end": 2745, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_5", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2746, - "end": 2878, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 2756, - "end": 2876, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 2777, - "end": 2792, - "ctxt": 0 - }, - "value": "StaticPrototype", - "optional": false - }, - "span": { - "start": 2771, - "end": 2876, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2803, - "end": 2828, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2810, - "end": 2819, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2819, - "end": 2827, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2821, - "end": 2827, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 2846, - "end": 2864, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2846, - "end": 2855, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2855, - "end": 2863, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2857, - "end": 2863, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 2880, - "end": 3038, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 2887, - "end": 2915, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_6", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 2916, - "end": 3038, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 2922, - "end": 3036, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 2943, - "end": 2960, - "ctxt": 0 - }, - "value": "StaticPrototypeFn", - "optional": false - }, - "span": { - "start": 2937, - "end": 3036, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 2971, - "end": 2992, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2978, - "end": 2987, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 2971, - "end": 2992, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2990, - "end": 2992, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 3010, - "end": 3024, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3010, - "end": 3019, - "ctxt": 0 - }, - "value": "prototype", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3010, - "end": 3024, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3022, - "end": 3024, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 3050, - "end": 3205, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 3057, - "end": 3085, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_7", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 3086, - "end": 3205, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 3092, - "end": 3203, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 3113, - "end": 3125, - "ctxt": 0 - }, - "value": "StaticCaller", - "optional": false - }, - "span": { - "start": 3107, - "end": 3203, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3136, - "end": 3158, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3143, - "end": 3149, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3149, - "end": 3157, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3151, - "end": 3157, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 3176, - "end": 3191, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3176, - "end": 3182, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3182, - "end": 3190, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3184, - "end": 3190, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 3207, - "end": 3356, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 3214, - "end": 3242, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_8", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 3243, - "end": 3356, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 3249, - "end": 3354, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 3270, - "end": 3284, - "ctxt": 0 - }, - "value": "StaticCallerFn", - "optional": false - }, - "span": { - "start": 3264, - "end": 3354, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 3295, - "end": 3313, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3302, - "end": 3308, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3295, - "end": 3313, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3311, - "end": 3313, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 3331, - "end": 3342, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3331, - "end": 3337, - "ctxt": 0 - }, - "value": "caller", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3331, - "end": 3342, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3340, - "end": 3342, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 3371, - "end": 3535, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 3378, - "end": 3406, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_9", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 3407, - "end": 3535, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 3413, - "end": 3533, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 3434, - "end": 3449, - "ctxt": 0 - }, - "value": "StaticArguments", - "optional": false - }, - "span": { - "start": 3428, - "end": 3533, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3460, - "end": 3485, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3467, - "end": 3476, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3476, - "end": 3484, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3478, - "end": 3484, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 3503, - "end": 3521, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3503, - "end": 3512, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3512, - "end": 3520, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3514, - "end": 3520, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 3537, - "end": 3696, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 3544, - "end": 3573, - "ctxt": 0 - }, - "value": "TestOnDefaultExportedClass_10", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 3574, - "end": 3696, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 3580, - "end": 3694, - "ctxt": 0 - }, - "decl": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 3601, - "end": 3618, - "ctxt": 0 - }, - "value": "StaticArgumentsFn", - "optional": false - }, - "span": { - "start": 3595, - "end": 3694, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 3629, - "end": 3650, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3636, - "end": 3645, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3629, - "end": 3650, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3648, - "end": 3650, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 3668, - "end": 3682, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3668, - "end": 3677, - "ctxt": 0 - }, - "value": "arguments", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 3668, - "end": 3682, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3680, - "end": 3682, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.ts b/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.ts deleted file mode 100644 index 86755cb016d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/staticPropertyNameConflicts.ts +++ /dev/null @@ -1,192 +0,0 @@ -// @target: es5 -// name -class StaticName { - static name: number; // error - name: string; // ok -} - -class StaticNameFn { - static name() {} // error - name() {} // ok -} - -// length -class StaticLength { - static length: number; // error - length: string; // ok -} - -class StaticLengthFn { - static length() {} // error - length() {} // ok -} - -// prototype -class StaticPrototype { - static prototype: number; // error - prototype: string; // ok -} - -class StaticPrototypeFn { - static prototype() {} // error - prototype() {} // ok -} - -// caller -class StaticCaller { - static caller: number; // error - caller: string; // ok -} - -class StaticCallerFn { - static caller() {} // error - caller() {} // ok -} - -// arguments -class StaticArguments { - static arguments: number; // error - arguments: string; // ok -} - -class StaticArgumentsFn { - static arguments() {} // error - arguments() {} // ok -} - - - -// === Static properties on anonymous classes === - -// name -var StaticName_Anonymous = class { - static name: number; // error - name: string; // ok -} - -var StaticNameFn_Anonymous = class { - static name() {} // error - name() {} // ok -} - -// length -var StaticLength_Anonymous = class { - static length: number; // error - length: string; // ok -} - -var StaticLengthFn_Anonymous = class { - static length() {} // error - length() {} // ok -} - -// prototype -var StaticPrototype_Anonymous = class { - static prototype: number; // error - prototype: string; // ok -} - -var StaticPrototypeFn_Anonymous = class { - static prototype() {} // error - prototype() {} // ok -} - -// caller -var StaticCaller_Anonymous = class { - static caller: number; // error - caller: string; // ok -} - -var StaticCallerFn_Anonymous = class { - static caller() {} // error - caller() {} // ok -} - -// arguments -var StaticArguments_Anonymous = class { - static arguments: number; // error - arguments: string; // ok -} - -var StaticArgumentsFn_Anonymous = class { - static arguments() {} // error - arguments() {} // ok -} - - -// === Static properties on default exported classes === - -// name -module TestOnDefaultExportedClass_1 { - class StaticName { - static name: number; // error - name: string; // ok - } -} - -module TestOnDefaultExportedClass_2 { - class StaticNameFn { - static name() {} // error - name() {} // ok - } -} - -// length -module TestOnDefaultExportedClass_3 { - export default class StaticLength { - static length: number; // error - length: string; // ok - } -} - -module TestOnDefaultExportedClass_4 { - export default class StaticLengthFn { - static length() {} // error - length() {} // ok - } -} - -// prototype -module TestOnDefaultExportedClass_5 { - export default class StaticPrototype { - static prototype: number; // error - prototype: string; // ok - } -} - -module TestOnDefaultExportedClass_6 { - export default class StaticPrototypeFn { - static prototype() {} // error - prototype() {} // ok - } -} - -// caller -module TestOnDefaultExportedClass_7 { - export default class StaticCaller { - static caller: number; // error - caller: string; // ok - } -} - -module TestOnDefaultExportedClass_8 { - export default class StaticCallerFn { - static caller() {} // error - caller() {} // ok - } -} - -// arguments -module TestOnDefaultExportedClass_9 { - export default class StaticArguments { - static arguments: number; // error - arguments: string; // ok - } -} - -module TestOnDefaultExportedClass_10 { - export default class StaticArgumentsFn { - static arguments() {} // error - arguments() {} // ok - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.json b/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.json index ae22f6d2341..aa1499c0b03 100644 --- a/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.json +++ b/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.json @@ -2,7 +2,7 @@ "type": "Script", "span": { "start": 123, - "end": 2722, + "end": 2841, "ctxt": 0 }, "body": [ @@ -4480,6 +4480,292 @@ "typeParams": null, "superTypeParams": null, "implements": [] + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 2724, + "end": 2759, + "ctxt": 0 + }, + "declare": false, + "isConst": false, + "id": { + "type": "Identifier", + "span": { + "start": 2729, + "end": 2730, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 2737, + "end": 2744, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2737, + "end": 2738, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2741, + "end": 2744, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2750, + "end": 2757, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2750, + "end": 2751, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2754, + "end": 2757, + "ctxt": 0 + }, + "value": "B", + "raw": "\"B\"" + } + } + ] + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2766, + "end": 2769, + "ctxt": 0 + }, + "value": "C13", + "optional": false + }, + "declare": false, + "span": { + "start": 2760, + "end": 2841, + "ctxt": 0 + }, + "decorators": [], + "body": [ + { + "type": "ClassProperty", + "span": { + "start": 2776, + "end": 2790, + "ctxt": 0 + }, + "key": { + "type": "Computed", + "span": { + "start": 2776, + "end": 2781, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 2777, + "end": 2780, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2777, + "end": 2778, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2779, + "end": 2780, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + }, + "value": null, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2781, + "end": 2789, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 2783, + "end": 2789, + "ctxt": 0 + }, + "kind": "number" + } + }, + "isStatic": false, + "decorators": [], + "accessibility": null, + "isAbstract": false, + "isOptional": false, + "isOverride": false, + "readonly": false, + "declare": false, + "definite": false + }, + { + "type": "Constructor", + "span": { + "start": 2795, + "end": 2839, + "ctxt": 0 + }, + "key": { + "type": "Identifier", + "span": { + "start": 2795, + "end": 2806, + "ctxt": 0 + }, + "value": "constructor", + "optional": false + }, + "params": [], + "body": { + "type": "BlockStatement", + "span": { + "start": 2809, + "end": 2839, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2819, + "end": 2833, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2819, + "end": 2832, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "span": { + "start": 2819, + "end": 2828, + "ctxt": 0 + }, + "object": { + "type": "ThisExpression", + "span": { + "start": 2819, + "end": 2823, + "ctxt": 0 + } + }, + "property": { + "type": "Computed", + "span": { + "start": 2823, + "end": 2828, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 2824, + "end": 2827, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2824, + "end": 2825, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2826, + "end": 2827, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + } + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 2831, + "end": 2832, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + } + ] + }, + "accessibility": null, + "isOptional": false + } + ], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.ts b/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.ts index 04b23d1d262..c34d1876ea9 100644 --- a/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.ts +++ b/crates/swc_ecma_parser/tests/tsc/strictPropertyInitialization.ts @@ -150,3 +150,14 @@ class C12 { this['c'] = 1; } } + +enum E { + A = "A", + B = "B" +} +class C13 { + [E.A]: number; + constructor() { + this[E.A] = 1; + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf01.ts index fdf4704a5d2..53abc02b885 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf01.ts @@ -1,4 +1,4 @@ - + type S = "a" | "b"; type T = S[] | S; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf02.ts index 7d1bf56c21d..db0fa6bdd4e 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralCheckedInIf02.ts @@ -1,4 +1,4 @@ - + type S = "a" | "b"; type T = S[] | S; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralMatchedInSwitch01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralMatchedInSwitch01.ts index 058cc8dd2b6..7e07a677a74 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralMatchedInSwitch01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralMatchedInSwitch01.ts @@ -1,4 +1,4 @@ - + type S = "a" | "b"; type T = S[] | S; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypeAssertion01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypeAssertion01.ts index 52d7774eda6..6062c322aa8 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypeAssertion01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypeAssertion01.ts @@ -1,4 +1,4 @@ - + type S = "a" | "b"; type T = S[] | S; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndLogicalOrExpressions01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndLogicalOrExpressions01.ts index 7387e4689e6..c6ec6247b88 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndLogicalOrExpressions01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndLogicalOrExpressions01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true declare function myRandBool(): boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndParenthesizedExpressions01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndParenthesizedExpressions01.ts index 787c6bd6a4d..a73fdd3fa6f 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndParenthesizedExpressions01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAndParenthesizedExpressions01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true declare function myRandBool(): boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint01.ts index 08cdfddfc73..f2b67048d1c 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function foo(f: (x: T) => T) { return f; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint02.ts index d7ec51e6d12..e0137a4d564 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesAsTypeParameterConstraint02.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function foo(f: (x: T) => T) { return f; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability01.ts index bc8bec7fa16..f12173653e3 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f(x: "foo"): number; function f(x: string): number { diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability02.ts index a2e85448c0f..c31d6102369 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability02.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f(x: "foo"): number; function f(x: "foo"): number { diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability03.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability03.ts index 30d3099c5a9..518ed585434 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability03.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability03.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f(x: "foo"): number; function f(x: string): number { diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability04.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability04.ts index d7ddf0c6ccd..4e9821b51c5 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability04.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability04.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f(x: "foo"): number; function f(x: "foo"): number { diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability05.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability05.ts index da50f6475d8..e9549598a20 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability05.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloadAssignability05.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true function f(x: "foo"): number; function f(x: string): number; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads03.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads03.ts index 621cd2b2ded..93c6d10b86e 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads03.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads03.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true interface Base { x: string; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads04.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads04.ts index bdd59dab910..f0bd7ef73a2 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads04.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads04.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true declare function f(x: (p: "foo" | "bar") => "foo"); diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads05.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads05.ts index eec9669dbb2..6597f2e8250 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads05.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesOverloads05.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true interface Animal { animal: {} }; interface Dog extends Animal { dog: {} } diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings01.ts index 34c3ac1eafd..d1cd4990f37 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true let ABC: "ABC" = `ABC`; let DE_NEWLINE_F: "DE\nF" = `DE diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings02.ts index ef308fbcf0a..4bd41dda713 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithTemplateStrings02.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true let abc: "AB\r\nC" = `AB C`; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators01.ts index 46f70e14b96..9322243f975 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators01.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true let abc: "ABC" = "ABC"; let xyz: "XYZ" = "XYZ"; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators02.ts index 0ae07fa0910..0ff5e6b03c1 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralTypesWithVariousOperators02.ts @@ -1,4 +1,4 @@ -// @declaration: true +// @declaration: true let abc: "ABC" = "ABC"; let xyz: "XYZ" = "XYZ"; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons01.ts index 325b580f5a6..1e6df5e39cc 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons01.ts @@ -1,3 +1,3 @@ -var a = "foo" === "bar" as string; +var a = "foo" === "bar" as string; var b = "foo" !== ("bar" as string); var c = "foo" == ("bar"); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons02.ts index a90bdad273e..5116babc71e 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssertionsInEqualityComparisons02.ts @@ -1,4 +1,4 @@ -type EnhancedString = string & { enhancements: any }; +type EnhancedString = string & { enhancements: any }; var a = "foo" === "bar" as "baz"; var b = "foo" !== ("bar" as "foo"); diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.json b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.json new file mode 100644 index 00000000000..796dd91b8d9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.json @@ -0,0 +1,453 @@ +{ + "type": "Script", + "span": { + "start": 1, + "end": 175, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1, + "end": 45, + "ctxt": 0 + }, + "kind": "var", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 13, + "end": 44, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 13, + "end": 14, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14, + "end": 44, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 16, + "end": 44, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 16, + "end": 25, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 25, + "end": 44, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 26, + "end": 43, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 26, + "end": 35, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 35, + "end": 43, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 36, + "end": 42, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + ] + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 55, + "end": 63, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 55, + "end": 62, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 55, + "end": 56, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 59, + "end": 62, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 72, + "end": 80, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 72, + "end": 79, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 72, + "end": 73, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 76, + "end": 79, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 82, + "end": 131, + "ctxt": 0 + }, + "kind": "var", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 94, + "end": 130, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 94, + "end": 95, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 95, + "end": 130, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 97, + "end": 130, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 97, + "end": 106, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 106, + "end": 130, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 107, + "end": 129, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 107, + "end": 116, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 116, + "end": 129, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 117, + "end": 128, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 117, + "end": 128, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 120, + "end": 126, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 118, + "end": 118, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 127, + "end": 127, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + ] + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 141, + "end": 149, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 141, + "end": 148, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 141, + "end": 142, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 145, + "end": 148, + "ctxt": 0 + }, + "value": "1", + "raw": "\"1\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 158, + "end": 166, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 158, + "end": 165, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 158, + "end": 159, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 162, + "end": 165, + "ctxt": 0 + }, + "value": "a", + "raw": "\"a\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 167, + "end": 175, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 167, + "end": 174, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 167, + "end": 168, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 171, + "end": 174, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.ts new file mode 100644 index 00000000000..67788e60dc2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsAssignedToStringMappings.ts @@ -0,0 +1,16 @@ +declare var x: Uppercase>; + +// good +x = "A"; + +// bad +x = "a"; + +declare var y: Uppercase>; + +// good +y = "1"; + +// bad +y = "a"; +y = "A"; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks01.ts index f87baf93241..cc7dea0edb0 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks01.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; let b: boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks02.ts index 77503bcda89..e6116dac745 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks02.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; let b: boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks03.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks03.ts index cca57c0e7d8..3e19f568499 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks03.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks03.ts @@ -1,4 +1,4 @@ -interface Runnable { +interface Runnable { isRunning: boolean; } diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks04.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks04.ts index e33bf35bde5..4b79ad8d13d 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks04.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithEqualityChecks04.ts @@ -1,4 +1,4 @@ -interface Runnable { +interface Runnable { isRunning: boolean; } diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements01.ts index 70fe6626d9c..5125a3d24a0 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements01.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; switch (x) { diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements02.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements02.ts index 0a2707ea08d..45c4e4be5f7 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements02.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements02.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; let b: boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements03.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements03.ts index 762400a964c..613e5838156 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements03.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements03.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; let z: "bar"; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements04.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements04.ts index 72313572038..f38d83836f1 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements04.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithSwitchStatements04.ts @@ -1,4 +1,4 @@ -let x: "foo"; +let x: "foo"; let y: "foo" | "bar"; declare function randBool(): boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithTypeAssertions01.ts b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithTypeAssertions01.ts index 80283f33c5b..b6ad1cd84fd 100644 --- a/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithTypeAssertions01.ts +++ b/crates/swc_ecma_parser/tests/tsc/stringLiteralsWithTypeAssertions01.ts @@ -1,4 +1,4 @@ -let fooOrBar: "foo" | "bar"; +let fooOrBar: "foo" | "bar"; let a = "foo" as "bar"; let b = "bar" as "foo"; diff --git a/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.json b/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.json new file mode 100644 index 00000000000..e9c8fc88f73 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.json @@ -0,0 +1,4925 @@ +{ + "type": "Script", + "span": { + "start": 17, + "end": 3651, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 17, + "end": 31, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 22, + "end": 23, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 26, + "end": 30, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 26, + "end": 30, + "ctxt": 0 + }, + "value": "aA", + "raw": "\"aA\"" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 32, + "end": 54, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 37, + "end": 38, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 41, + "end": 53, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 41, + "end": 50, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 50, + "end": 53, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 51, + "end": 52, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 51, + "end": 52, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 55, + "end": 77, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 60, + "end": 61, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 64, + "end": 76, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 64, + "end": 73, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 73, + "end": 76, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 74, + "end": 75, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 74, + "end": 75, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 92, + "end": 123, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 97, + "end": 106, + "ctxt": 0 + }, + "value": "ATemplate", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 109, + "end": 122, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 109, + "end": 122, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 114, + "end": 120, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 110, + "end": 112, + "ctxt": 0 + }, + "tail": false, + "cooked": "aA", + "raw": "aA" + }, + { + "type": "TemplateElement", + "span": { + "start": 121, + "end": 121, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 124, + "end": 162, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 129, + "end": 138, + "ctxt": 0 + }, + "value": "BTemplate", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 141, + "end": 161, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 141, + "end": 150, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 150, + "end": 161, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 151, + "end": 160, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 151, + "end": 160, + "ctxt": 0 + }, + "value": "ATemplate", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 163, + "end": 201, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 168, + "end": 177, + "ctxt": 0 + }, + "value": "CTemplate", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 180, + "end": 200, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 180, + "end": 189, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 189, + "end": 200, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 190, + "end": 199, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 190, + "end": 199, + "ctxt": 0 + }, + "value": "ATemplate", + "optional": false + }, + "typeParams": null + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 212, + "end": 214, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 220, + "end": 224, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 220, + "end": 224, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 221, + "end": 224, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 223, + "end": 224, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 223, + "end": 224, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 230, + "end": 234, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 230, + "end": 234, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 231, + "end": 234, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 233, + "end": 234, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 233, + "end": 234, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 240, + "end": 244, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 240, + "end": 244, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 241, + "end": 244, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 243, + "end": 244, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 243, + "end": 244, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 250, + "end": 271, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 250, + "end": 271, + "ctxt": 0 + }, + "value": "a_template", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 260, + "end": 271, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 262, + "end": 271, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 262, + "end": 271, + "ctxt": 0 + }, + "value": "ATemplate", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 277, + "end": 298, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 277, + "end": 298, + "ctxt": 0 + }, + "value": "b_template", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 287, + "end": 298, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 289, + "end": 298, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 289, + "end": 298, + "ctxt": 0 + }, + "value": "BTemplate", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 304, + "end": 325, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 304, + "end": 325, + "ctxt": 0 + }, + "value": "c_template", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 314, + "end": 325, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 316, + "end": 325, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 316, + "end": 325, + "ctxt": 0 + }, + "value": "CTemplate", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 203, + "end": 873, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 328, + "end": 873, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 436, + "end": 451, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 436, + "end": 450, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 436, + "end": 446, + "ctxt": 0 + }, + "value": "a_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 449, + "end": 450, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 456, + "end": 471, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 456, + "end": 470, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 456, + "end": 466, + "ctxt": 0 + }, + "value": "b_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 469, + "end": 470, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 476, + "end": 491, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 476, + "end": 490, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 476, + "end": 486, + "ctxt": 0 + }, + "value": "c_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 489, + "end": 490, + "ctxt": 0 + }, + "value": "c", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 529, + "end": 544, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 529, + "end": 543, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 529, + "end": 530, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 533, + "end": 543, + "ctxt": 0 + }, + "value": "a_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 549, + "end": 564, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 549, + "end": 563, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 549, + "end": 550, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 553, + "end": 563, + "ctxt": 0 + }, + "value": "b_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 569, + "end": 584, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 569, + "end": 583, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 569, + "end": 570, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 573, + "end": 583, + "ctxt": 0 + }, + "value": "c_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 700, + "end": 724, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 700, + "end": 723, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 700, + "end": 710, + "ctxt": 0 + }, + "value": "a_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 713, + "end": 723, + "ctxt": 0 + }, + "value": "b_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 729, + "end": 753, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 729, + "end": 752, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 729, + "end": 739, + "ctxt": 0 + }, + "value": "a_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 742, + "end": 752, + "ctxt": 0 + }, + "value": "c_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 759, + "end": 783, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 759, + "end": 782, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 759, + "end": 769, + "ctxt": 0 + }, + "value": "b_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 772, + "end": 782, + "ctxt": 0 + }, + "value": "a_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 788, + "end": 812, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 788, + "end": 811, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 788, + "end": 798, + "ctxt": 0 + }, + "value": "b_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 801, + "end": 811, + "ctxt": 0 + }, + "value": "c_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 818, + "end": 842, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 818, + "end": 841, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 818, + "end": 828, + "ctxt": 0 + }, + "value": "c_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 831, + "end": 841, + "ctxt": 0 + }, + "value": "a_template", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 847, + "end": 871, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 847, + "end": 870, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 847, + "end": 857, + "ctxt": 0 + }, + "value": "c_template", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 860, + "end": 870, + "ctxt": 0 + }, + "value": "b_template", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 921, + "end": 923, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 924, + "end": 934, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 924, + "end": 934, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 926, + "end": 934, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 928, + "end": 934, + "ctxt": 0 + }, + "kind": "string" + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 936, + "end": 957, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 936, + "end": 957, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 938, + "end": 957, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 940, + "end": 957, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 940, + "end": 949, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 949, + "end": 957, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 950, + "end": 956, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 959, + "end": 980, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 959, + "end": 980, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 961, + "end": 980, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 963, + "end": 980, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 963, + "end": 972, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 972, + "end": 980, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 973, + "end": 979, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 912, + "end": 1179, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 982, + "end": 1179, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 998, + "end": 1006, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 998, + "end": 1005, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 998, + "end": 1000, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1003, + "end": 1005, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1011, + "end": 1019, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1011, + "end": 1018, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1011, + "end": 1013, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1016, + "end": 1018, + "ctxt": 0 + }, + "value": "x3", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1025, + "end": 1036, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1025, + "end": 1035, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1025, + "end": 1027, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1030, + "end": 1035, + "ctxt": 0 + }, + "value": "ABC", + "raw": "\"ABC\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1041, + "end": 1052, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1041, + "end": 1051, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1041, + "end": 1043, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1046, + "end": 1051, + "ctxt": 0 + }, + "value": "abc", + "raw": "\"abc\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1097, + "end": 1105, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1097, + "end": 1104, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1097, + "end": 1099, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1102, + "end": 1104, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1110, + "end": 1118, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1110, + "end": 1117, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1110, + "end": 1112, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1115, + "end": 1117, + "ctxt": 0 + }, + "value": "x3", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1123, + "end": 1131, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1123, + "end": 1130, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1123, + "end": 1125, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1128, + "end": 1130, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1136, + "end": 1144, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1136, + "end": 1143, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1136, + "end": 1138, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1141, + "end": 1143, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1150, + "end": 1161, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1150, + "end": 1160, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1150, + "end": 1152, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1155, + "end": 1160, + "ctxt": 0 + }, + "value": "AbC", + "raw": "\"AbC\"" + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1166, + "end": 1177, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1166, + "end": 1176, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1166, + "end": 1168, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 1171, + "end": 1176, + "ctxt": 0 + }, + "value": "AbC", + "raw": "\"AbC\"" + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1217, + "end": 1219, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1225, + "end": 1246, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1225, + "end": 1246, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1227, + "end": 1246, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1229, + "end": 1246, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1229, + "end": 1238, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1238, + "end": 1246, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1239, + "end": 1245, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1252, + "end": 1284, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1252, + "end": 1284, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1254, + "end": 1284, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1256, + "end": 1284, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1256, + "end": 1265, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1265, + "end": 1284, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1266, + "end": 1283, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1266, + "end": 1275, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1275, + "end": 1283, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1276, + "end": 1282, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 1290, + "end": 1322, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1290, + "end": 1322, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1292, + "end": 1322, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1294, + "end": 1322, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1294, + "end": 1303, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1303, + "end": 1322, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1304, + "end": 1321, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1304, + "end": 1313, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1313, + "end": 1321, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1314, + "end": 1320, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1208, + "end": 1971, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1324, + "end": 1971, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1378, + "end": 1386, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1378, + "end": 1385, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1378, + "end": 1380, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1383, + "end": 1385, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1391, + "end": 1399, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1391, + "end": 1398, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1391, + "end": 1393, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1396, + "end": 1398, + "ctxt": 0 + }, + "value": "x3", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1405, + "end": 1413, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1405, + "end": 1412, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1405, + "end": 1407, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1410, + "end": 1412, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1418, + "end": 1426, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1418, + "end": 1425, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1418, + "end": 1420, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1423, + "end": 1425, + "ctxt": 0 + }, + "value": "x3", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1753, + "end": 1761, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1753, + "end": 1760, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1753, + "end": 1755, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1758, + "end": 1760, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1766, + "end": 1774, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1766, + "end": 1773, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1766, + "end": 1768, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1771, + "end": 1773, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 1839, + "end": 1890, + "ctxt": 0 + }, + "kind": "var", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1843, + "end": 1889, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1843, + "end": 1845, + "ctxt": 0 + }, + "value": "x4", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1845, + "end": 1875, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1847, + "end": 1875, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1847, + "end": 1856, + "ctxt": 0 + }, + "value": "Lowercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1856, + "end": 1875, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 1857, + "end": 1874, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1857, + "end": 1866, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 1866, + "end": 1874, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 1867, + "end": 1873, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + ] + } + } + } + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 1878, + "end": 1889, + "ctxt": 0 + }, + "expression": { + "type": "NullLiteral", + "span": { + "start": 1878, + "end": 1882, + "ctxt": 0 + } + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1886, + "end": 1889, + "ctxt": 0 + }, + "kind": "any" + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1895, + "end": 1903, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1895, + "end": 1902, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1895, + "end": 1897, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1900, + "end": 1902, + "ctxt": 0 + }, + "value": "x4", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1908, + "end": 1916, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1908, + "end": 1915, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1908, + "end": 1910, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1913, + "end": 1915, + "ctxt": 0 + }, + "value": "x4", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1921, + "end": 1929, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1921, + "end": 1928, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1921, + "end": 1923, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1926, + "end": 1928, + "ctxt": 0 + }, + "value": "x4", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1935, + "end": 1943, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1935, + "end": 1942, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1935, + "end": 1937, + "ctxt": 0 + }, + "value": "x4", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1940, + "end": 1942, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1948, + "end": 1956, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1948, + "end": 1955, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1948, + "end": 1950, + "ctxt": 0 + }, + "value": "x4", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1953, + "end": 1955, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 1961, + "end": 1969, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 1961, + "end": 1968, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 1961, + "end": 1963, + "ctxt": 0 + }, + "value": "x4", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 1966, + "end": 1968, + "ctxt": 0 + }, + "value": "x3", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2038, + "end": 2102, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2043, + "end": 2055, + "ctxt": 0 + }, + "value": "NonStringPat", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2058, + "end": 2101, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2058, + "end": 2067, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2067, + "end": 2101, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2068, + "end": 2100, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2068, + "end": 2100, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2073, + "end": 2079, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 2082, + "end": 2088, + "ctxt": 0 + }, + "kind": "bigint" + }, + { + "type": "TsKeywordType", + "span": { + "start": 2091, + "end": 2098, + "ctxt": 0 + }, + "kind": "boolean" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2069, + "end": 2071, + "ctxt": 0 + }, + "tail": false, + "cooked": "aA", + "raw": "aA" + }, + { + "type": "TemplateElement", + "span": { + "start": 2080, + "end": 2080, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2089, + "end": 2089, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2099, + "end": 2099, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2103, + "end": 2214, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2108, + "end": 2130, + "ctxt": 0 + }, + "value": "EquivalentNonStringPat", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2133, + "end": 2213, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2133, + "end": 2213, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 2138, + "end": 2160, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2138, + "end": 2147, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2147, + "end": 2160, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2148, + "end": 2159, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2148, + "end": 2159, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2151, + "end": 2157, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2149, + "end": 2149, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2158, + "end": 2158, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 2163, + "end": 2185, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2163, + "end": 2172, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2172, + "end": 2185, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2173, + "end": 2184, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2173, + "end": 2184, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2176, + "end": 2182, + "ctxt": 0 + }, + "kind": "bigint" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2174, + "end": 2174, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2183, + "end": 2183, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 2188, + "end": 2211, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2188, + "end": 2197, + "ctxt": 0 + }, + "value": "Uppercase", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2197, + "end": 2211, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2198, + "end": 2210, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2198, + "end": 2210, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2201, + "end": 2208, + "ctxt": 0 + }, + "kind": "boolean" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2199, + "end": 2199, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2209, + "end": 2209, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2134, + "end": 2136, + "ctxt": 0 + }, + "tail": false, + "cooked": "AA", + "raw": "AA" + }, + { + "type": "TemplateElement", + "span": { + "start": 2161, + "end": 2161, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2186, + "end": 2186, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2212, + "end": 2212, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2225, + "end": 2227, + "ctxt": 0 + }, + "value": "f4", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2228, + "end": 2244, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2228, + "end": 2244, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2230, + "end": 2244, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2232, + "end": 2244, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2232, + "end": 2244, + "ctxt": 0 + }, + "value": "NonStringPat", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2246, + "end": 2272, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2246, + "end": 2272, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2248, + "end": 2272, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2250, + "end": 2272, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2250, + "end": 2272, + "ctxt": 0 + }, + "value": "EquivalentNonStringPat", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2216, + "end": 2327, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2274, + "end": 2327, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2304, + "end": 2312, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2304, + "end": 2311, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2304, + "end": 2306, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2309, + "end": 2311, + "ctxt": 0 + }, + "value": "x2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2317, + "end": 2325, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2317, + "end": 2324, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2317, + "end": 2319, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2322, + "end": 2324, + "ctxt": 0 + }, + "value": "x1", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2391, + "end": 2393, + "ctxt": 0 + }, + "value": "f5", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2399, + "end": 2420, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2399, + "end": 2420, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2406, + "end": 2420, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2408, + "end": 2420, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2408, + "end": 2420, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2412, + "end": 2418, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2409, + "end": 2410, + "ctxt": 0 + }, + "tail": false, + "cooked": "A", + "raw": "A" + }, + { + "type": "TemplateElement", + "span": { + "start": 2419, + "end": 2419, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2426, + "end": 2453, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2426, + "end": 2453, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2433, + "end": 2453, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2435, + "end": 2453, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2435, + "end": 2445, + "ctxt": 0 + }, + "value": "Capitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2445, + "end": 2453, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2446, + "end": 2452, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2459, + "end": 2496, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2459, + "end": 2496, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2470, + "end": 2496, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2472, + "end": 2496, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2472, + "end": 2482, + "ctxt": 0 + }, + "value": "Capitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2482, + "end": 2496, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2483, + "end": 2495, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2483, + "end": 2495, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2487, + "end": 2493, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2484, + "end": 2485, + "ctxt": 0 + }, + "tail": false, + "cooked": "A", + "raw": "A" + }, + { + "type": "TemplateElement", + "span": { + "start": 2494, + "end": 2494, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2502, + "end": 2540, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2502, + "end": 2540, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2514, + "end": 2540, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2516, + "end": 2540, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2516, + "end": 2526, + "ctxt": 0 + }, + "value": "Capitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2526, + "end": 2540, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2527, + "end": 2539, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2527, + "end": 2539, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2531, + "end": 2537, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2528, + "end": 2529, + "ctxt": 0 + }, + "tail": false, + "cooked": "a", + "raw": "a" + }, + { + "type": "TemplateElement", + "span": { + "start": 2538, + "end": 2538, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2546, + "end": 2569, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2546, + "end": 2569, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2555, + "end": 2569, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 2557, + "end": 2569, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2557, + "end": 2569, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2561, + "end": 2567, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2558, + "end": 2559, + "ctxt": 0 + }, + "tail": false, + "cooked": "a", + "raw": "a" + }, + { + "type": "TemplateElement", + "span": { + "start": 2568, + "end": 2568, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2575, + "end": 2606, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2575, + "end": 2606, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2584, + "end": 2606, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2586, + "end": 2606, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2586, + "end": 2598, + "ctxt": 0 + }, + "value": "Uncapitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2598, + "end": 2606, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 2599, + "end": 2605, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2612, + "end": 2653, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2612, + "end": 2653, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2625, + "end": 2653, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2627, + "end": 2653, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2627, + "end": 2639, + "ctxt": 0 + }, + "value": "Uncapitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2639, + "end": 2653, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2640, + "end": 2652, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2640, + "end": 2652, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2644, + "end": 2650, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2641, + "end": 2642, + "ctxt": 0 + }, + "tail": false, + "cooked": "A", + "raw": "A" + }, + { + "type": "TemplateElement", + "span": { + "start": 2651, + "end": 2651, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 2659, + "end": 2701, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2659, + "end": 2701, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2673, + "end": 2701, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2675, + "end": 2701, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2675, + "end": 2687, + "ctxt": 0 + }, + "value": "Uncapitalize", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 2687, + "end": 2701, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 2688, + "end": 2700, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2688, + "end": 2700, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 2692, + "end": 2698, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2689, + "end": 2690, + "ctxt": 0 + }, + "tail": false, + "cooked": "a", + "raw": "a" + }, + { + "type": "TemplateElement", + "span": { + "start": 2699, + "end": 2699, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2382, + "end": 3651, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2705, + "end": 3651, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2744, + "end": 2762, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2744, + "end": 2761, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2744, + "end": 2751, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2754, + "end": 2761, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2767, + "end": 2789, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2767, + "end": 2788, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2767, + "end": 2774, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2777, + "end": 2788, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2794, + "end": 2817, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2794, + "end": 2816, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2794, + "end": 2801, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2804, + "end": 2816, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2855, + "end": 2877, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2855, + "end": 2876, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2855, + "end": 2862, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2865, + "end": 2876, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2882, + "end": 2905, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2882, + "end": 2904, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2882, + "end": 2889, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2892, + "end": 2904, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2910, + "end": 2937, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2910, + "end": 2936, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2910, + "end": 2921, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2924, + "end": 2936, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2942, + "end": 2964, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2942, + "end": 2963, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2942, + "end": 2953, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2956, + "end": 2963, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2969, + "end": 2996, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2969, + "end": 2995, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2969, + "end": 2981, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2984, + "end": 2995, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3001, + "end": 3024, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3001, + "end": 3023, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3001, + "end": 3013, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3016, + "end": 3023, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3079, + "end": 3097, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3079, + "end": 3096, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3079, + "end": 3086, + "ctxt": 0 + }, + "value": "cap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3089, + "end": 3096, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3102, + "end": 3124, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3102, + "end": 3123, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3102, + "end": 3113, + "ctxt": 0 + }, + "value": "cap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3116, + "end": 3123, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3129, + "end": 3152, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3129, + "end": 3151, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3129, + "end": 3141, + "ctxt": 0 + }, + "value": "cap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3144, + "end": 3151, + "ctxt": 0 + }, + "value": "cap_str", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3193, + "end": 3215, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3193, + "end": 3214, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3193, + "end": 3202, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3205, + "end": 3214, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3220, + "end": 3246, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3220, + "end": 3245, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3220, + "end": 3229, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3232, + "end": 3245, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3251, + "end": 3278, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3251, + "end": 3277, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3251, + "end": 3260, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3263, + "end": 3277, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3316, + "end": 3342, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3316, + "end": 3341, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3316, + "end": 3325, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3328, + "end": 3341, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3347, + "end": 3374, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3347, + "end": 3373, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3347, + "end": 3356, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3359, + "end": 3373, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3379, + "end": 3410, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3379, + "end": 3409, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3379, + "end": 3392, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3395, + "end": 3409, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3415, + "end": 3441, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3415, + "end": 3440, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3415, + "end": 3428, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3431, + "end": 3440, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3446, + "end": 3477, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3446, + "end": 3476, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3446, + "end": 3460, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3463, + "end": 3476, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3482, + "end": 3509, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3482, + "end": 3508, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3482, + "end": 3496, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3499, + "end": 3508, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3564, + "end": 3586, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3564, + "end": 3585, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3564, + "end": 3573, + "ctxt": 0 + }, + "value": "uncap_tem", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3576, + "end": 3585, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3591, + "end": 3617, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3591, + "end": 3616, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3591, + "end": 3604, + "ctxt": 0 + }, + "value": "uncap_tem_map", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3607, + "end": 3616, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 3622, + "end": 3649, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 3622, + "end": 3648, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 3622, + "end": 3636, + "ctxt": 0 + }, + "value": "uncap_tem_map2", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 3639, + "end": 3648, + "ctxt": 0 + }, + "value": "uncap_str", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.ts b/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.ts new file mode 100644 index 00000000000..3a9a1461420 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/stringMappingOverPatternLiterals.ts @@ -0,0 +1,150 @@ +// non-template +type A = "aA"; +type B = Uppercase; +type C = Lowercase; + +// templated +type ATemplate = `aA${string}`; +type BTemplate = Uppercase; +type CTemplate = Lowercase; + +function f1( + a: A, + b: B, + c: C, + a_template: ATemplate, + b_template: BTemplate, + c_template: CTemplate +) { + // non-template versions should be assignable to templated versions (empty string matches string) + a_template = a; + b_template = b; + c_template = c; + + // not the other way around + a = a_template; + b = b_template; + c = c_template; + + // Additionally, all the template versions should be mutually incompatible (they describe differing sets) + a_template = b_template; + a_template = c_template; + + b_template = a_template; + b_template = c_template; + + c_template = a_template; + c_template = b_template; +} + +// Raw string mapping assignability + +function f2(x1: string, x2: Uppercase, x3: Lowercase) { + // ok + x1 = x2; + x1 = x3; + + x2 = "ABC"; + x3 = "abc"; + + // should fail (sets do not match) + x2 = x1; + x2 = x3; + x3 = x1; + x3 = x2; + + x2 = "AbC"; + x3 = "AbC"; +} + +// Mappings over mappings + +function f3( + x1: Uppercase, + x2: Uppercase>, + x3: Uppercase>) { + + // _ideally_ these would all be equivalent + x1 = x2; + x1 = x3; + + x2 = x1; + x2 = x3; + + // you'd think these were equivalent - the outer `Uppercase` conceptually + // makes the inner `Lowercase` effectively a noop - but that's not so; + // the german sharp s makes that not completely true (lowercases to ss, + // which then uppercases to SS), so arbitrary nestings of mappings make differing sets! + x3 = x1; + x3 = x2; + + // and this should also not be equivlent to any others + var x4: Lowercase> = null as any; + x1 = x4; + x2 = x4; + x3 = x4; + + x4 = x1; + x4 = x2; + x4 = x3; +} + +// string mapping over non-string pattern literals is preserved + +type NonStringPat = Uppercase<`aA${number}${bigint}${boolean}`>; +type EquivalentNonStringPat = `AA${Uppercase<`${number}`>}${Uppercase<`${bigint}`>}${Uppercase<`${boolean}`>}`; + +function f4(x1: NonStringPat, x2: EquivalentNonStringPat) { + // Should both work + x1 = x2; + x2 = x1; +} + +// Capitalize and uncapitalize on template literals + +function f5( + cap_tem: `A${string}`, + cap_str: Capitalize, + cap_tem_map: Capitalize<`A${string}`>, + cap_tem_map2: Capitalize<`a${string}`>, + uncap_tem: `a${string}`, + uncap_str: Uncapitalize, + uncap_tem_map: Uncapitalize<`A${string}`>, + uncap_tem_map2: Uncapitalize<`a${string}`>, +) { + // All these are capitalized + cap_str = cap_tem; + cap_str = cap_tem_map; + cap_str = cap_tem_map2; + + // these are all equivalent + cap_tem = cap_tem_map; + cap_tem = cap_tem_map2; + cap_tem_map = cap_tem_map2; + cap_tem_map = cap_tem; + cap_tem_map2 = cap_tem_map; + cap_tem_map2 = cap_tem; + + // meanwhile, these all require a `A` prefix + cap_tem = cap_str; + cap_tem_map = cap_str; + cap_tem_map2 = cap_str; + + // All these are uncapitalized + uncap_str = uncap_tem; + uncap_str = uncap_tem_map; + uncap_str = uncap_tem_map2; + + // these are all equivalent + uncap_tem = uncap_tem_map; + uncap_tem = uncap_tem_map2; + uncap_tem_map = uncap_tem_map2; + uncap_tem_map = uncap_tem; + uncap_tem_map2 = uncap_tem_map; + uncap_tem_map2 = uncap_tem; + + // meanwhile, these all require a `a` prefix + uncap_tem = uncap_str; + uncap_tem_map = uncap_str; + uncap_tem_map2 = uncap_str; +} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing1.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing1.ts index 4fdc5e75c0d..b6bf022ff91 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing1.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing1.ts @@ -1,4 +1,4 @@ -declare var Factory: any +declare var Factory: any class Base { constructor(c) { } diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing2.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing2.ts index a9704430603..33ec37b8bea 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing2.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing2.ts @@ -1,4 +1,4 @@ -class Base { +class Base { constructor(c) { } } class D extends Base { diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.json b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.json deleted file mode 100644 index d295cd7e569..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.json +++ /dev/null @@ -1,376 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 298, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 11, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 18, - "end": 36, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 39, - "end": 298, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 66, - "end": 77, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 74, - "end": 76, - "ctxt": 0 - }, - "value": "_t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 82, - "end": 296, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 82, - "end": 93, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 96, - "end": 296, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 106, - "end": 132, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 110, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 114, - "end": 131, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 120, - "end": 131, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 122, - "end": 129, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 122, - "end": 126, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 127, - "end": 129, - "ctxt": 0 - }, - "value": "_t", - "optional": false - } - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 141, - "end": 145, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 141, - "end": 144, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 141, - "end": 142, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 246, - "end": 254, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 246, - "end": 253, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 246, - "end": 250, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 251, - "end": 253, - "ctxt": 0 - }, - "value": "_t", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 273, - "end": 290, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 273, - "end": 289, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 273, - "end": 278, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 279, - "end": 288, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.ts deleted file mode 100644 index daead9bf622..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing3.ts +++ /dev/null @@ -1,12 +0,0 @@ -class Base { - constructor(c) { } -} -class D extends Base { - private _t; - constructor() { - let x = () => { this._t }; - x(); // no error; we only check super is called before this when the container is a constructor - this._t; // error - super(undefined); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.json b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.json deleted file mode 100644 index 71c068a9311..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 203, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 101, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 28, - "end": 39, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 36, - "end": 38, - "ctxt": 0 - }, - "value": "_t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 44, - "end": 99, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 44, - "end": 55, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 99, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 68, - "end": 76, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 68, - "end": 72, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 73, - "end": 75, - "ctxt": 0 - }, - "value": "_t", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 85, - "end": 93, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 85, - "end": 92, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 85, - "end": 90, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "NullLiteral", - "span": { - "start": 17, - "end": 21, - "ctxt": 0 - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 109, - "end": 110, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": false, - "span": { - "start": 103, - "end": 203, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 130, - "end": 141, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 138, - "end": 140, - "ctxt": 0 - }, - "value": "_t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 146, - "end": 201, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 146, - "end": 157, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 160, - "end": 201, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 170, - "end": 177, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 170, - "end": 175, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 187, - "end": 194, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 192, - "end": 194, - "ctxt": 0 - }, - "value": "_t", - "optional": false - } - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "NullLiteral", - "span": { - "start": 119, - "end": 123, - "ctxt": 0 - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.ts deleted file mode 100644 index 50c27ba2f17..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing4.ts +++ /dev/null @@ -1,15 +0,0 @@ -class D extends null { - private _t; - constructor() { - this._t; - super(); - } -} - -class E extends null { - private _t; - constructor() { - super(); - this._t; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing5.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing5.ts index 8760071e9fc..79cf406ba7c 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing5.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing5.ts @@ -1,4 +1,4 @@ -class D extends null { +class D extends null { private _t; constructor() { this._t; // No error diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.json b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.json deleted file mode 100644 index bdc21ac158a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 127, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 11, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 18, - "end": 36, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 39, - "end": 127, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 66, - "end": 77, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 74, - "end": 76, - "ctxt": 0 - }, - "value": "_t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 82, - "end": 125, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 82, - "end": 93, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 96, - "end": 125, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 106, - "end": 118, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 106, - "end": 117, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 106, - "end": 111, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 112, - "end": 116, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.ts deleted file mode 100644 index 98b4cb4f966..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing6.ts +++ /dev/null @@ -1,9 +0,0 @@ -class Base { - constructor(c) { } -} -class D extends Base { - private _t; - constructor() { - super(this); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.json b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.json deleted file mode 100644 index 16d20579c3e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.json +++ /dev/null @@ -1,306 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 183, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 11, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 38, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 18, - "end": 36, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 18, - "end": 29, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 39, - "end": 183, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 66, - "end": 77, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 74, - "end": 76, - "ctxt": 0 - }, - "value": "_t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 82, - "end": 181, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 82, - "end": 93, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 96, - "end": 181, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 106, - "end": 149, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 110, - "end": 149, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 110, - "end": 111, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 114, - "end": 149, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 128, - "end": 129, - "ctxt": 0 - }, - "value": "j", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 131, - "end": 138, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 131, - "end": 135, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 136, - "end": 138, - "ctxt": 0 - }, - "value": "_t", - "optional": false - } - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 158, - "end": 175, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 158, - "end": 174, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 158, - "end": 163, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 164, - "end": 173, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 55, - "end": 59, - "ctxt": 0 - }, - "value": "Base", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.ts deleted file mode 100644 index 0dd797a073e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing7.ts +++ /dev/null @@ -1,12 +0,0 @@ -class Base { - constructor(c) { } -} -class D extends Base { - private _t; - constructor() { - let x = { - j: this._t, - } - super(undefined); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing8.ts b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing8.ts index 5eebb2a4867..dba5cde054e 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing8.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing8.ts @@ -1,4 +1,4 @@ -class Base { +class Base { constructor(c) { } } class D extends Base { diff --git a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping1.ts b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping1.ts index 3b8f290a263..ed9e9148cd5 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping1.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping1.ts @@ -1,4 +1,4 @@ - + class A { constructor(private map: (value: T1) => T2) { diff --git a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping2.ts b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping2.ts index 58bb282ec38..e86abe785cb 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping2.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping2.ts @@ -1,4 +1,4 @@ - + class A { constructor(private map: (value: T1) => T2) { diff --git a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping3.ts b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping3.ts index 6a941dc56c6..45eb37d926a 100644 --- a/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping3.ts +++ b/crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping3.ts @@ -1,4 +1,4 @@ -interface ContextualType { +interface ContextualType { method(parameter: T): void; } diff --git a/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.json b/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.json deleted file mode 100644 index fbce8e0b3f9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.json +++ /dev/null @@ -1,456 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 234, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 8, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 74, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 15, - "end": 41, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 15, - "end": 26, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 27, - "end": 37, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 27, - "end": 37, - "ctxt": 0 - }, - "value": "x", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 29, - "end": 37, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 41, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 46, - "end": 72, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 46, - "end": 47, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 46, - "end": 72, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 58, - "end": 72, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 60, - "end": 70, - "ctxt": 0 - }, - "argument": { - "type": "StringLiteral", - "span": { - "start": 67, - "end": 69, - "ctxt": 0 - }, - "value": "", - "raw": "\"\"" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 49, - "end": 57, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 81, - "end": 83, - "ctxt": 0 - }, - "value": "C1", - "optional": false - }, - "declare": false, - "span": { - "start": 75, - "end": 159, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 100, - "end": 157, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 100, - "end": 111, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 114, - "end": 157, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 124, - "end": 134, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 124, - "end": 133, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 124, - "end": 131, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 130, - "end": 131, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 143, - "end": 151, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 143, - "end": 150, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 143, - "end": 148, - "ctxt": 0 - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 92, - "end": 93, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 166, - "end": 168, - "ctxt": 0 - }, - "value": "C2", - "optional": false - }, - "declare": false, - "span": { - "start": 160, - "end": 234, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 185, - "end": 232, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 196, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 199, - "end": 232, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 209, - "end": 226, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 209, - "end": 225, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 209, - "end": 214, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "CallExpression", - "span": { - "start": 215, - "end": 224, - "ctxt": 0 - }, - "callee": { - "type": "SuperPropExpression", - "span": { - "start": 215, - "end": 222, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 215, - "end": 220, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 221, - "end": 222, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.ts b/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.ts deleted file mode 100644 index 48c1101a2d6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/superPropertyInConstructorBeforeSuperCall.ts +++ /dev/null @@ -1,15 +0,0 @@ -class B { - constructor(x?: string) {} - x(): string { return ""; } -} -class C1 extends B { - constructor() { - super.x(); - super(); - } -} -class C2 extends B { - constructor() { - super(super.x()); - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/symbolProperty59.json b/crates/swc_ecma_parser/tests/tsc/symbolProperty59.json deleted file mode 100644 index 21a3be1d0ae..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/symbolProperty59.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 60, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 16, - "end": 60, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 26, - "end": 27, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 28, - "end": 60, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 34, - "end": 58, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "MemberExpression", - "span": { - "start": 35, - "end": 48, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 35, - "end": 41, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 42, - "end": 48, - "ctxt": 0 - }, - "value": "keyFor", - "optional": false - } - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 49, - "end": 57, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/symbolProperty59.ts b/crates/swc_ecma_parser/tests/tsc/symbolProperty59.ts deleted file mode 100644 index 7887ba51674..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/symbolProperty59.ts +++ /dev/null @@ -1,4 +0,0 @@ -//@target: ES6 -interface I { - [Symbol.keyFor]: string; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/symbolProperty7.json b/crates/swc_ecma_parser/tests/tsc/symbolProperty7.json deleted file mode 100644 index 4db6f01aac0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/symbolProperty7.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 16, - "end": 139, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 22, - "end": 23, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 16, - "end": 139, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 30, - "end": 45, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 30, - "end": 40, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 31, - "end": 39, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 31, - "end": 37, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 43, - "end": 44, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 50, - "end": 69, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 50, - "end": 60, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 51, - "end": 59, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 51, - "end": 57, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 60, - "end": 68, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 62, - "end": 68, - "ctxt": 0 - }, - "kind": "number" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 74, - "end": 90, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 74, - "end": 84, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 75, - "end": 83, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 75, - "end": 81, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 74, - "end": 90, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 87, - "end": 90, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 95, - "end": 137, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 99, - "end": 109, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 100, - "end": 108, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 100, - "end": 106, - "ctxt": 0 - }, - "value": "Symbol", - "optional": false - }, - "arguments": [], - "typeArguments": null - } - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 95, - "end": 137, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 112, - "end": 137, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 122, - "end": 131, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/symbolProperty7.ts b/crates/swc_ecma_parser/tests/tsc/symbolProperty7.ts deleted file mode 100644 index 15f845083e8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/symbolProperty7.ts +++ /dev/null @@ -1,9 +0,0 @@ -//@target: ES6 -class C { - [Symbol()] = 0; - [Symbol()]: number; - [Symbol()]() { } - get [Symbol()]() { - return 0; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/symbolType20.ts b/crates/swc_ecma_parser/tests/tsc/symbolType20.ts index 63f8b696543..4dd771986df 100644 --- a/crates/swc_ecma_parser/tests/tsc/symbolType20.ts +++ b/crates/swc_ecma_parser/tests/tsc/symbolType20.ts @@ -1,2 +1,2 @@ -//@target: ES6 +//@target: ES6 interface symbol { } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.ts index 45c78f6f52c..cdfe96b401c 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01.ts @@ -1,4 +1,4 @@ - + function f(...x: any[]) { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.ts index 9696bc3bbd1..67e0163af0c 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes01_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(...x: any[]) { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.ts index 372f976b875..78cc08b941c 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.ts @@ -1,3 +1,3 @@ - + `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.ts index 2b3d5fa9886..a0f5a2c8cb2 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function f(...x: any[]) { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInference.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInference.ts index 27eb0cf5a84..b432b13d43b 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInference.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInference.ts @@ -1,4 +1,4 @@ - + // Generic tag with one parameter function noParams(n: T) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInferenceES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInferenceES6.ts index 5c85e99b973..a8ef91b3c8c 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInferenceES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsTypeArgumentInferenceES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 // Generic tag with one parameter function noParams(n: T) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTags.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTags.ts index 4d201d6997c..48e6e9be4ca 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTags.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTags.ts @@ -1,4 +1,4 @@ -interface I { +interface I { (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; h: I; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts index fbc8bf91f73..882468f39f9 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 interface I { (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressions.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressions.ts index b319e863ae7..6397bdd723d 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressions.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressions.ts @@ -1,4 +1,4 @@ -interface I { +interface I { (strs: TemplateStringsArray, ...subs: number[]): I; member: { new (s: string): { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts index 73938bc330a..13a4b5cec36 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 interface I { (strs: TemplateStringsArray, ...subs: number[]): I; member: { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1.ts index 06fdec83c30..a0c59fabae5 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1.ts @@ -1,4 +1,4 @@ -function foo(strs: TemplateStringsArray): number; +function foo(strs: TemplateStringsArray): number; function foo(strs: TemplateStringsArray, x: number): string; function foo(strs: TemplateStringsArray, x: number, y: number): boolean; function foo(strs: TemplateStringsArray, x: number, y: string): {}; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1_ES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1_ES6.ts index 77ad41baaa6..ce7f253109a 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution1_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 function foo(strs: TemplateStringsArray): number; function foo(strs: TemplateStringsArray, x: number): string; function foo(strs: TemplateStringsArray, x: number, y: number): boolean; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2.ts index c813ac6c220..530f5d70ba5 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2.ts @@ -1,4 +1,4 @@ - + function foo1(strs: TemplateStringsArray, x: number): string; function foo1(strs: string[], x: number): number; function foo1(...stuff: any[]): any { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2_ES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2_ES6.ts index 37e2921344a..67297051e55 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution2_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 function foo1(strs: TemplateStringsArray, x: number): string; function foo1(strs: string[], x: number): number; function foo1(...stuff: any[]): any { diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3.ts index e289b5a625f..c1a9bc054f4 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3.ts @@ -1,4 +1,4 @@ - + // Ambiguous call picks the first overload in declaration order function fn1(strs: TemplateStringsArray, s: string): string; function fn1(strs: TemplateStringsArray, n: number): number; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3_ES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3_ES6.ts index 4452c9a5cff..61de868a356 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithOverloadResolution3_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 // Ambiguous call picks the first overload in declaration order function fn1(strs: TemplateStringsArray, s: string): string; function fn1(strs: TemplateStringsArray, n: number): number; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclare.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclare.ts index ea9223d55ad..a182be8e6aa 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclare.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclare.ts @@ -1,4 +1,4 @@ - + function declare(x: any, ...ys: any[]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclareES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclareES6.ts index fa8a5cbe316..36edffdf011 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclareES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagNamedDeclareES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 function declare(x: any, ...ys: any[]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAny.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAny.ts index 490a48e8b82..06b184465c5 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAny.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAny.ts @@ -1,4 +1,4 @@ -var f: any; +var f: any; f `abc` diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAnyES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAnyES6.ts index adf732ccaf3..ac86ab00bcf 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAnyES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTagsTypedAsAnyES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var f: any; f `abc` diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts index 92c374643d0..41cc5b2e059 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts @@ -1,4 +1,4 @@ - + function foo(...rest: any[]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts index 6f2223dc6ee..111298a9748 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 function foo(...rest: any[]) { } diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTags.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTags.ts index e6028c0b8a6..02a4c93fffc 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTags.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTags.ts @@ -1,4 +1,4 @@ -interface I { +interface I { (stringParts: TemplateStringsArray, ...rest: number[]): I; g: I; h: I; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTagsES6.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTagsES6.ts index cf00f633a3b..5d97240f388 100644 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTagsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/taggedTemplateStringsWithTypedTagsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 interface I { (stringParts: TemplateStringsArray, ...rest: number[]): I; g: I; diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.json b/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.json deleted file mode 100644 index b419cd5b2fc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.json +++ /dev/null @@ -1,1765 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 73, - "end": 889, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 73, - "end": 177, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 80, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 90, - "end": 107, - "ctxt": 0 - }, - "value": "SomethingTaggable", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 108, - "end": 177, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 114, - "end": 175, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 118, - "end": 141, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 141, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 121, - "end": 141, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 121, - "end": 141, - "ctxt": 0 - }, - "value": "TemplateStringsArray", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "RestElement", - "span": { - "start": 143, - "end": 155, - "ctxt": 0 - }, - "rest": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 146, - "end": 150, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 150, - "end": 155, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 152, - "end": 153, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 152, - "end": 153, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 156, - "end": 174, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 158, - "end": 174, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 158, - "end": 174, - "ctxt": 0 - }, - "value": "SomethingNewable", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - } - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 179, - "end": 248, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 186, - "end": 248, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 196, - "end": 212, - "ctxt": 0 - }, - "value": "SomethingNewable", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 213, - "end": 248, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 219, - "end": 246, - "ctxt": 0 - }, - "params": [ - { - "type": "RestElement", - "span": { - "start": 227, - "end": 239, - "ctxt": 0 - }, - "rest": { - "start": 227, - "end": 230, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 234, - "end": 239, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 236, - "end": 237, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 236, - "end": 237, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 240, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 242, - "end": 245, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - } - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 250, - "end": 287, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 264, - "end": 286, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "value": "tag", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 267, - "end": 286, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 269, - "end": 286, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 269, - "end": 286, - "ctxt": 0 - }, - "value": "SomethingTaggable", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 289, - "end": 349, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 295, - "end": 348, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 295, - "end": 296, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 299, - "end": 348, - "ctxt": 0 - }, - "callee": { - "type": "TaggedTemplateExpression", - "span": { - "start": 303, - "end": 322, - "ctxt": 0 - }, - "tag": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "typeParameters": null, - "template": { - "type": "TemplateLiteral", - "span": { - "start": 307, - "end": 322, - "ctxt": 0 - }, - "expressions": [ - { - "type": "NumericLiteral", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "value": 100.0, - "raw": "100" - }, - { - "type": "NumericLiteral", - "span": { - "start": 317, - "end": 320, - "ctxt": 0 - }, - "value": 200.0, - "raw": "200" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 308, - "end": 308, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 314, - "end": 315, - "ctxt": 0 - }, - "tail": false, - "cooked": " ", - "raw": " " - }, - { - "type": "TemplateElement", - "span": { - "start": 321, - "end": 321, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 331, - "end": 338, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 340, - "end": 347, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 323, - "end": 329, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 351, - "end": 411, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 357, - "end": 410, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 361, - "end": 410, - "ctxt": 0 - }, - "callee": { - "type": "TaggedTemplateExpression", - "span": { - "start": 365, - "end": 400, - "ctxt": 0 - }, - "tag": { - "type": "Identifier", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "typeParameters": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 368, - "end": 376, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 369, - "end": 375, - "ctxt": 0 - }, - "kind": "number" - } - ] - }, - "template": { - "type": "TemplateLiteral", - "span": { - "start": 377, - "end": 400, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 380, - "end": 387, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - }, - { - "type": "StringLiteral", - "span": { - "start": 391, - "end": 398, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 378, - "end": 378, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 388, - "end": 389, - "ctxt": 0 - }, - "tail": false, - "cooked": " ", - "raw": " " - }, - { - "type": "TemplateElement", - "span": { - "start": 399, - "end": 399, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "value": 100.0, - "raw": "100" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "value": 200.0, - "raw": "200" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 481, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 419, - "end": 480, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 423, - "end": 480, - "ctxt": 0 - }, - "callee": { - "type": "TaggedTemplateExpression", - "span": { - "start": 427, - "end": 454, - "ctxt": 0 - }, - "tag": { - "type": "Identifier", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "typeParameters": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 430, - "end": 438, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 431, - "end": 437, - "ctxt": 0 - }, - "kind": "number" - } - ] - }, - "template": { - "type": "TemplateLiteral", - "span": { - "start": 439, - "end": 454, - "ctxt": 0 - }, - "expressions": [ - { - "type": "NumericLiteral", - "span": { - "start": 442, - "end": 445, - "ctxt": 0 - }, - "value": 100.0, - "raw": "100" - }, - { - "type": "NumericLiteral", - "span": { - "start": 449, - "end": 452, - "ctxt": 0 - }, - "value": 200.0, - "raw": "200" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 440, - "end": 440, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 446, - "end": 447, - "ctxt": 0 - }, - "tail": false, - "cooked": " ", - "raw": " " - }, - { - "type": "TemplateElement", - "span": { - "start": 453, - "end": 453, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 463, - "end": 470, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 472, - "end": 479, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 454, - "end": 462, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 455, - "end": 461, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 483, - "end": 551, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 489, - "end": 550, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 493, - "end": 550, - "ctxt": 0 - }, - "callee": { - "type": "TaggedTemplateExpression", - "span": { - "start": 497, - "end": 532, - "ctxt": 0 - }, - "tag": { - "type": "Identifier", - "span": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "typeParameters": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 500, - "end": 508, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 501, - "end": 507, - "ctxt": 0 - }, - "kind": "number" - } - ] - }, - "template": { - "type": "TemplateLiteral", - "span": { - "start": 509, - "end": 532, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 512, - "end": 519, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - }, - { - "type": "StringLiteral", - "span": { - "start": 523, - "end": 530, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 510, - "end": 510, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 520, - "end": 521, - "ctxt": 0 - }, - "tail": false, - "cooked": " ", - "raw": " " - }, - { - "type": "TemplateElement", - "span": { - "start": 531, - "end": 531, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 541, - "end": 544, - "ctxt": 0 - }, - "value": 100.0, - "raw": "100" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 546, - "end": 549, - "ctxt": 0 - }, - "value": 200.0, - "raw": "200" - } - } - ], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 532, - "end": 540, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 533, - "end": 539, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 663, - "end": 699, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 669, - "end": 698, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 669, - "end": 670, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 673, - "end": 698, - "ctxt": 0 - }, - "callee": { - "type": "TaggedTemplateExpression", - "span": { - "start": 677, - "end": 696, - "ctxt": 0 - }, - "tag": { - "type": "Identifier", - "span": { - "start": 677, - "end": 680, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "typeParameters": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 680, - "end": 688, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 681, - "end": 687, - "ctxt": 0 - }, - "kind": "number" - } - ] - }, - "template": { - "type": "TemplateLiteral", - "span": { - "start": 689, - "end": 696, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 690, - "end": 695, - "ctxt": 0 - }, - "tail": true, - "cooked": "hello", - "raw": "hello" - } - ] - } - }, - "arguments": [], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 707, - "end": 715, - "ctxt": 0 - }, - "value": "SomeBase", - "optional": false - }, - "declare": false, - "span": { - "start": 701, - "end": 753, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 731, - "end": 737, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 731, - "end": 732, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 733, - "end": 736, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 735, - "end": 736, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 735, - "end": 736, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "ClassProperty", - "span": { - "start": 738, - "end": 744, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 738, - "end": 739, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 740, - "end": 743, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 742, - "end": 743, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 742, - "end": 743, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - }, - { - "type": "ClassProperty", - "span": { - "start": 745, - "end": 751, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 745, - "end": 746, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 747, - "end": 750, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 749, - "end": 750, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 749, - "end": 750, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": true - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 715, - "end": 724, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 716, - "end": 717, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 716, - "end": 717, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 719, - "end": 720, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 719, - "end": 720, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 722, - "end": 723, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 722, - "end": 723, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 761, - "end": 772, - "ctxt": 0 - }, - "value": "SomeDerived", - "optional": false - }, - "declare": false, - "span": { - "start": 755, - "end": 889, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 818, - "end": 887, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 818, - "end": 829, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 832, - "end": 887, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 842, - "end": 881, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 847, - "end": 880, - "ctxt": 0 - }, - "expressions": [ - { - "type": "BinaryExpression", - "span": { - "start": 847, - "end": 854, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Invalid", - "span": { - "start": 847, - "end": 848, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 848, - "end": 854, - "ctxt": 0 - }, - "value": "number", - "optional": false - } - }, - { - "type": "Identifier", - "span": { - "start": 856, - "end": 862, - "ctxt": 0 - }, - "value": "string", - "optional": false - }, - { - "type": "BinaryExpression", - "span": { - "start": 864, - "end": 880, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 864, - "end": 865, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "right": { - "type": "TemplateLiteral", - "span": { - "start": 867, - "end": 880, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 868, - "end": 879, - "ctxt": 0 - }, - "tail": true, - "cooked": "hello world", - "raw": "hello world" - } - ] - } - } - ] - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 784, - "end": 792, - "ctxt": 0 - }, - "value": "SomeBase", - "optional": false - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 772, - "end": 775, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 773, - "end": 774, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 773, - "end": 774, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 792, - "end": 811, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 793, - "end": 799, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 801, - "end": 807, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsTypeReference", - "span": { - "start": 809, - "end": 810, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 809, - "end": 810, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.ts b/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.ts deleted file mode 100644 index 9081c4333b4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/taggedTemplatesWithTypeArguments2.ts +++ /dev/null @@ -1,42 +0,0 @@ -// @target: esnext -// @strict: true -// @useDefineForClassFields: false - -export interface SomethingTaggable { - (t: TemplateStringsArray, ...args: T[]): SomethingNewable; -} - -export interface SomethingNewable { - new (...args: T[]): any; -} - -declare const tag: SomethingTaggable; - -const a = new tag `${100} ${200}`("hello", "world"); - -const b = new tag `${"hello"} ${"world"}`(100, 200); - -const c = new tag `${100} ${200}`("hello", "world"); - -const d = new tag `${"hello"} ${"world"}`(100, 200); - -/** - * Testing ASI. This should never parse as - * - * ```ts - * new tag; - * `hello${369}`(); - * ``` - */ -const e = new tag -`hello`(); - -class SomeBase { - a!: A; b!: B; c!: C; -} - -class SomeDerived extends SomeBase { - constructor() { - super `hello world`; - } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.json b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.json deleted file mode 100644 index e7df82d5c06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.json +++ /dev/null @@ -1,12304 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 107, - "end": 5205, - "ctxt": 0 - }, - "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 107, - "end": 159, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 116, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 116, - "end": 119, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 122, - "end": 158, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 122, - "end": 123, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 122, - "end": 123, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 132, - "end": 146, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 132, - "end": 146, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 136, - "end": 143, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 149, - "end": 150, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "kind": "never" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 161, - "end": 186, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 166, - "end": 169, - "ctxt": 0 - }, - "value": "T01", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 172, - "end": 185, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 172, - "end": 176, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 176, - "end": 185, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 177, - "end": 184, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 177, - "end": 184, - "ctxt": 0 - }, - "value": "hello", - "raw": "'hello'" - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 187, - "end": 214, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "T02", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 198, - "end": 213, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 198, - "end": 202, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 202, - "end": 213, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "*hello*", - "raw": "'*hello*'" - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 215, - "end": 244, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 220, - "end": 223, - "ctxt": 0 - }, - "value": "T03", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 226, - "end": 243, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 226, - "end": 230, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 230, - "end": 243, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 231, - "end": 242, - "ctxt": 0 - }, - "value": "**hello**", - "raw": "'**hello**'" - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 245, - "end": 276, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 250, - "end": 253, - "ctxt": 0 - }, - "value": "T04", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 256, - "end": 275, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 256, - "end": 260, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 260, - "end": 275, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 261, - "end": 274, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 261, - "end": 274, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 262, - "end": 263, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 277, - "end": 308, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 282, - "end": 285, - "ctxt": 0 - }, - "value": "T05", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 288, - "end": 307, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 288, - "end": 292, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 292, - "end": 307, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 293, - "end": 306, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 293, - "end": 306, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 297, - "end": 303, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 309, - "end": 340, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "T06", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 320, - "end": 339, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 320, - "end": 324, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 324, - "end": 339, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 325, - "end": 338, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 325, - "end": 338, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 329, - "end": 335, - "ctxt": 0 - }, - "kind": "bigint" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 336, - "end": 337, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 341, - "end": 369, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - }, - "value": "T07", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 352, - "end": 368, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 352, - "end": 356, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 356, - "end": 368, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 361, - "end": 364, - "ctxt": 0 - }, - "kind": "any" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 365, - "end": 366, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 370, - "end": 403, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 375, - "end": 378, - "ctxt": 0 - }, - "value": "T08", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 381, - "end": 402, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 381, - "end": 385, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 385, - "end": 402, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 386, - "end": 401, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 386, - "end": 401, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 391, - "end": 397, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 387, - "end": 389, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 404, - "end": 448, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 409, - "end": 412, - "ctxt": 0 - }, - "value": "T09", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 415, - "end": 447, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 415, - "end": 419, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 419, - "end": 447, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 420, - "end": 446, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 420, - "end": 446, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 425, - "end": 431, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 436, - "end": 442, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 421, - "end": 423, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 432, - "end": 434, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 443, - "end": 445, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 449, - "end": 491, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 454, - "end": 457, - "ctxt": 0 - }, - "value": "T10", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 460, - "end": 490, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 460, - "end": 464, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 464, - "end": 490, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 465, - "end": 489, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 465, - "end": 489, - "ctxt": 0 - }, - "types": [ - { - "type": "TsUnionType", - "span": { - "start": 470, - "end": 485, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 470, - "end": 473, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 470, - "end": 473, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 466, - "end": 468, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 486, - "end": 488, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 492, - "end": 538, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "value": "T11", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 503, - "end": 537, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 503, - "end": 507, - "ctxt": 0 - }, - "value": "Foo1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 507, - "end": 537, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 508, - "end": 536, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 508, - "end": 536, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 513, - "end": 520, - "ctxt": 0 - }, - "kind": "boolean" - }, - { - "type": "TsKeywordType", - "span": { - "start": 525, - "end": 532, - "ctxt": 0 - }, - "kind": "boolean" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 509, - "end": 511, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 521, - "end": 523, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 533, - "end": 535, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - ] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 557, - "end": 561, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 580, - "end": 593, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 580, - "end": 593, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 583, - "end": 593, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 585, - "end": 593, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 585, - "end": 593, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 589, - "end": 590, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 589, - "end": 590, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 586, - "end": 587, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 591, - "end": 592, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 540, - "end": 598, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 561, - "end": 579, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 562, - "end": 578, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 562, - "end": 563, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 572, - "end": 578, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 594, - "end": 597, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 596, - "end": 597, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 596, - "end": 597, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 609, - "end": 611, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 631, - "end": 639, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 633, - "end": 639, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 641, - "end": 650, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 641, - "end": 650, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 642, - "end": 650, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 644, - "end": 650, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 652, - "end": 662, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 652, - "end": 662, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 653, - "end": 662, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 655, - "end": 662, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 664, - "end": 668, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 664, - "end": 668, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 665, - "end": 668, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 600, - "end": 965, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 670, - "end": 965, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 676, - "end": 699, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 680, - "end": 698, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 680, - "end": 682, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 685, - "end": 698, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 685, - "end": 689, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 690, - "end": 697, - "ctxt": 0 - }, - "value": "hello", - "raw": "'hello'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 714, - "end": 739, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 718, - "end": 738, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 718, - "end": 720, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 723, - "end": 738, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 723, - "end": 727, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 728, - "end": 737, - "ctxt": 0 - }, - "value": "*hello*", - "raw": "'*hello*'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 744, - "end": 771, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 748, - "end": 770, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 748, - "end": 750, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 753, - "end": 770, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 753, - "end": 757, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 758, - "end": 769, - "ctxt": 0 - }, - "value": "**hello**", - "raw": "'**hello**'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 776, - "end": 809, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 780, - "end": 808, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 780, - "end": 782, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 785, - "end": 808, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 785, - "end": 789, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TsConstAssertion", - "span": { - "start": 790, - "end": 807, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 790, - "end": 798, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 794, - "end": 795, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 791, - "end": 792, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 796, - "end": 797, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 814, - "end": 847, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 818, - "end": 846, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 818, - "end": 820, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 823, - "end": 846, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 823, - "end": 827, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TsConstAssertion", - "span": { - "start": 828, - "end": 845, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 828, - "end": 836, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 832, - "end": 833, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 829, - "end": 830, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 834, - "end": 835, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 852, - "end": 885, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 856, - "end": 884, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 856, - "end": 858, - "ctxt": 0 - }, - "value": "x6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 861, - "end": 884, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 861, - "end": 865, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TsConstAssertion", - "span": { - "start": 866, - "end": 883, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 866, - "end": 874, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 870, - "end": 871, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 867, - "end": 868, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 872, - "end": 873, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 890, - "end": 923, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 894, - "end": 922, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 894, - "end": 896, - "ctxt": 0 - }, - "value": "x7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 899, - "end": 922, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 899, - "end": 903, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TsConstAssertion", - "span": { - "start": 904, - "end": 921, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 904, - "end": 912, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 908, - "end": 909, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 905, - "end": 906, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 910, - "end": 911, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 928, - "end": 963, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 932, - "end": 962, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 932, - "end": 934, - "ctxt": 0 - }, - "value": "x8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 937, - "end": 962, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 937, - "end": 941, - "ctxt": 0 - }, - "value": "foo1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TsConstAssertion", - "span": { - "start": 942, - "end": 961, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 942, - "end": 952, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 947, - "end": 948, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 943, - "end": 945, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 949, - "end": 951, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 611, - "end": 629, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 612, - "end": 628, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 612, - "end": 613, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 622, - "end": 628, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1103, - "end": 1223, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1108, - "end": 1113, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1113, - "end": 1116, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1114, - "end": 1115, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1114, - "end": 1115, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 1123, - "end": 1222, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1123, - "end": 1124, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1123, - "end": 1124, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 1133, - "end": 1135, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1133, - "end": 1135, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - "trueType": { - "type": "TsTupleType", - "span": { - "start": 1138, - "end": 1140, - "ctxt": 0 - }, - "elemTypes": [] - }, - "falseType": { - "type": "TsConditionalType", - "span": { - "start": 1147, - "end": 1222, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1147, - "end": 1148, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1147, - "end": 1148, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 1157, - "end": 1185, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1157, - "end": 1185, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 1160, - "end": 1170, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1166, - "end": 1170, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1166, - "end": 1170, - "ctxt": 0 - }, - "value": "Head", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsInferType", - "span": { - "start": 1173, - "end": 1183, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1179, - "end": 1183, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1179, - "end": 1183, - "ctxt": 0 - }, - "value": "Tail", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1158, - "end": 1158, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1171, - "end": 1171, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1184, - "end": 1184, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "trueType": { - "type": "TsTupleType", - "span": { - "start": 1188, - "end": 1210, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 1189, - "end": 1193, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeReference", - "span": { - "start": 1189, - "end": 1193, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1189, - "end": 1193, - "ctxt": 0 - }, - "value": "Head", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTupleElement", - "span": { - "start": 1195, - "end": 1209, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsRestType", - "span": { - "start": 1195, - "end": 1209, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1198, - "end": 1209, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1198, - "end": 1203, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1203, - "end": 1209, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1204, - "end": 1208, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1204, - "end": 1208, - "ctxt": 0 - }, - "value": "Tail", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ] - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 1217, - "end": 1222, - "ctxt": 0 - }, - "kind": "never" - } - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1225, - "end": 1249, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1230, - "end": 1233, - "ctxt": 0 - }, - "value": "T20", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1236, - "end": 1248, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1236, - "end": 1241, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1241, - "end": 1248, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 1242, - "end": 1247, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1242, - "end": 1247, - "ctxt": 0 - }, - "types": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1243, - "end": 1246, - "ctxt": 0 - }, - "tail": true, - "cooked": "abc", - "raw": "abc" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1250, - "end": 1282, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1255, - "end": 1258, - "ctxt": 0 - }, - "value": "T21", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1261, - "end": 1281, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1261, - "end": 1266, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1266, - "end": 1281, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 1267, - "end": 1280, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1267, - "end": 1280, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1271, - "end": 1277, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1268, - "end": 1269, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1278, - "end": 1279, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1283, - "end": 1315, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1288, - "end": 1291, - "ctxt": 0 - }, - "value": "T22", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1294, - "end": 1314, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1294, - "end": 1299, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1299, - "end": 1314, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 1300, - "end": 1313, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1300, - "end": 1313, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1304, - "end": 1310, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1301, - "end": 1302, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1311, - "end": 1312, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1316, - "end": 1368, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1321, - "end": 1324, - "ctxt": 0 - }, - "value": "T23", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1327, - "end": 1367, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1327, - "end": 1332, - "ctxt": 0 - }, - "value": "Parts", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1332, - "end": 1367, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 1333, - "end": 1366, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1333, - "end": 1366, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1337, - "end": 1343, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1347, - "end": 1353, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1357, - "end": 1363, - "ctxt": 0 - }, - "kind": "bigint" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1334, - "end": 1335, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1344, - "end": 1345, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1354, - "end": 1355, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1364, - "end": 1365, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - ] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1379, - "end": 1381, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 1370, - "end": 1740, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1384, - "end": 1740, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1390, - "end": 1429, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1394, - "end": 1428, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1394, - "end": 1395, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1395, - "end": 1428, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1397, - "end": 1428, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1397, - "end": 1428, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1400, - "end": 1406, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1410, - "end": 1416, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1420, - "end": 1426, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1398, - "end": 1398, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1407, - "end": 1408, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1417, - "end": 1418, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1427, - "end": 1427, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1434, - "end": 1446, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1434, - "end": 1445, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1435, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1438, - "end": 1445, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1451, - "end": 1482, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1451, - "end": 1481, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1451, - "end": 1452, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1455, - "end": 1481, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1455, - "end": 1462, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1466, - "end": 1481, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1466, - "end": 1481, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1473, - "end": 1479, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1467, - "end": 1471, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.1.", - "raw": "1.1." - }, - { - "type": "TemplateElement", - "span": { - "start": 1480, - "end": 1480, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1487, - "end": 1518, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1487, - "end": 1517, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1487, - "end": 1488, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1491, - "end": 1517, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1491, - "end": 1498, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1502, - "end": 1517, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1502, - "end": 1517, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1507, - "end": 1513, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1503, - "end": 1505, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 1514, - "end": 1516, - "ctxt": 0 - }, - "tail": true, - "cooked": ".1", - "raw": ".1" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1523, - "end": 1562, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1523, - "end": 1561, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1523, - "end": 1524, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1527, - "end": 1561, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1527, - "end": 1534, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1538, - "end": 1561, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1538, - "end": 1561, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1543, - "end": 1549, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1553, - "end": 1559, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1539, - "end": 1541, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 1550, - "end": 1551, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1560, - "end": 1560, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1567, - "end": 1598, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1567, - "end": 1597, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1567, - "end": 1568, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1571, - "end": 1597, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1571, - "end": 1578, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1582, - "end": 1597, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1582, - "end": 1597, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1585, - "end": 1591, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1583, - "end": 1583, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1592, - "end": 1596, - "ctxt": 0 - }, - "tail": true, - "cooked": ".1.1", - "raw": ".1.1" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1603, - "end": 1642, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1603, - "end": 1641, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1603, - "end": 1604, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1607, - "end": 1641, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1607, - "end": 1614, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1618, - "end": 1641, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1618, - "end": 1641, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1621, - "end": 1627, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1633, - "end": 1639, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1619, - "end": 1619, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1628, - "end": 1631, - "ctxt": 0 - }, - "tail": false, - "cooked": ".1.", - "raw": ".1." - }, - { - "type": "TemplateElement", - "span": { - "start": 1640, - "end": 1640, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1647, - "end": 1686, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1647, - "end": 1685, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1647, - "end": 1648, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1651, - "end": 1685, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1651, - "end": 1658, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1662, - "end": 1685, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1662, - "end": 1685, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1665, - "end": 1671, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1675, - "end": 1681, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1663, - "end": 1663, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1672, - "end": 1673, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1682, - "end": 1684, - "ctxt": 0 - }, - "tail": true, - "cooked": ".1", - "raw": ".1" - } - ] - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1691, - "end": 1738, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1691, - "end": 1737, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1691, - "end": 1692, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsAsExpression", - "span": { - "start": 1695, - "end": 1737, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1695, - "end": 1702, - "ctxt": 0 - }, - "value": "1.1.1", - "raw": "'1.1.1'" - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1706, - "end": 1737, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1706, - "end": 1737, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1709, - "end": 1715, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1719, - "end": 1725, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 1729, - "end": 1735, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1707, - "end": 1707, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 1716, - "end": 1717, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1726, - "end": 1727, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 1736, - "end": 1736, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1751, - "end": 1753, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1772, - "end": 1781, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1772, - "end": 1781, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1773, - "end": 1781, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1775, - "end": 1781, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1783, - "end": 1792, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1783, - "end": 1792, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1784, - "end": 1792, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1786, - "end": 1792, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1794, - "end": 1804, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1794, - "end": 1804, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1795, - "end": 1804, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1797, - "end": 1804, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1806, - "end": 1810, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1806, - "end": 1810, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1807, - "end": 1810, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1809, - "end": 1810, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1809, - "end": 1810, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1742, - "end": 2045, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1812, - "end": 2045, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1818, - "end": 1839, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1822, - "end": 1838, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1822, - "end": 1823, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1823, - "end": 1838, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1825, - "end": 1838, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 1825, - "end": 1838, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 1829, - "end": 1835, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1826, - "end": 1827, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1836, - "end": 1837, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1844, - "end": 1856, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1844, - "end": 1855, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1844, - "end": 1845, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1848, - "end": 1855, - "ctxt": 0 - }, - "value": "hello", - "raw": "'hello'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1871, - "end": 1885, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1871, - "end": 1884, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1871, - "end": 1872, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1875, - "end": 1884, - "ctxt": 0 - }, - "value": "*hello*", - "raw": "'*hello*'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1890, - "end": 1906, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1890, - "end": 1905, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1890, - "end": 1891, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 1894, - "end": 1905, - "ctxt": 0 - }, - "value": "**hello**", - "raw": "'**hello**'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1911, - "end": 1933, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1911, - "end": 1932, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1911, - "end": 1912, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 1915, - "end": 1932, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1915, - "end": 1923, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1919, - "end": 1920, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1916, - "end": 1917, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1921, - "end": 1922, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1938, - "end": 1960, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1938, - "end": 1959, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1938, - "end": 1939, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 1942, - "end": 1959, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1942, - "end": 1950, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1946, - "end": 1947, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1943, - "end": 1944, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1948, - "end": 1949, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1965, - "end": 1987, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1965, - "end": 1986, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1965, - "end": 1966, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 1969, - "end": 1986, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1969, - "end": 1977, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 1973, - "end": 1974, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1970, - "end": 1971, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 1975, - "end": 1976, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1992, - "end": 2014, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 1992, - "end": 2013, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 1992, - "end": 1993, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 1996, - "end": 2013, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 1996, - "end": 2004, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2000, - "end": 2001, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 1997, - "end": 1998, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2002, - "end": 2003, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2019, - "end": 2043, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2019, - "end": 2042, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2019, - "end": 2020, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 2023, - "end": 2042, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2023, - "end": 2033, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2028, - "end": 2029, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2024, - "end": 2026, - "ctxt": 0 - }, - "tail": false, - "cooked": "**", - "raw": "**" - }, - { - "type": "TemplateElement", - "span": { - "start": 2030, - "end": 2032, - "ctxt": 0 - }, - "tail": true, - "cooked": "**", - "raw": "**" - } - ] - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1753, - "end": 1771, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1754, - "end": 1770, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1754, - "end": 1755, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 1764, - "end": 1770, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2056, - "end": 2058, - "ctxt": 0 - }, - "value": "f4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 2077, - "end": 2086, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2077, - "end": 2086, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2078, - "end": 2086, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2080, - "end": 2086, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2088, - "end": 2097, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2088, - "end": 2097, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2089, - "end": 2097, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2091, - "end": 2097, - "ctxt": 0 - }, - "kind": "number" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2099, - "end": 2109, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2099, - "end": 2109, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2100, - "end": 2109, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 2102, - "end": 2109, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 2111, - "end": 2115, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 2111, - "end": 2115, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2112, - "end": 2115, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2114, - "end": 2115, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2114, - "end": 2115, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 2047, - "end": 2345, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 2117, - "end": 2345, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 2123, - "end": 2144, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2127, - "end": 2143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2127, - "end": 2128, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 2128, - "end": 2143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 2130, - "end": 2143, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2130, - "end": 2143, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 2134, - "end": 2140, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2131, - "end": 2132, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2141, - "end": 2142, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2149, - "end": 2159, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2149, - "end": 2158, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2149, - "end": 2150, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2153, - "end": 2158, - "ctxt": 0 - }, - "value": "123", - "raw": "'123'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2174, - "end": 2186, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2174, - "end": 2185, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2174, - "end": 2175, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2178, - "end": 2185, - "ctxt": 0 - }, - "value": "*123*", - "raw": "'*123*'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2191, - "end": 2205, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2191, - "end": 2204, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2191, - "end": 2192, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 2195, - "end": 2204, - "ctxt": 0 - }, - "value": "**123**", - "raw": "'**123**'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2220, - "end": 2242, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2220, - "end": 2241, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2220, - "end": 2221, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 2224, - "end": 2241, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2224, - "end": 2232, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2228, - "end": 2229, - "ctxt": 0 - }, - "value": "s", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2225, - "end": 2226, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2230, - "end": 2231, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2257, - "end": 2279, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2257, - "end": 2278, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2257, - "end": 2258, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 2261, - "end": 2278, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2261, - "end": 2269, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2265, - "end": 2266, - "ctxt": 0 - }, - "value": "n", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2262, - "end": 2263, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2267, - "end": 2268, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2284, - "end": 2306, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2284, - "end": 2305, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2284, - "end": 2285, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 2288, - "end": 2305, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2288, - "end": 2296, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2292, - "end": 2293, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2289, - "end": 2290, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2294, - "end": 2295, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 2321, - "end": 2343, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 2321, - "end": 2342, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "Identifier", - "span": { - "start": 2321, - "end": 2322, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsConstAssertion", - "span": { - "start": 2325, - "end": 2342, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 2325, - "end": 2333, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 2329, - "end": 2330, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2326, - "end": 2327, - "ctxt": 0 - }, - "tail": false, - "cooked": "*", - "raw": "*" - }, - { - "type": "TemplateElement", - "span": { - "start": 2331, - "end": 2332, - "ctxt": 0 - }, - "tail": true, - "cooked": "*", - "raw": "*" - } - ] - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2058, - "end": 2076, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2059, - "end": 2075, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2059, - "end": 2060, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 2069, - "end": 2075, - "ctxt": 0 - }, - "kind": "number" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2369, - "end": 2430, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2374, - "end": 2375, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2375, - "end": 2378, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2376, - "end": 2377, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2376, - "end": 2377, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 2381, - "end": 2430, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 2381, - "end": 2382, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2381, - "end": 2382, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 2391, - "end": 2414, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2391, - "end": 2414, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 2394, - "end": 2401, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2400, - "end": 2401, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2400, - "end": 2401, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsInferType", - "span": { - "start": 2405, - "end": 2412, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2411, - "end": 2412, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2411, - "end": 2412, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2392, - "end": 2392, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2402, - "end": 2403, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 2413, - "end": 2413, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "trueType": { - "type": "TsUnionType", - "span": { - "start": 2417, - "end": 2422, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 2417, - "end": 2418, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2417, - "end": 2418, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 2421, - "end": 2422, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2421, - "end": 2422, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "typeParams": null - } - ] - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 2425, - "end": 2430, - "ctxt": 0 - }, - "kind": "never" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2431, - "end": 2455, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2436, - "end": 2437, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2440, - "end": 2454, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2440, - "end": 2441, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2441, - "end": 2454, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2442, - "end": 2453, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2442, - "end": 2453, - "ctxt": 0 - }, - "types": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2443, - "end": 2452, - "ctxt": 0 - }, - "tail": true, - "cooked": "test.1024", - "raw": "test.1024" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2476, - "end": 2505, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2481, - "end": 2482, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2485, - "end": 2504, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2485, - "end": 2486, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2486, - "end": 2504, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2487, - "end": 2503, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2487, - "end": 2503, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 2495, - "end": 2501, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2488, - "end": 2493, - "ctxt": 0 - }, - "tail": false, - "cooked": "test.", - "raw": "test." - }, - { - "type": "TemplateElement", - "span": { - "start": 2502, - "end": 2502, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2532, - "end": 2588, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2537, - "end": 2538, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2538, - "end": 2541, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2539, - "end": 2540, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2539, - "end": 2540, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 2544, - "end": 2588, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 2544, - "end": 2545, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2544, - "end": 2545, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 2554, - "end": 2576, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2554, - "end": 2576, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 2557, - "end": 2564, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2563, - "end": 2564, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2563, - "end": 2564, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsKeywordType", - "span": { - "start": 2568, - "end": 2574, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2555, - "end": 2555, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2565, - "end": 2566, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 2575, - "end": 2575, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 2579, - "end": 2580, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2579, - "end": 2580, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 2583, - "end": 2588, - "ctxt": 0 - }, - "kind": "never" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2589, - "end": 2613, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2594, - "end": 2595, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2598, - "end": 2612, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2598, - "end": 2599, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2599, - "end": 2612, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2600, - "end": 2611, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2600, - "end": 2611, - "ctxt": 0 - }, - "types": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2601, - "end": 2610, - "ctxt": 0 - }, - "tail": true, - "cooked": "test.1024", - "raw": "test.1024" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2625, - "end": 2654, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2630, - "end": 2631, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2634, - "end": 2653, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2634, - "end": 2635, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2635, - "end": 2653, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2636, - "end": 2652, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2636, - "end": 2652, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 2644, - "end": 2650, - "ctxt": 0 - }, - "kind": "number" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2637, - "end": 2642, - "ctxt": 0 - }, - "tail": false, - "cooked": "test.", - "raw": "test." - }, - { - "type": "TemplateElement", - "span": { - "start": 2651, - "end": 2651, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2667, - "end": 2728, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2672, - "end": 2673, - "ctxt": 0 - }, - "value": "G", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2673, - "end": 2676, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2674, - "end": 2675, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2674, - "end": 2675, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 2679, - "end": 2728, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 2679, - "end": 2680, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2679, - "end": 2680, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 2689, - "end": 2712, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2689, - "end": 2712, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 2692, - "end": 2699, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2698, - "end": 2699, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2698, - "end": 2699, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsInferType", - "span": { - "start": 2703, - "end": 2710, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2709, - "end": 2710, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2709, - "end": 2710, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2690, - "end": 2690, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2700, - "end": 2701, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 2711, - "end": 2711, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "trueType": { - "type": "TsUnionType", - "span": { - "start": 2715, - "end": 2720, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 2715, - "end": 2716, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2715, - "end": 2716, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 2719, - "end": 2720, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2719, - "end": 2720, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "typeParams": null - } - ] - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 2723, - "end": 2728, - "ctxt": 0 - }, - "kind": "never" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2729, - "end": 2753, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2734, - "end": 2735, - "ctxt": 0 - }, - "value": "H", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2738, - "end": 2752, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2738, - "end": 2739, - "ctxt": 0 - }, - "value": "G", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2739, - "end": 2752, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2740, - "end": 2751, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2740, - "end": 2751, - "ctxt": 0 - }, - "types": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2741, - "end": 2750, - "ctxt": 0 - }, - "tail": true, - "cooked": "test.hoge", - "raw": "test.hoge" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2774, - "end": 2803, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2779, - "end": 2780, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2783, - "end": 2802, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2783, - "end": 2784, - "ctxt": 0 - }, - "value": "G", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2784, - "end": 2802, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2785, - "end": 2801, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2785, - "end": 2801, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 2793, - "end": 2799, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2786, - "end": 2791, - "ctxt": 0 - }, - "tail": false, - "cooked": "test.", - "raw": "test." - }, - { - "type": "TemplateElement", - "span": { - "start": 2800, - "end": 2800, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2852, - "end": 2908, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2857, - "end": 2858, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 2858, - "end": 2861, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 2859, - "end": 2860, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2859, - "end": 2860, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 2864, - "end": 2908, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 2864, - "end": 2865, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2864, - "end": 2865, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 2874, - "end": 2896, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2874, - "end": 2896, - "ctxt": 0 - }, - "types": [ - { - "type": "TsInferType", - "span": { - "start": 2877, - "end": 2884, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 2883, - "end": 2884, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2883, - "end": 2884, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsKeywordType", - "span": { - "start": 2888, - "end": 2894, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2875, - "end": 2875, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 2885, - "end": 2886, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 2895, - "end": 2895, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 2899, - "end": 2900, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2899, - "end": 2900, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 2903, - "end": 2908, - "ctxt": 0 - }, - "kind": "never" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2909, - "end": 2933, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2914, - "end": 2915, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2918, - "end": 2932, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2918, - "end": 2919, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2919, - "end": 2932, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2920, - "end": 2931, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2920, - "end": 2931, - "ctxt": 0 - }, - "types": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2921, - "end": 2930, - "ctxt": 0 - }, - "tail": true, - "cooked": "test.hoge", - "raw": "test.hoge" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 2945, - "end": 2974, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 2950, - "end": 2951, - "ctxt": 0 - }, - "value": "L", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 2954, - "end": 2973, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 2954, - "end": 2955, - "ctxt": 0 - }, - "value": "J", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 2955, - "end": 2973, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 2956, - "end": 2972, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 2956, - "end": 2972, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 2964, - "end": 2970, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 2957, - "end": 2962, - "ctxt": 0 - }, - "tail": false, - "cooked": "test.", - "raw": "test." - }, - { - "type": "TemplateElement", - "span": { - "start": 2971, - "end": 2971, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 3010, - "end": 3049, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 3015, - "end": 3024, - "ctxt": 0 - }, - "value": "Templated", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3027, - "end": 3048, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3027, - "end": 3048, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 3030, - "end": 3036, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 3040, - "end": 3046, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3028, - "end": 3028, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3037, - "end": 3038, - "ctxt": 0 - }, - "tail": false, - "cooked": " ", - "raw": " " - }, - { - "type": "TemplateElement", - "span": { - "start": 3047, - "end": 3047, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3051, - "end": 3080, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3057, - "end": 3079, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3057, - "end": 3063, - "ctxt": 0 - }, - "value": "value1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3063, - "end": 3071, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3065, - "end": 3071, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 3074, - "end": 3079, - "ctxt": 0 - }, - "value": "abc", - "raw": "\"abc\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3081, - "end": 3136, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3087, - "end": 3135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3087, - "end": 3097, - "ctxt": 0 - }, - "value": "templated1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3097, - "end": 3108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 3099, - "end": 3108, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3099, - "end": 3108, - "ctxt": 0 - }, - "value": "Templated", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 3111, - "end": 3135, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 3111, - "end": 3126, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 3114, - "end": 3120, - "ctxt": 0 - }, - "value": "value1", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3112, - "end": 3112, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3121, - "end": 3125, - "ctxt": 0 - }, - "tail": true, - "cooked": " abc", - "raw": " abc" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3215, - "end": 3236, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3221, - "end": 3235, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3221, - "end": 3227, - "ctxt": 0 - }, - "value": "value2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 3230, - "end": 3235, - "ctxt": 0 - }, - "value": "abc", - "raw": "\"abc\"" - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3237, - "end": 3292, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3243, - "end": 3291, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3243, - "end": 3253, - "ctxt": 0 - }, - "value": "templated2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3253, - "end": 3264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 3255, - "end": 3264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3255, - "end": 3264, - "ctxt": 0 - }, - "value": "Templated", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "TsConstAssertion", - "span": { - "start": 3267, - "end": 3291, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 3267, - "end": 3282, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 3270, - "end": 3276, - "ctxt": 0 - }, - "value": "value2", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3268, - "end": 3268, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3277, - "end": 3281, - "ctxt": 0 - }, - "tail": true, - "cooked": " abc", - "raw": " abc" - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 3316, - "end": 3346, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 3321, - "end": 3329, - "ctxt": 0 - }, - "value": "Prefixes", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 3332, - "end": 3345, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 3332, - "end": 3337, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 3332, - "end": 3337, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 3340, - "end": 3345, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 3340, - "end": 3345, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 3348, - "end": 3391, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 3353, - "end": 3366, - "ctxt": 0 - }, - "value": "AllPrefixData", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 3369, - "end": 3390, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 3369, - "end": 3378, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 3369, - "end": 3378, - "ctxt": 0 - }, - "value": "foo:baz", - "raw": "\"foo:baz\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 3381, - "end": 3390, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 3381, - "end": 3390, - "ctxt": 0 - }, - "value": "bar:baz", - "raw": "\"bar:baz\"" - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 3393, - "end": 3442, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 3398, - "end": 3408, - "ctxt": 0 - }, - "value": "PrefixData", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 3408, - "end": 3428, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 3409, - "end": 3427, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3409, - "end": 3410, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 3419, - "end": 3427, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3419, - "end": 3427, - "ctxt": 0 - }, - "value": "Prefixes", - "optional": false - }, - "typeParams": null - }, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3431, - "end": 3441, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3431, - "end": 3441, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3434, - "end": 3435, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3434, - "end": 3435, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3432, - "end": 3432, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3436, - "end": 3440, - "ctxt": 0 - }, - "tail": true, - "cooked": ":baz", - "raw": ":baz" - } - ] - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 3444, - "end": 3542, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3454, - "end": 3459, - "ctxt": 0 - }, - "value": "ITest", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 3459, - "end": 3520, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 3460, - "end": 3478, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3460, - "end": 3461, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 3470, - "end": 3478, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3470, - "end": 3478, - "ctxt": 0 - }, - "value": "Prefixes", - "optional": false - }, - "typeParams": null - }, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 3480, - "end": 3519, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3480, - "end": 3481, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 3490, - "end": 3503, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3490, - "end": 3503, - "ctxt": 0 - }, - "value": "AllPrefixData", - "optional": false - }, - "typeParams": null - }, - "default": { - "type": "TsTypeReference", - "span": { - "start": 3506, - "end": 3519, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3506, - "end": 3516, - "ctxt": 0 - }, - "value": "PrefixData", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 3516, - "end": 3519, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 3517, - "end": 3518, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3517, - "end": 3518, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 3521, - "end": 3542, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 3527, - "end": 3540, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 3527, - "end": 3531, - "ctxt": 0 - }, - "value": "blah", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3531, - "end": 3539, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3533, - "end": 3539, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 3566, - "end": 3608, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 3571, - "end": 3577, - "ctxt": 0 - }, - "value": "Schema", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 3580, - "end": 3607, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 3582, - "end": 3605, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 3582, - "end": 3583, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3583, - "end": 3605, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 3585, - "end": 3605, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 3587, - "end": 3603, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 3587, - "end": 3588, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3588, - "end": 3603, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 3590, - "end": 3603, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 3592, - "end": 3601, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 3592, - "end": 3593, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3593, - "end": 3601, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3595, - "end": 3601, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3627, - "end": 3632, - "ctxt": 0 - }, - "value": "chain", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 3657, - "end": 3679, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3657, - "end": 3679, - "ctxt": 0 - }, - "value": "field", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3662, - "end": 3679, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 3664, - "end": 3679, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3664, - "end": 3665, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3664, - "end": 3665, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsLiteralType", - "span": { - "start": 3668, - "end": 3679, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3668, - "end": 3679, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3671, - "end": 3672, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3671, - "end": 3672, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 3676, - "end": 3677, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3676, - "end": 3677, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3669, - "end": 3669, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3673, - "end": 3674, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 3678, - "end": 3678, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 3610, - "end": 3687, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 3632, - "end": 3656, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 3633, - "end": 3655, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3633, - "end": 3634, - "ctxt": 0 - }, - "value": "F", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeOperator", - "span": { - "start": 3643, - "end": 3655, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 3649, - "end": 3655, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3649, - "end": 3655, - "ctxt": 0 - }, - "value": "Schema", - "optional": false - }, - "typeParams": null - } - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 3680, - "end": 3686, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3682, - "end": 3686, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 3689, - "end": 3700, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 3689, - "end": 3699, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 3689, - "end": 3694, - "ctxt": 0 - }, - "value": "chain", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 3695, - "end": 3698, - "ctxt": 0 - }, - "value": "a", - "raw": "\"a\"" - } - } - ], - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3733, - "end": 3736, - "ctxt": 0 - }, - "value": "ff1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 3737, - "end": 3755, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3737, - "end": 3755, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3738, - "end": 3755, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3740, - "end": 3755, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3740, - "end": 3755, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 3747, - "end": 3753, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3741, - "end": 3745, - "ctxt": 0 - }, - "tail": false, - "cooked": "foo-", - "raw": "foo-" - }, - { - "type": "TemplateElement", - "span": { - "start": 3754, - "end": 3754, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 3757, - "end": 3775, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3757, - "end": 3775, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3758, - "end": 3775, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3760, - "end": 3775, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3760, - "end": 3775, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 3763, - "end": 3769, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3761, - "end": 3761, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3770, - "end": 3774, - "ctxt": 0 - }, - "tail": true, - "cooked": "-bar", - "raw": "-bar" - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 3777, - "end": 3795, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3777, - "end": 3795, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3778, - "end": 3795, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3780, - "end": 3795, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3780, - "end": 3795, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 3787, - "end": 3793, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3781, - "end": 3785, - "ctxt": 0 - }, - "tail": false, - "cooked": "baz-", - "raw": "baz-" - }, - { - "type": "TemplateElement", - "span": { - "start": 3794, - "end": 3794, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 3724, - "end": 3891, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3797, - "end": 3891, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 3803, - "end": 3854, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 3807, - "end": 3814, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 3807, - "end": 3808, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3813, - "end": 3814, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 3816, - "end": 3854, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3826, - "end": 3828, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 3826, - "end": 3827, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 3859, - "end": 3889, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 3863, - "end": 3870, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 3863, - "end": 3864, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3869, - "end": 3870, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 3872, - "end": 3889, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3902, - "end": 3905, - "ctxt": 0 - }, - "value": "ff2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 3924, - "end": 3937, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3924, - "end": 3937, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3925, - "end": 3937, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3927, - "end": 3937, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3927, - "end": 3937, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3934, - "end": 3935, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3934, - "end": 3935, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3928, - "end": 3932, - "ctxt": 0 - }, - "tail": false, - "cooked": "foo-", - "raw": "foo-" - }, - { - "type": "TemplateElement", - "span": { - "start": 3936, - "end": 3936, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 3939, - "end": 3952, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3939, - "end": 3952, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3940, - "end": 3952, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3942, - "end": 3952, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3942, - "end": 3952, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3945, - "end": 3946, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3945, - "end": 3946, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3943, - "end": 3943, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 3947, - "end": 3951, - "ctxt": 0 - }, - "tail": true, - "cooked": "-bar", - "raw": "-bar" - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 3954, - "end": 3967, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 3954, - "end": 3967, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3955, - "end": 3967, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 3957, - "end": 3967, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 3957, - "end": 3967, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 3964, - "end": 3965, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3964, - "end": 3965, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 3958, - "end": 3962, - "ctxt": 0 - }, - "tail": false, - "cooked": "baz-", - "raw": "baz-" - }, - { - "type": "TemplateElement", - "span": { - "start": 3966, - "end": 3966, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 3893, - "end": 4058, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 3969, - "end": 4058, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 3975, - "end": 4021, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 3979, - "end": 3986, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 3979, - "end": 3980, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 3985, - "end": 3986, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 3988, - "end": 4021, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 3998, - "end": 4000, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 3998, - "end": 3999, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 4026, - "end": 4056, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 4030, - "end": 4037, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 4030, - "end": 4031, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4036, - "end": 4037, - "ctxt": 0 - }, - "value": "z", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 4039, - "end": 4056, - "ctxt": 0 - }, - "stmts": [] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 3905, - "end": 3923, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 3906, - "end": 3922, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3906, - "end": 3907, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 3916, - "end": 3922, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4069, - "end": 4072, - "ctxt": 0 - }, - "value": "ff3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 4073, - "end": 4082, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4073, - "end": 4082, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4074, - "end": 4082, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4076, - "end": 4082, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 4084, - "end": 4110, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4084, - "end": 4110, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4085, - "end": 4110, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 4087, - "end": 4110, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 4087, - "end": 4102, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 4087, - "end": 4102, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 4094, - "end": 4100, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4088, - "end": 4092, - "ctxt": 0 - }, - "tail": false, - "cooked": "foo-", - "raw": "foo-" - }, - { - "type": "TemplateElement", - "span": { - "start": 4101, - "end": 4101, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 4105, - "end": 4110, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 4105, - "end": 4110, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 4060, - "end": 4179, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 4112, - "end": 4179, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 4118, - "end": 4177, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 4122, - "end": 4129, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 4122, - "end": 4123, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 4128, - "end": 4129, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 4131, - "end": 4177, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4141, - "end": 4143, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 4141, - "end": 4142, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4190, - "end": 4193, - "ctxt": 0 - }, - "value": "ff4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 4194, - "end": 4203, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4194, - "end": 4203, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4195, - "end": 4203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4197, - "end": 4203, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 4205, - "end": 4223, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4205, - "end": 4223, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4206, - "end": 4223, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 4208, - "end": 4223, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 4208, - "end": 4223, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 4215, - "end": 4221, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4209, - "end": 4213, - "ctxt": 0 - }, - "tail": false, - "cooked": "foo-", - "raw": "foo-" - }, - { - "type": "TemplateElement", - "span": { - "start": 4222, - "end": 4222, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 4181, - "end": 4348, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 4225, - "end": 4348, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 4231, - "end": 4286, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 4235, - "end": 4251, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 4235, - "end": 4236, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 4241, - "end": 4251, - "ctxt": 0 - }, - "value": "foo-test", - "raw": "'foo-test'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 4253, - "end": 4286, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4263, - "end": 4265, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 4263, - "end": 4264, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - }, - "alternate": null - }, - { - "type": "IfStatement", - "span": { - "start": 4291, - "end": 4346, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 4295, - "end": 4311, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "Identifier", - "span": { - "start": 4295, - "end": 4296, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 4301, - "end": 4311, - "ctxt": 0 - }, - "value": "foo-test", - "raw": "'foo-test'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 4313, - "end": 4346, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4323, - "end": 4325, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 4323, - "end": 4324, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - ] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 4372, - "end": 4476, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 4377, - "end": 4383, - "ctxt": 0 - }, - "value": "Action", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 4390, - "end": 4475, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 4392, - "end": 4421, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 4394, - "end": 4419, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 4394, - "end": 4398, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4398, - "end": 4419, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 4400, - "end": 4419, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 4400, - "end": 4419, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 4403, - "end": 4409, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4401, - "end": 4401, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 4410, - "end": 4418, - "ctxt": 0 - }, - "tail": true, - "cooked": "_REQUEST", - "raw": "_REQUEST" - } - ] - } - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 4428, - "end": 4475, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 4430, - "end": 4456, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 4430, - "end": 4434, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4434, - "end": 4455, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 4436, - "end": 4455, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 4436, - "end": 4455, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 4439, - "end": 4445, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4437, - "end": 4437, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 4446, - "end": 4454, - "ctxt": 0 - }, - "tail": true, - "cooked": "_SUCCESS", - "raw": "_SUCCESS" - } - ] - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 4457, - "end": 4473, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 4457, - "end": 4465, - "ctxt": 0 - }, - "value": "response", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4465, - "end": 4473, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4467, - "end": 4473, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4487, - "end": 4494, - "ctxt": 0 - }, - "value": "reducer", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 4495, - "end": 4509, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4495, - "end": 4509, - "ctxt": 0 - }, - "value": "action", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4501, - "end": 4509, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 4503, - "end": 4509, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4503, - "end": 4509, - "ctxt": 0 - }, - "value": "Action", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 4478, - "end": 4607, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 4511, - "end": 4607, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 4517, - "end": 4605, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 4521, - "end": 4550, - "ctxt": 0 - }, - "operator": "===", - "left": { - "type": "MemberExpression", - "span": { - "start": 4521, - "end": 4532, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4521, - "end": 4527, - "ctxt": 0 - }, - "value": "action", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4528, - "end": 4532, - "ctxt": 0 - }, - "value": "type", - "optional": false - } - }, - "right": { - "type": "StringLiteral", - "span": { - "start": 4537, - "end": 4550, - "ctxt": 0 - }, - "value": "FOO_SUCCESS", - "raw": "'FOO_SUCCESS'" - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 4552, - "end": 4605, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 4562, - "end": 4574, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 4562, - "end": 4573, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4562, - "end": 4568, - "ctxt": 0 - }, - "value": "action", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4569, - "end": 4573, - "ctxt": 0 - }, - "value": "type", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4583, - "end": 4599, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 4583, - "end": 4598, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4583, - "end": 4589, - "ctxt": 0 - }, - "value": "action", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4590, - "end": 4598, - "ctxt": 0 - }, - "value": "response", - "optional": false - } - } - } - ] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 4631, - "end": 4680, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 4636, - "end": 4645, - "ctxt": 0 - }, - "value": "DotString", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 4648, - "end": 4679, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 4648, - "end": 4679, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 4651, - "end": 4657, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 4661, - "end": 4667, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 4671, - "end": 4677, - "ctxt": 0 - }, - "kind": "string" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4649, - "end": 4649, - "ctxt": 0 - }, - "tail": false, - "cooked": "", - "raw": "" - }, - { - "type": "TemplateElement", - "span": { - "start": 4658, - "end": 4659, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 4668, - "end": 4669, - "ctxt": 0 - }, - "tail": false, - "cooked": ".", - "raw": "." - }, - { - "type": "TemplateElement", - "span": { - "start": 4678, - "end": 4678, - "ctxt": 0 - }, - "tail": true, - "cooked": "", - "raw": "" - } - ] - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4699, - "end": 4707, - "ctxt": 0 - }, - "value": "noSpread", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 4729, - "end": 4738, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 4729, - "end": 4738, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4733, - "end": 4738, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 4735, - "end": 4738, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 4735, - "end": 4736, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4735, - "end": 4736, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 4682, - "end": 4743, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 4707, - "end": 4728, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 4708, - "end": 4727, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4708, - "end": 4709, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 4718, - "end": 4727, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4718, - "end": 4727, - "ctxt": 0 - }, - "value": "DotString", - "optional": false - }, - "typeParams": null - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 4739, - "end": 4742, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 4741, - "end": 4742, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4741, - "end": 4742, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4761, - "end": 4767, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 4789, - "end": 4801, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 4789, - "end": 4801, - "ctxt": 0 - }, - "rest": { - "start": 4789, - "end": 4792, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 4792, - "end": 4796, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 4796, - "end": 4801, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 4798, - "end": 4801, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 4798, - "end": 4799, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4798, - "end": 4799, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 4744, - "end": 4806, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 4767, - "end": 4788, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 4768, - "end": 4787, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4768, - "end": 4769, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 4778, - "end": 4787, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4778, - "end": 4787, - "ctxt": 0 - }, - "value": "DotString", - "optional": false - }, - "typeParams": null - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 4802, - "end": 4805, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 4804, - "end": 4805, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4804, - "end": 4805, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4808, - "end": 4847, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4808, - "end": 4846, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 4808, - "end": 4816, - "ctxt": 0 - }, - "value": "noSpread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 4817, - "end": 4845, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4818, - "end": 4830, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 4823, - "end": 4826, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4819, - "end": 4821, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4827, - "end": 4829, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4832, - "end": 4844, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 4837, - "end": 4840, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4833, - "end": 4835, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4841, - "end": 4843, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4848, - "end": 4907, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4848, - "end": 4906, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 4848, - "end": 4856, - "ctxt": 0 - }, - "value": "noSpread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 4857, - "end": 4905, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4858, - "end": 4880, - "ctxt": 0 - }, - "expressions": [ - { - "type": "TsAsExpression", - "span": { - "start": 4863, - "end": 4876, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 4863, - "end": 4866, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4870, - "end": 4876, - "ctxt": 0 - }, - "kind": "string" - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4859, - "end": 4861, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4877, - "end": 4879, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4882, - "end": 4904, - "ctxt": 0 - }, - "expressions": [ - { - "type": "TsAsExpression", - "span": { - "start": 4887, - "end": 4900, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 4887, - "end": 4890, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4894, - "end": 4900, - "ctxt": 0 - }, - "kind": "string" - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4883, - "end": 4885, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4901, - "end": 4903, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4909, - "end": 4944, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4909, - "end": 4943, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 4909, - "end": 4915, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4916, - "end": 4928, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 4921, - "end": 4924, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4917, - "end": 4919, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4925, - "end": 4927, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4930, - "end": 4942, - "ctxt": 0 - }, - "expressions": [ - { - "type": "StringLiteral", - "span": { - "start": 4935, - "end": 4938, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4931, - "end": 4933, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4939, - "end": 4941, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 4945, - "end": 5000, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 4945, - "end": 4999, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 4945, - "end": 4951, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4952, - "end": 4974, - "ctxt": 0 - }, - "expressions": [ - { - "type": "TsAsExpression", - "span": { - "start": 4957, - "end": 4970, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 4957, - "end": 4960, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4964, - "end": 4970, - "ctxt": 0 - }, - "kind": "string" - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4953, - "end": 4955, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4971, - "end": 4973, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 4976, - "end": 4998, - "ctxt": 0 - }, - "expressions": [ - { - "type": "TsAsExpression", - "span": { - "start": 4981, - "end": 4994, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 4981, - "end": 4984, - "ctxt": 0 - }, - "value": "2", - "raw": "'2'" - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 4988, - "end": 4994, - "ctxt": 0 - }, - "kind": "string" - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 4977, - "end": 4979, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 4995, - "end": 4997, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 5011, - "end": 5014, - "ctxt": 0 - }, - "value": "ft1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 5033, - "end": 5037, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 5033, - "end": 5037, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 5034, - "end": 5037, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 5036, - "end": 5037, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5036, - "end": 5037, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 5039, - "end": 5054, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 5039, - "end": 5054, - "ctxt": 0 - }, - "value": "u", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 5040, - "end": 5054, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 5042, - "end": 5054, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5042, - "end": 5051, - "ctxt": 0 - }, - "value": "Uppercase", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 5051, - "end": 5054, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 5052, - "end": 5053, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5052, - "end": 5053, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 5056, - "end": 5081, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 5056, - "end": 5081, - "ctxt": 0 - }, - "value": "u1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 5058, - "end": 5081, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 5060, - "end": 5081, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5060, - "end": 5069, - "ctxt": 0 - }, - "value": "Uppercase", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 5069, - "end": 5081, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 5070, - "end": 5080, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 5070, - "end": 5080, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 5075, - "end": 5076, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5075, - "end": 5076, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5071, - "end": 5073, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5077, - "end": 5079, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - } - ] - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 5083, - "end": 5108, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 5083, - "end": 5108, - "ctxt": 0 - }, - "value": "u2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 5085, - "end": 5108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 5087, - "end": 5108, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5087, - "end": 5096, - "ctxt": 0 - }, - "value": "Uppercase", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 5096, - "end": 5108, - "ctxt": 0 - }, - "params": [ - { - "type": "TsLiteralType", - "span": { - "start": 5097, - "end": 5107, - "ctxt": 0 - }, - "literal": { - "type": "TemplateLiteral", - "span": { - "start": 5097, - "end": 5107, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 5102, - "end": 5103, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 5102, - "end": 5103, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5098, - "end": 5100, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5104, - "end": 5106, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 5002, - "end": 5205, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 5110, - "end": 5205, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 5116, - "end": 5147, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5116, - "end": 5146, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 5116, - "end": 5122, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 5123, - "end": 5133, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 5128, - "end": 5129, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5124, - "end": 5126, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5130, - "end": 5132, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 5135, - "end": 5145, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 5140, - "end": 5141, - "ctxt": 0 - }, - "value": "t", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5136, - "end": 5138, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5142, - "end": 5144, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 5152, - "end": 5183, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5152, - "end": 5182, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 5152, - "end": 5158, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 5159, - "end": 5169, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 5164, - "end": 5165, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5160, - "end": 5162, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5166, - "end": 5168, - "ctxt": 0 - }, - "tail": true, - "cooked": ".3", - "raw": ".3" - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 5171, - "end": 5181, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 5176, - "end": 5177, - "ctxt": 0 - }, - "value": "u", - "optional": false - } - ], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 5172, - "end": 5174, - "ctxt": 0 - }, - "tail": false, - "cooked": "1.", - "raw": "1." - }, - { - "type": "TemplateElement", - "span": { - "start": 5178, - "end": 5180, - "ctxt": 0 - }, - "tail": true, - "cooked": ".4", - "raw": ".4" - } - ] - } - } - ], - "typeArguments": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 5188, - "end": 5203, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 5188, - "end": 5202, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 5188, - "end": 5194, - "ctxt": 0 - }, - "value": "spread", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 5195, - "end": 5197, - "ctxt": 0 - }, - "value": "u1", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 5199, - "end": 5201, - "ctxt": 0 - }, - "value": "u2", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 5014, - "end": 5032, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 5015, - "end": 5031, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 5015, - "end": 5016, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsKeywordType", - "span": { - "start": 5025, - "end": 5031, - "ctxt": 0 - }, - "kind": "string" - }, - "default": null - } - ] - }, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.ts b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.ts deleted file mode 100644 index 45dee01413e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes3.ts +++ /dev/null @@ -1,193 +0,0 @@ -// @strict: true -// @declaration: true - -// Inference from template literal type to template literal type - -type Foo1 = T extends `*${infer U}*` ? U : never; - -type T01 = Foo1<'hello'>; -type T02 = Foo1<'*hello*'>; -type T03 = Foo1<'**hello**'>; -type T04 = Foo1<`*${string}*`>; -type T05 = Foo1<`*${number}*`>; -type T06 = Foo1<`*${bigint}*`>; -type T07 = Foo1<`*${any}*`>; -type T08 = Foo1<`**${string}**`>; -type T09 = Foo1<`**${string}**${string}**`>; -type T10 = Foo1<`**${'a' | 'b' | 'c'}**`>; -type T11 = Foo1<`**${boolean}**${boolean}**`>; - -declare function foo1(arg: `*${V}*`): V; - -function f1(s: string, n: number, b: boolean, t: T) { - let x1 = foo1('hello'); // Error - let x2 = foo1('*hello*'); - let x3 = foo1('**hello**'); - let x4 = foo1(`*${s}*` as const); - let x5 = foo1(`*${n}*` as const); - let x6 = foo1(`*${b}*` as const); - let x7 = foo1(`*${t}*` as const); - let x8 = foo1(`**${s}**` as const); -} - -// Inference to a placeholder immediately followed by another placeholder infers a single -// character or placeholder from the source. - -type Parts = - T extends '' ? [] : - T extends `${infer Head}${infer Tail}` ? [Head, ...Parts] : - never; - -type T20 = Parts<`abc`>; -type T21 = Parts<`*${string}*`>; -type T22 = Parts<`*${number}*`>; -type T23 = Parts<`*${number}*${string}*${bigint}*`>; - -function f2() { - let x: `${number}.${number}.${number}`; - x = '1.1.1'; - x = '1.1.1' as `1.1.${number}`; - x = '1.1.1' as `1.${number}.1`; - x = '1.1.1' as `1.${number}.${number}`; - x = '1.1.1' as `${number}.1.1`; - x = '1.1.1' as `${number}.1.${number}`; - x = '1.1.1' as `${number}.${number}.1`; - x = '1.1.1' as `${number}.${number}.${number}`; -} - -function f3(s: string, n: number, b: boolean, t: T) { - let x: `*${string}*`; - x = 'hello'; // Error - x = '*hello*'; - x = '**hello**'; - x = `*${s}*` as const; - x = `*${n}*` as const; - x = `*${b}*` as const; - x = `*${t}*` as const; - x = `**${s}**` as const; -} - -function f4(s: string, n: number, b: boolean, t: T) { - let x: `*${number}*`; - x = '123'; // Error - x = '*123*'; - x = '**123**'; // Error - x = `*${s}*` as const; // Error - x = `*${n}*` as const; - x = `*${b}*` as const; // Error - x = `*${t}*` as const; -} - -// Repro from #43060 - -type A = T extends `${infer U}.${infer V}` ? U | V : never -type B = A<`test.1024`>; // "test" | "1024" -type C = A<`test.${number}`>; // "test" | `${number}` - -type D = T extends `${infer U}.${number}` ? U : never -type E = D<`test.1024`>; // "test" -type F = D<`test.${number}`>; // "test" - -type G = T extends `${infer U}.${infer V}` ? U | V : never -type H = G<`test.hoge`>; // "test" | "hoge" -type I = G<`test.${string}`>; // string ("test" | string reduces to string) - -type J = T extends `${infer U}.${string}` ? U : never -type K = J<`test.hoge`>; // "test" -type L = J<`test.${string}`>; // "test"" - -// Repro from #43243 - -type Templated = `${string} ${string}`; - -const value1: string = "abc"; -const templated1: Templated = `${value1} abc` as const; -// Type '`${string} abc`' is not assignable to type '`${string} ${string}`'. - -const value2 = "abc"; -const templated2: Templated = `${value2} abc` as const; - -// Repro from #43620 - -type Prefixes = "foo" | "bar"; - -type AllPrefixData = "foo:baz" | "bar:baz"; - -type PrefixData

= `${P}:baz`; - -interface ITest

> { - blah: string; -} - -// Repro from #45906 - -type Schema = { a: { b: { c: number } } }; - -declare function chain(field: F | `${F}.${F}`): void; - -chain("a"); - -// Repro from #46125 - -function ff1(x: `foo-${string}`, y: `${string}-bar`, z: `baz-${string}`) { - if (x === y) { - x; // `foo-${string}` - } - if (x === z) { // Error - } -} - -function ff2(x: `foo-${T}`, y: `${T}-bar`, z: `baz-${T}`) { - if (x === y) { - x; // `foo-${T}` - } - if (x === z) { // Error - } -} - -function ff3(x: string, y: `foo-${string}` | 'bar') { - if (x === y) { - x; // `foo-${string}` | 'bar' - } -} - -function ff4(x: string, y: `foo-${string}`) { - if (x === 'foo-test') { - x; // 'foo-test' - } - if (y === 'foo-test') { - y; // 'foo-test' - } -} - -// Repro from #46045 - -type Action = - | { type: `${string}_REQUEST` } - | { type: `${string}_SUCCESS`, response: string }; - -function reducer(action: Action) { - if (action.type === 'FOO_SUCCESS') { - action.type; - action.response; - } -} - -// Repro from #46768 - -type DotString = `${string}.${string}.${string}`; - -declare function noSpread

(args: P[]): P; -declare function spread

(...args: P[]): P; - -noSpread([`1.${'2'}.3`, `1.${'2'}.4`]); -noSpread([`1.${'2' as string}.3`, `1.${'2' as string}.4`]); - -spread(`1.${'2'}.3`, `1.${'2'}.4`); -spread(`1.${'2' as string}.3`, `1.${'2' as string}.4`); - -function ft1(t: T, u: Uppercase, u1: Uppercase<`1.${T}.3`>, u2: Uppercase<`1.${T}.4`>) { - spread(`1.${t}.3`, `1.${t}.4`); - spread(`1.${u}.3`, `1.${u}.4`); - spread(u1, u2); -} diff --git a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.json b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.json new file mode 100644 index 00000000000..ccbbe36c518 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.json @@ -0,0 +1,23663 @@ +{ + "type": "Script", + "span": { + "start": 81, + "end": 15582, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 81, + "end": 151, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 86, + "end": 94, + "ctxt": 0 + }, + "value": "TNumber0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 97, + "end": 150, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 97, + "end": 102, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 97, + "end": 102, + "ctxt": 0 + }, + "value": "100", + "raw": "\"100\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 111, + "end": 138, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 111, + "end": 138, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 114, + "end": 136, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 120, + "end": 121, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 120, + "end": 121, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 130, + "end": 136, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 112, + "end": 112, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 137, + "end": 137, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 141, + "end": 142, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 141, + "end": 142, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 145, + "end": 150, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 159, + "end": 230, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 164, + "end": 172, + "ctxt": 0 + }, + "value": "TNumber1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 175, + "end": 229, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 175, + "end": 181, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 175, + "end": 181, + "ctxt": 0 + }, + "value": "-100", + "raw": "\"-100\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 190, + "end": 217, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 190, + "end": 217, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 193, + "end": 215, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 199, + "end": 200, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 199, + "end": 200, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 209, + "end": 215, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 191, + "end": 191, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 216, + "end": 216, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 220, + "end": 221, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 220, + "end": 221, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 224, + "end": 229, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 239, + "end": 309, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 244, + "end": 252, + "ctxt": 0 + }, + "value": "TNumber2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 255, + "end": 308, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 255, + "end": 260, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 255, + "end": 260, + "ctxt": 0 + }, + "value": "1.1", + "raw": "\"1.1\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 269, + "end": 296, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 269, + "end": 296, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 272, + "end": 294, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 278, + "end": 279, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 278, + "end": 279, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 288, + "end": 294, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 270, + "end": 270, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 295, + "end": 295, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 299, + "end": 300, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 299, + "end": 300, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 303, + "end": 308, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 317, + "end": 389, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 322, + "end": 330, + "ctxt": 0 + }, + "value": "TNumber3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 333, + "end": 388, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 333, + "end": 340, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 333, + "end": 340, + "ctxt": 0 + }, + "value": "8e-11", + "raw": "\"8e-11\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 349, + "end": 376, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 349, + "end": 376, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 352, + "end": 374, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 358, + "end": 359, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 358, + "end": 359, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 368, + "end": 374, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 350, + "end": 350, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 375, + "end": 375, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 379, + "end": 380, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 379, + "end": 380, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 383, + "end": 388, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 415, + "end": 486, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 420, + "end": 428, + "ctxt": 0 + }, + "value": "TNumber4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 431, + "end": 485, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 431, + "end": 437, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 431, + "end": 437, + "ctxt": 0 + }, + "value": "0x10", + "raw": "\"0x10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 446, + "end": 473, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 446, + "end": 473, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 449, + "end": 471, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 455, + "end": 456, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 455, + "end": 456, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 465, + "end": 471, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 447, + "end": 447, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 472, + "end": 472, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 476, + "end": 477, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 476, + "end": 477, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 480, + "end": 485, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 519, + "end": 590, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 524, + "end": 532, + "ctxt": 0 + }, + "value": "TNumber5", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 535, + "end": 589, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 535, + "end": 541, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 535, + "end": 541, + "ctxt": 0 + }, + "value": "0o10", + "raw": "\"0o10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 550, + "end": 577, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 550, + "end": 577, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 553, + "end": 575, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 559, + "end": 560, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 559, + "end": 560, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 569, + "end": 575, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 551, + "end": 551, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 576, + "end": 576, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 580, + "end": 581, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 580, + "end": 581, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 584, + "end": 589, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 623, + "end": 694, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 628, + "end": 636, + "ctxt": 0 + }, + "value": "TNumber6", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 639, + "end": 693, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 639, + "end": 645, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 639, + "end": 645, + "ctxt": 0 + }, + "value": "0b10", + "raw": "\"0b10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 654, + "end": 681, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 654, + "end": 681, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 657, + "end": 679, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 663, + "end": 664, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 663, + "end": 664, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 673, + "end": 679, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 655, + "end": 655, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 680, + "end": 680, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 684, + "end": 685, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 684, + "end": 685, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 688, + "end": 693, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 727, + "end": 798, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 732, + "end": 740, + "ctxt": 0 + }, + "value": "TNumber7", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 743, + "end": 797, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 743, + "end": 749, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 743, + "end": 749, + "ctxt": 0 + }, + "value": "10e2", + "raw": "\"10e2\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 758, + "end": 785, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 758, + "end": 785, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 761, + "end": 783, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 767, + "end": 768, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 767, + "end": 768, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 777, + "end": 783, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 759, + "end": 759, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 784, + "end": 784, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 788, + "end": 789, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 788, + "end": 789, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 792, + "end": 797, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 831, + "end": 902, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 836, + "end": 844, + "ctxt": 0 + }, + "value": "TNumber8", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 847, + "end": 901, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 847, + "end": 853, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 847, + "end": 853, + "ctxt": 0 + }, + "value": "abcd", + "raw": "\"abcd\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 862, + "end": 889, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 862, + "end": 889, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 865, + "end": 887, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 871, + "end": 872, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 871, + "end": 872, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 881, + "end": 887, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 863, + "end": 863, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 888, + "end": 888, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 892, + "end": 893, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 892, + "end": 893, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 896, + "end": 901, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 934, + "end": 1004, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 939, + "end": 947, + "ctxt": 0 + }, + "value": "TBigInt0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 950, + "end": 1003, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 950, + "end": 955, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 950, + "end": 955, + "ctxt": 0 + }, + "value": "100", + "raw": "\"100\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 964, + "end": 991, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 964, + "end": 991, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 967, + "end": 989, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 973, + "end": 974, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 973, + "end": 974, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 983, + "end": 989, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 965, + "end": 965, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 990, + "end": 990, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 994, + "end": 995, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 994, + "end": 995, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 998, + "end": 1003, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1013, + "end": 1084, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1018, + "end": 1026, + "ctxt": 0 + }, + "value": "TBigInt1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1029, + "end": 1083, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1029, + "end": 1035, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1029, + "end": 1035, + "ctxt": 0 + }, + "value": "-100", + "raw": "\"-100\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1044, + "end": 1071, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1044, + "end": 1071, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1047, + "end": 1069, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1053, + "end": 1054, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1053, + "end": 1054, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1063, + "end": 1069, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1045, + "end": 1045, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1070, + "end": 1070, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1074, + "end": 1075, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1074, + "end": 1075, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1078, + "end": 1083, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1094, + "end": 1165, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1099, + "end": 1107, + "ctxt": 0 + }, + "value": "TBigInt2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1110, + "end": 1164, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1110, + "end": 1116, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1110, + "end": 1116, + "ctxt": 0 + }, + "value": "0x10", + "raw": "\"0x10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1125, + "end": 1152, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1125, + "end": 1152, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1128, + "end": 1150, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1134, + "end": 1135, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1134, + "end": 1135, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1144, + "end": 1150, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1126, + "end": 1126, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1151, + "end": 1151, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1155, + "end": 1156, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1155, + "end": 1156, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1159, + "end": 1164, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1198, + "end": 1269, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1203, + "end": 1211, + "ctxt": 0 + }, + "value": "TBigInt3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1214, + "end": 1268, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1214, + "end": 1220, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1214, + "end": 1220, + "ctxt": 0 + }, + "value": "0o10", + "raw": "\"0o10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1229, + "end": 1256, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1229, + "end": 1256, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1232, + "end": 1254, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1238, + "end": 1239, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1238, + "end": 1239, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1248, + "end": 1254, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1230, + "end": 1230, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1255, + "end": 1255, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1259, + "end": 1260, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1259, + "end": 1260, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1263, + "end": 1268, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1302, + "end": 1373, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1307, + "end": 1315, + "ctxt": 0 + }, + "value": "TBigInt4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1318, + "end": 1372, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1318, + "end": 1324, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1318, + "end": 1324, + "ctxt": 0 + }, + "value": "0b10", + "raw": "\"0b10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1333, + "end": 1360, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1333, + "end": 1360, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1336, + "end": 1358, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1342, + "end": 1343, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1342, + "end": 1343, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1352, + "end": 1358, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1334, + "end": 1334, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1359, + "end": 1359, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1363, + "end": 1364, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1363, + "end": 1364, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1367, + "end": 1372, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1406, + "end": 1476, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1411, + "end": 1419, + "ctxt": 0 + }, + "value": "TBigInt5", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1422, + "end": 1475, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1422, + "end": 1427, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1422, + "end": 1427, + "ctxt": 0 + }, + "value": "1.1", + "raw": "\"1.1\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1436, + "end": 1463, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1436, + "end": 1463, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1439, + "end": 1461, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1445, + "end": 1446, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1445, + "end": 1446, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1455, + "end": 1461, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1437, + "end": 1437, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1462, + "end": 1462, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1466, + "end": 1467, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1466, + "end": 1467, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1470, + "end": 1475, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1486, + "end": 1557, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1491, + "end": 1499, + "ctxt": 0 + }, + "value": "TBigInt6", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1502, + "end": 1556, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1502, + "end": 1508, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1502, + "end": 1508, + "ctxt": 0 + }, + "value": "10e2", + "raw": "\"10e2\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1517, + "end": 1544, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1517, + "end": 1544, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1520, + "end": 1542, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1526, + "end": 1527, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1526, + "end": 1527, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1536, + "end": 1542, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1518, + "end": 1518, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1543, + "end": 1543, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1547, + "end": 1548, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1547, + "end": 1548, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1551, + "end": 1556, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1567, + "end": 1638, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1572, + "end": 1580, + "ctxt": 0 + }, + "value": "TBigInt7", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1583, + "end": 1637, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1583, + "end": 1589, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1583, + "end": 1589, + "ctxt": 0 + }, + "value": "abcd", + "raw": "\"abcd\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1598, + "end": 1625, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1598, + "end": 1625, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1601, + "end": 1623, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1607, + "end": 1608, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1607, + "end": 1608, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1617, + "end": 1623, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1599, + "end": 1599, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1624, + "end": 1624, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1628, + "end": 1629, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1628, + "end": 1629, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1632, + "end": 1637, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1671, + "end": 1744, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1676, + "end": 1685, + "ctxt": 0 + }, + "value": "TBoolean0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1688, + "end": 1743, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1688, + "end": 1694, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1688, + "end": 1694, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1703, + "end": 1731, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1703, + "end": 1731, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1706, + "end": 1729, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1712, + "end": 1713, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1712, + "end": 1713, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1722, + "end": 1729, + "ctxt": 0 + }, + "kind": "boolean" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1704, + "end": 1704, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1730, + "end": 1730, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1734, + "end": 1735, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1734, + "end": 1735, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1738, + "end": 1743, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1753, + "end": 1827, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1758, + "end": 1767, + "ctxt": 0 + }, + "value": "TBoolean1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1770, + "end": 1826, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1770, + "end": 1777, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1770, + "end": 1777, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1786, + "end": 1814, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1786, + "end": 1814, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1789, + "end": 1812, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1795, + "end": 1796, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1795, + "end": 1796, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1805, + "end": 1812, + "ctxt": 0 + }, + "kind": "boolean" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1787, + "end": 1787, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1813, + "end": 1813, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1817, + "end": 1818, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1817, + "end": 1818, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1821, + "end": 1826, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1837, + "end": 1910, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1842, + "end": 1851, + "ctxt": 0 + }, + "value": "TBoolean2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1854, + "end": 1909, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1854, + "end": 1860, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1854, + "end": 1860, + "ctxt": 0 + }, + "value": "abcd", + "raw": "\"abcd\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1869, + "end": 1897, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1869, + "end": 1897, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1872, + "end": 1895, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1878, + "end": 1879, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1878, + "end": 1879, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1888, + "end": 1895, + "ctxt": 0 + }, + "kind": "boolean" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1870, + "end": 1870, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1896, + "end": 1896, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1900, + "end": 1901, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1900, + "end": 1901, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 1904, + "end": 1909, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 1940, + "end": 2007, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 1945, + "end": 1951, + "ctxt": 0 + }, + "value": "TNull0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 1954, + "end": 2006, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 1954, + "end": 1960, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 1954, + "end": 1960, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 1969, + "end": 1994, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 1969, + "end": 1994, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 1972, + "end": 1992, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 1978, + "end": 1979, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1978, + "end": 1979, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 1988, + "end": 1992, + "ctxt": 0 + }, + "kind": "null" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 1970, + "end": 1970, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 1993, + "end": 1993, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 1997, + "end": 1998, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1997, + "end": 1998, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2001, + "end": 2006, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2016, + "end": 2083, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2021, + "end": 2027, + "ctxt": 0 + }, + "value": "TNull1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2030, + "end": 2082, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2030, + "end": 2036, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2030, + "end": 2036, + "ctxt": 0 + }, + "value": "abcd", + "raw": "\"abcd\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2045, + "end": 2070, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2045, + "end": 2070, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2048, + "end": 2068, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2054, + "end": 2055, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2054, + "end": 2055, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2064, + "end": 2068, + "ctxt": 0 + }, + "kind": "null" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2046, + "end": 2046, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2069, + "end": 2069, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2073, + "end": 2074, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2073, + "end": 2074, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2077, + "end": 2082, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2118, + "end": 2200, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2123, + "end": 2134, + "ctxt": 0 + }, + "value": "TUndefined0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2137, + "end": 2199, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2137, + "end": 2148, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2137, + "end": 2148, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2157, + "end": 2187, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2157, + "end": 2187, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2160, + "end": 2185, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2166, + "end": 2167, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2166, + "end": 2167, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2176, + "end": 2185, + "ctxt": 0 + }, + "kind": "undefined" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2158, + "end": 2158, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2186, + "end": 2186, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2190, + "end": 2191, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2190, + "end": 2191, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2194, + "end": 2199, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2214, + "end": 2291, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2219, + "end": 2230, + "ctxt": 0 + }, + "value": "TUndefined1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2233, + "end": 2290, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2233, + "end": 2239, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2233, + "end": 2239, + "ctxt": 0 + }, + "value": "abcd", + "raw": "\"abcd\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2248, + "end": 2278, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2248, + "end": 2278, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2251, + "end": 2276, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2257, + "end": 2258, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2257, + "end": 2258, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 2267, + "end": 2276, + "ctxt": 0 + }, + "kind": "undefined" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2249, + "end": 2249, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2277, + "end": 2277, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2281, + "end": 2282, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2281, + "end": 2282, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2285, + "end": 2290, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 2330, + "end": 2445, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 2341, + "end": 2358, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 2361, + "end": 2371, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2361, + "end": 2365, + "ctxt": 0 + }, + "value": "Zero", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2368, + "end": 2371, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2373, + "end": 2386, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2373, + "end": 2377, + "ctxt": 0 + }, + "value": "True", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2380, + "end": 2386, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2388, + "end": 2403, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2388, + "end": 2393, + "ctxt": 0 + }, + "value": "False", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2396, + "end": 2403, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2405, + "end": 2428, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2405, + "end": 2414, + "ctxt": 0 + }, + "value": "Undefined", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2417, + "end": 2428, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2430, + "end": 2443, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2430, + "end": 2434, + "ctxt": 0 + }, + "value": "Null", + "optional": false + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 2437, + "end": 2443, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + } + ] + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2446, + "end": 2536, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2451, + "end": 2470, + "ctxt": 0 + }, + "value": "TStringLiteralEnum0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2473, + "end": 2535, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2473, + "end": 2476, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2473, + "end": 2476, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2485, + "end": 2523, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2485, + "end": 2523, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2488, + "end": 2521, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2494, + "end": 2495, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2494, + "end": 2495, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 2504, + "end": 2521, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2504, + "end": 2521, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2486, + "end": 2486, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2522, + "end": 2522, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2526, + "end": 2527, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2526, + "end": 2527, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2530, + "end": 2535, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 2564, + "end": 2606, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 2575, + "end": 2592, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 2595, + "end": 2599, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2595, + "end": 2599, + "ctxt": 0 + }, + "value": "Zero", + "optional": false + }, + "init": null + }, + { + "type": "TsEnumMember", + "span": { + "start": 2601, + "end": 2604, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2601, + "end": 2604, + "ctxt": 0 + }, + "value": "One", + "optional": false + }, + "init": null + } + ] + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2607, + "end": 2697, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2612, + "end": 2631, + "ctxt": 0 + }, + "value": "TNumberLiteralEnum0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2634, + "end": 2696, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2634, + "end": 2637, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2634, + "end": 2637, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2646, + "end": 2684, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2646, + "end": 2684, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2649, + "end": 2682, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2655, + "end": 2656, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2655, + "end": 2656, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 2665, + "end": 2682, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2665, + "end": 2682, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2647, + "end": 2647, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2683, + "end": 2683, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2687, + "end": 2688, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2687, + "end": 2688, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2691, + "end": 2696, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsEnumDeclaration", + "span": { + "start": 2757, + "end": 2845, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 2768, + "end": 2782, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 2785, + "end": 2814, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2785, + "end": 2789, + "ctxt": 0 + }, + "value": "Zero", + "optional": false + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 2792, + "end": 2814, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2792, + "end": 2809, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2810, + "end": 2814, + "ctxt": 0 + }, + "value": "Zero", + "optional": false + } + } + }, + { + "type": "TsEnumMember", + "span": { + "start": 2816, + "end": 2843, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2816, + "end": 2819, + "ctxt": 0 + }, + "value": "One", + "optional": false + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 2822, + "end": 2843, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 2822, + "end": 2839, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 2840, + "end": 2843, + "ctxt": 0 + }, + "value": "One", + "optional": false + } + } + } + ] + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 2846, + "end": 2930, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 2851, + "end": 2867, + "ctxt": 0 + }, + "value": "TNonLiteralEnum0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2870, + "end": 2929, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 2870, + "end": 2873, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 2870, + "end": 2873, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2882, + "end": 2917, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 2882, + "end": 2917, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 2885, + "end": 2915, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 2891, + "end": 2892, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2891, + "end": 2892, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 2901, + "end": 2915, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2901, + "end": 2915, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 2883, + "end": 2883, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 2916, + "end": 2916, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 2920, + "end": 2921, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2920, + "end": 2921, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 2924, + "end": 2929, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3241, + "end": 3330, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3246, + "end": 3255, + "ctxt": 0 + }, + "value": "PString00", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3258, + "end": 3329, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3258, + "end": 3261, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3258, + "end": 3261, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3270, + "end": 3317, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3270, + "end": 3317, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3273, + "end": 3315, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3279, + "end": 3280, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3279, + "end": 3280, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3289, + "end": 3315, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3289, + "end": 3295, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 3298, + "end": 3315, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3298, + "end": 3315, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3271, + "end": 3271, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3316, + "end": 3316, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3320, + "end": 3321, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3320, + "end": 3321, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3324, + "end": 3329, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3358, + "end": 3436, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3363, + "end": 3372, + "ctxt": 0 + }, + "value": "PString01", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3375, + "end": 3435, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3375, + "end": 3378, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3375, + "end": 3378, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3387, + "end": 3423, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3387, + "end": 3423, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3390, + "end": 3421, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3396, + "end": 3397, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3396, + "end": 3397, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3406, + "end": 3421, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3406, + "end": 3412, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 3415, + "end": 3421, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3388, + "end": 3388, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3422, + "end": 3422, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3426, + "end": 3427, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3426, + "end": 3427, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3430, + "end": 3435, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3462, + "end": 3548, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3467, + "end": 3476, + "ctxt": 0 + }, + "value": "PString02", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3479, + "end": 3547, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3479, + "end": 3482, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3479, + "end": 3482, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3491, + "end": 3535, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3491, + "end": 3535, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3494, + "end": 3533, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3500, + "end": 3501, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3500, + "end": 3501, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3510, + "end": 3533, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3510, + "end": 3516, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 3519, + "end": 3533, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3519, + "end": 3533, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3492, + "end": 3492, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3534, + "end": 3534, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3538, + "end": 3539, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3538, + "end": 3539, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3542, + "end": 3547, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3608, + "end": 3681, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3613, + "end": 3622, + "ctxt": 0 + }, + "value": "PString03", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3625, + "end": 3680, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3625, + "end": 3628, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3625, + "end": 3628, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3637, + "end": 3668, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3637, + "end": 3668, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3640, + "end": 3666, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3646, + "end": 3647, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3646, + "end": 3647, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3656, + "end": 3666, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3656, + "end": 3662, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 3665, + "end": 3666, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 3665, + "end": 3666, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3638, + "end": 3638, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3667, + "end": 3667, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3671, + "end": 3672, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3671, + "end": 3672, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3675, + "end": 3680, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3689, + "end": 3778, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3694, + "end": 3703, + "ctxt": 0 + }, + "value": "PString04", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3706, + "end": 3777, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3706, + "end": 3709, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3706, + "end": 3709, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3718, + "end": 3765, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3718, + "end": 3765, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3721, + "end": 3763, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3727, + "end": 3728, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3727, + "end": 3728, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3737, + "end": 3763, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3737, + "end": 3743, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeReference", + "span": { + "start": 3746, + "end": 3763, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3746, + "end": 3763, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3719, + "end": 3719, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3764, + "end": 3764, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3768, + "end": 3769, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3768, + "end": 3769, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3772, + "end": 3777, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3806, + "end": 3884, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3811, + "end": 3820, + "ctxt": 0 + }, + "value": "PString05", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3823, + "end": 3883, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3823, + "end": 3826, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3823, + "end": 3826, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3835, + "end": 3871, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3835, + "end": 3871, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3838, + "end": 3869, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3844, + "end": 3845, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3844, + "end": 3845, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3854, + "end": 3869, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3854, + "end": 3860, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 3863, + "end": 3869, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3836, + "end": 3836, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3870, + "end": 3870, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3874, + "end": 3875, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3874, + "end": 3875, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3878, + "end": 3883, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 3920, + "end": 3994, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 3925, + "end": 3934, + "ctxt": 0 + }, + "value": "PString06", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 3937, + "end": 3993, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 3937, + "end": 3940, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 3937, + "end": 3940, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 3949, + "end": 3981, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 3949, + "end": 3981, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 3952, + "end": 3979, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 3958, + "end": 3959, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3958, + "end": 3959, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3968, + "end": 3979, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 3968, + "end": 3974, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 3977, + "end": 3979, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 3977, + "end": 3979, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 3950, + "end": 3950, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 3980, + "end": 3980, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 3984, + "end": 3985, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3984, + "end": 3985, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 3988, + "end": 3993, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4023, + "end": 4105, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4028, + "end": 4037, + "ctxt": 0 + }, + "value": "PString07", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4040, + "end": 4104, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4040, + "end": 4046, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4040, + "end": 4046, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4055, + "end": 4092, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4055, + "end": 4092, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4058, + "end": 4090, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4064, + "end": 4065, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4064, + "end": 4065, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4074, + "end": 4090, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4074, + "end": 4080, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4083, + "end": 4090, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4056, + "end": 4056, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4091, + "end": 4091, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4095, + "end": 4096, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4095, + "end": 4096, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4099, + "end": 4104, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4116, + "end": 4199, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4121, + "end": 4130, + "ctxt": 0 + }, + "value": "PString08", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4133, + "end": 4198, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4133, + "end": 4140, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4133, + "end": 4140, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4149, + "end": 4186, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4149, + "end": 4186, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4152, + "end": 4184, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4158, + "end": 4159, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4158, + "end": 4159, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4168, + "end": 4184, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4168, + "end": 4174, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4177, + "end": 4184, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4150, + "end": 4150, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4185, + "end": 4185, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4189, + "end": 4190, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4189, + "end": 4190, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4193, + "end": 4198, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4261, + "end": 4340, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4266, + "end": 4275, + "ctxt": 0 + }, + "value": "PString09", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4278, + "end": 4339, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4278, + "end": 4284, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4278, + "end": 4284, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4293, + "end": 4327, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4293, + "end": 4327, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4296, + "end": 4325, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4302, + "end": 4303, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4302, + "end": 4303, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4312, + "end": 4325, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4312, + "end": 4318, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 4321, + "end": 4325, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 4321, + "end": 4325, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4294, + "end": 4294, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4326, + "end": 4326, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4330, + "end": 4331, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4330, + "end": 4331, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4334, + "end": 4339, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4351, + "end": 4432, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4356, + "end": 4365, + "ctxt": 0 + }, + "value": "PString10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4368, + "end": 4431, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4368, + "end": 4375, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4368, + "end": 4375, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4384, + "end": 4419, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4384, + "end": 4419, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4387, + "end": 4417, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4393, + "end": 4394, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4393, + "end": 4394, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4403, + "end": 4417, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4403, + "end": 4409, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsLiteralType", + "span": { + "start": 4412, + "end": 4417, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 4412, + "end": 4417, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4385, + "end": 4385, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4418, + "end": 4418, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4422, + "end": 4423, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4422, + "end": 4423, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4426, + "end": 4431, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4444, + "end": 4533, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4449, + "end": 4458, + "ctxt": 0 + }, + "value": "PString11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4461, + "end": 4532, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4461, + "end": 4472, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4461, + "end": 4472, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4481, + "end": 4520, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4481, + "end": 4520, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4484, + "end": 4518, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4490, + "end": 4491, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4490, + "end": 4491, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4500, + "end": 4518, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4500, + "end": 4506, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4509, + "end": 4518, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4482, + "end": 4482, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4519, + "end": 4519, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4523, + "end": 4524, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4523, + "end": 4524, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4527, + "end": 4532, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4549, + "end": 4628, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4554, + "end": 4563, + "ctxt": 0 + }, + "value": "PString12", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4566, + "end": 4627, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4566, + "end": 4572, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4566, + "end": 4572, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4581, + "end": 4615, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4581, + "end": 4615, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4584, + "end": 4613, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4590, + "end": 4591, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4590, + "end": 4591, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4600, + "end": 4613, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4600, + "end": 4606, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4609, + "end": 4613, + "ctxt": 0 + }, + "kind": "null" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4582, + "end": 4582, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4614, + "end": 4614, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4618, + "end": 4619, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4618, + "end": 4619, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4622, + "end": 4627, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4718, + "end": 4805, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4723, + "end": 4734, + "ctxt": 0 + }, + "value": "PTemplate00", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4737, + "end": 4804, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4737, + "end": 4741, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4737, + "end": 4741, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4750, + "end": 4792, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4750, + "end": 4792, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4753, + "end": 4790, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4759, + "end": 4760, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4759, + "end": 4760, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4769, + "end": 4790, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 4769, + "end": 4781, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4769, + "end": 4781, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4773, + "end": 4779, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4770, + "end": 4771, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 4780, + "end": 4780, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 4784, + "end": 4790, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4751, + "end": 4751, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4791, + "end": 4791, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4795, + "end": 4796, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4795, + "end": 4796, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4799, + "end": 4804, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4842, + "end": 4937, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4847, + "end": 4858, + "ctxt": 0 + }, + "value": "PTemplate01", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 4861, + "end": 4936, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 4861, + "end": 4865, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 4861, + "end": 4865, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 4874, + "end": 4924, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4874, + "end": 4924, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 4877, + "end": 4922, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 4883, + "end": 4884, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4883, + "end": 4884, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 4893, + "end": 4922, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 4893, + "end": 4905, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 4893, + "end": 4905, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4897, + "end": 4903, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4894, + "end": 4895, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 4904, + "end": 4904, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 4908, + "end": 4922, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4908, + "end": 4922, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 4875, + "end": 4875, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 4923, + "end": 4923, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 4927, + "end": 4928, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4927, + "end": 4928, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 4931, + "end": 4936, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5008, + "end": 5091, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5013, + "end": 5024, + "ctxt": 0 + }, + "value": "PTemplate02", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5027, + "end": 5090, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5027, + "end": 5031, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5027, + "end": 5031, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5040, + "end": 5078, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5040, + "end": 5078, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5043, + "end": 5076, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5049, + "end": 5050, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5049, + "end": 5050, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5059, + "end": 5076, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5059, + "end": 5071, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5059, + "end": 5071, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5063, + "end": 5069, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5060, + "end": 5061, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 5070, + "end": 5070, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5074, + "end": 5076, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 5074, + "end": 5076, + "ctxt": 0 + }, + "value": 10.0, + "raw": "10" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5041, + "end": 5041, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5077, + "end": 5077, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5081, + "end": 5082, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5081, + "end": 5082, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5085, + "end": 5090, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5100, + "end": 5198, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5105, + "end": 5116, + "ctxt": 0 + }, + "value": "PTemplate03", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5119, + "end": 5197, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5119, + "end": 5123, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5119, + "end": 5123, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5132, + "end": 5185, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5132, + "end": 5185, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5135, + "end": 5183, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5141, + "end": 5142, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5141, + "end": 5142, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5151, + "end": 5183, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5151, + "end": 5163, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5151, + "end": 5163, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5155, + "end": 5161, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5152, + "end": 5153, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 5162, + "end": 5162, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 5166, + "end": 5183, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5166, + "end": 5183, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5133, + "end": 5133, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5184, + "end": 5184, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5188, + "end": 5189, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5188, + "end": 5189, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5192, + "end": 5197, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5237, + "end": 5324, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5242, + "end": 5253, + "ctxt": 0 + }, + "value": "PTemplate04", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5256, + "end": 5323, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5256, + "end": 5260, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5256, + "end": 5260, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5269, + "end": 5311, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5269, + "end": 5311, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5272, + "end": 5309, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5278, + "end": 5279, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5278, + "end": 5279, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5288, + "end": 5309, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5288, + "end": 5300, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5288, + "end": 5300, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5292, + "end": 5298, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5289, + "end": 5290, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 5299, + "end": 5299, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 5303, + "end": 5309, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5270, + "end": 5270, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5310, + "end": 5310, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5314, + "end": 5315, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5314, + "end": 5315, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5318, + "end": 5323, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5371, + "end": 5455, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5376, + "end": 5387, + "ctxt": 0 + }, + "value": "PTemplate05", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5390, + "end": 5454, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5390, + "end": 5394, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5390, + "end": 5394, + "ctxt": 0 + }, + "value": "10", + "raw": "\"10\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5403, + "end": 5442, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5403, + "end": 5442, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5406, + "end": 5440, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5412, + "end": 5413, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5412, + "end": 5413, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5422, + "end": 5440, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5422, + "end": 5434, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5422, + "end": 5434, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5426, + "end": 5432, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5423, + "end": 5424, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 5433, + "end": 5433, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5437, + "end": 5440, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 5437, + "end": 5440, + "ctxt": 0 + }, + "value": [ + 1, + [ + 10 + ] + ], + "raw": "10n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5404, + "end": 5404, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5441, + "end": 5441, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5445, + "end": 5446, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5445, + "end": 5446, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5449, + "end": 5454, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5495, + "end": 5585, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5500, + "end": 5511, + "ctxt": 0 + }, + "value": "PTemplate06", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5514, + "end": 5584, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5514, + "end": 5520, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5514, + "end": 5520, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5529, + "end": 5572, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5529, + "end": 5572, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5532, + "end": 5570, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5538, + "end": 5539, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5538, + "end": 5539, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5548, + "end": 5570, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5548, + "end": 5560, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5548, + "end": 5560, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5551, + "end": 5557, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5549, + "end": 5549, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5558, + "end": 5559, + "ctxt": 0 + }, + "tail": true, + "cooked": "e", + "raw": "e" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 5563, + "end": 5570, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5530, + "end": 5530, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5571, + "end": 5571, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5575, + "end": 5576, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5575, + "end": 5576, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5579, + "end": 5584, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5596, + "end": 5687, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5601, + "end": 5612, + "ctxt": 0 + }, + "value": "PTemplate07", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5615, + "end": 5686, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5615, + "end": 5622, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5615, + "end": 5622, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5631, + "end": 5674, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5631, + "end": 5674, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5634, + "end": 5672, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5640, + "end": 5641, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5640, + "end": 5641, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5650, + "end": 5672, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5650, + "end": 5662, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5650, + "end": 5662, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 5653, + "end": 5659, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5651, + "end": 5651, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5660, + "end": 5661, + "ctxt": 0 + }, + "tail": true, + "cooked": "e", + "raw": "e" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 5665, + "end": 5672, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5632, + "end": 5632, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5673, + "end": 5673, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5677, + "end": 5678, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5677, + "end": 5678, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5681, + "end": 5686, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5759, + "end": 5851, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5764, + "end": 5775, + "ctxt": 0 + }, + "value": "PTemplate08", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5778, + "end": 5850, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5778, + "end": 5784, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5778, + "end": 5784, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5793, + "end": 5838, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5793, + "end": 5838, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5796, + "end": 5836, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5802, + "end": 5803, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5802, + "end": 5803, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5812, + "end": 5836, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5812, + "end": 5829, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5812, + "end": 5829, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5815, + "end": 5818, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5815, + "end": 5818, + "ctxt": 0 + }, + "value": "t", + "raw": "\"t\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 5821, + "end": 5827, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5813, + "end": 5813, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5819, + "end": 5819, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5828, + "end": 5828, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5832, + "end": 5836, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 5832, + "end": 5836, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5794, + "end": 5794, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5837, + "end": 5837, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5841, + "end": 5842, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5841, + "end": 5842, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5845, + "end": 5850, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5862, + "end": 5956, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5867, + "end": 5878, + "ctxt": 0 + }, + "value": "PTemplate09", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5881, + "end": 5955, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5881, + "end": 5888, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5881, + "end": 5888, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 5897, + "end": 5943, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5897, + "end": 5943, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 5900, + "end": 5941, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 5906, + "end": 5907, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5906, + "end": 5907, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 5916, + "end": 5941, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5916, + "end": 5933, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 5916, + "end": 5933, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 5919, + "end": 5922, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5919, + "end": 5922, + "ctxt": 0 + }, + "value": "f", + "raw": "\"f\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 5925, + "end": 5931, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5917, + "end": 5917, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5923, + "end": 5923, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5932, + "end": 5932, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 5936, + "end": 5941, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 5936, + "end": 5941, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 5898, + "end": 5898, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 5942, + "end": 5942, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 5946, + "end": 5947, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5946, + "end": 5947, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 5950, + "end": 5955, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 5968, + "end": 6070, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 5973, + "end": 5984, + "ctxt": 0 + }, + "value": "PTemplate10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 5987, + "end": 6069, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 5987, + "end": 5998, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 5987, + "end": 5998, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6007, + "end": 6057, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6007, + "end": 6057, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6010, + "end": 6055, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6016, + "end": 6017, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6016, + "end": 6017, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6026, + "end": 6055, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6026, + "end": 6043, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6026, + "end": 6043, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6029, + "end": 6032, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6029, + "end": 6032, + "ctxt": 0 + }, + "value": "u", + "raw": "\"u\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6035, + "end": 6041, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6027, + "end": 6027, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6033, + "end": 6033, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6042, + "end": 6042, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6046, + "end": 6055, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6008, + "end": 6008, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6056, + "end": 6056, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6060, + "end": 6061, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6060, + "end": 6061, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6064, + "end": 6069, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6086, + "end": 6178, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6091, + "end": 6102, + "ctxt": 0 + }, + "value": "PTemplate11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6105, + "end": 6177, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6105, + "end": 6111, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6105, + "end": 6111, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6120, + "end": 6165, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6120, + "end": 6165, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6123, + "end": 6163, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6129, + "end": 6130, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6129, + "end": 6130, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6139, + "end": 6163, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6139, + "end": 6156, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6139, + "end": 6156, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6142, + "end": 6145, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6142, + "end": 6145, + "ctxt": 0 + }, + "value": "n", + "raw": "\"n\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6148, + "end": 6154, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6140, + "end": 6140, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6146, + "end": 6146, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6155, + "end": 6155, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6159, + "end": 6163, + "ctxt": 0 + }, + "kind": "null" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6121, + "end": 6121, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6164, + "end": 6164, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6168, + "end": 6169, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6168, + "end": 6169, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6172, + "end": 6177, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6274, + "end": 6356, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6279, + "end": 6295, + "ctxt": 0 + }, + "value": "PStringLiteral00", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6298, + "end": 6355, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6298, + "end": 6301, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6298, + "end": 6301, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6310, + "end": 6343, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6310, + "end": 6343, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6313, + "end": 6341, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6319, + "end": 6320, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6319, + "end": 6320, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6329, + "end": 6341, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6329, + "end": 6332, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6329, + "end": 6332, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6335, + "end": 6341, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6311, + "end": 6311, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6342, + "end": 6342, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6346, + "end": 6347, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6346, + "end": 6347, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6350, + "end": 6355, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6390, + "end": 6480, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6395, + "end": 6411, + "ctxt": 0 + }, + "value": "PStringLiteral01", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6414, + "end": 6479, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6414, + "end": 6417, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6414, + "end": 6417, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6426, + "end": 6467, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6426, + "end": 6467, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6429, + "end": 6465, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6435, + "end": 6436, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6435, + "end": 6436, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6445, + "end": 6465, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6445, + "end": 6448, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6445, + "end": 6448, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 6451, + "end": 6465, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6451, + "end": 6465, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6427, + "end": 6427, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6466, + "end": 6466, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6470, + "end": 6471, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6470, + "end": 6471, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6474, + "end": 6479, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6548, + "end": 6625, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6553, + "end": 6569, + "ctxt": 0 + }, + "value": "PStringLiteral02", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6572, + "end": 6624, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6572, + "end": 6575, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6572, + "end": 6575, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6584, + "end": 6612, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6584, + "end": 6612, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6587, + "end": 6610, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6593, + "end": 6594, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6593, + "end": 6594, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6603, + "end": 6610, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6603, + "end": 6606, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6603, + "end": 6606, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 6609, + "end": 6610, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 6609, + "end": 6610, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6585, + "end": 6585, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6611, + "end": 6611, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6615, + "end": 6616, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6615, + "end": 6616, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6619, + "end": 6624, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6633, + "end": 6726, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6638, + "end": 6654, + "ctxt": 0 + }, + "value": "PStringLiteral03", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6657, + "end": 6725, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6657, + "end": 6660, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6657, + "end": 6660, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6669, + "end": 6713, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6669, + "end": 6713, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6672, + "end": 6711, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6678, + "end": 6679, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6678, + "end": 6679, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6688, + "end": 6711, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6688, + "end": 6691, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6688, + "end": 6691, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 6694, + "end": 6711, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6694, + "end": 6711, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6670, + "end": 6670, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6712, + "end": 6712, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6716, + "end": 6717, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6716, + "end": 6717, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6720, + "end": 6725, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6762, + "end": 6844, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6767, + "end": 6783, + "ctxt": 0 + }, + "value": "PStringLiteral04", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6786, + "end": 6843, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6786, + "end": 6789, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6786, + "end": 6789, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6798, + "end": 6831, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6798, + "end": 6831, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6801, + "end": 6829, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6807, + "end": 6808, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6807, + "end": 6808, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6817, + "end": 6829, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6817, + "end": 6820, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6817, + "end": 6820, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 6823, + "end": 6829, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6799, + "end": 6799, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6830, + "end": 6830, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6834, + "end": 6835, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6834, + "end": 6835, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6838, + "end": 6843, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6888, + "end": 6966, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6893, + "end": 6909, + "ctxt": 0 + }, + "value": "PStringLiteral05", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 6912, + "end": 6965, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 6912, + "end": 6915, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6912, + "end": 6915, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 6924, + "end": 6953, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 6924, + "end": 6953, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 6927, + "end": 6951, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 6933, + "end": 6934, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6933, + "end": 6934, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6943, + "end": 6951, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 6943, + "end": 6946, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 6943, + "end": 6946, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 6949, + "end": 6951, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 6949, + "end": 6951, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 6925, + "end": 6925, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 6952, + "end": 6952, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 6956, + "end": 6957, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6956, + "end": 6957, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 6960, + "end": 6965, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7003, + "end": 7102, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7008, + "end": 7024, + "ctxt": 0 + }, + "value": "PStringLiteral06", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7027, + "end": 7101, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7027, + "end": 7033, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7027, + "end": 7033, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7042, + "end": 7089, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7042, + "end": 7089, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7045, + "end": 7087, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7051, + "end": 7052, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7051, + "end": 7052, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7061, + "end": 7087, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7061, + "end": 7067, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7061, + "end": 7067, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 7070, + "end": 7077, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7070, + "end": 7077, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 7080, + "end": 7087, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7043, + "end": 7043, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7088, + "end": 7088, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7092, + "end": 7093, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7092, + "end": 7093, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7096, + "end": 7101, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7113, + "end": 7213, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7118, + "end": 7134, + "ctxt": 0 + }, + "value": "PStringLiteral07", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7137, + "end": 7212, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7137, + "end": 7144, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7137, + "end": 7144, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7153, + "end": 7200, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7153, + "end": 7200, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7156, + "end": 7198, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7162, + "end": 7163, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7162, + "end": 7163, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7172, + "end": 7198, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7172, + "end": 7178, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7172, + "end": 7178, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 7181, + "end": 7188, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7181, + "end": 7188, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 7191, + "end": 7198, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7154, + "end": 7154, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7199, + "end": 7199, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7203, + "end": 7204, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7203, + "end": 7204, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7207, + "end": 7212, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7283, + "end": 7369, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7288, + "end": 7304, + "ctxt": 0 + }, + "value": "PStringLiteral08", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7307, + "end": 7368, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7307, + "end": 7313, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7307, + "end": 7313, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7322, + "end": 7356, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7322, + "end": 7356, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7325, + "end": 7354, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7331, + "end": 7332, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7331, + "end": 7332, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7341, + "end": 7354, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7341, + "end": 7347, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7341, + "end": 7347, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 7350, + "end": 7354, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 7350, + "end": 7354, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7323, + "end": 7323, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7355, + "end": 7355, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7359, + "end": 7360, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7359, + "end": 7360, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7363, + "end": 7368, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7380, + "end": 7469, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7385, + "end": 7401, + "ctxt": 0 + }, + "value": "PStringLiteral09", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7404, + "end": 7468, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7404, + "end": 7411, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7404, + "end": 7411, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7420, + "end": 7456, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7420, + "end": 7456, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7423, + "end": 7454, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7429, + "end": 7430, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7429, + "end": 7430, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7439, + "end": 7454, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7439, + "end": 7446, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7439, + "end": 7446, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 7449, + "end": 7454, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 7449, + "end": 7454, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7421, + "end": 7421, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7455, + "end": 7455, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7459, + "end": 7460, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7459, + "end": 7460, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7463, + "end": 7468, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7481, + "end": 7582, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7486, + "end": 7502, + "ctxt": 0 + }, + "value": "PStringLiteral10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7505, + "end": 7581, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7505, + "end": 7516, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7505, + "end": 7516, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7525, + "end": 7569, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7525, + "end": 7569, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7528, + "end": 7567, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7534, + "end": 7535, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7534, + "end": 7535, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7544, + "end": 7567, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7544, + "end": 7555, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7544, + "end": 7555, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 7558, + "end": 7567, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7526, + "end": 7526, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7568, + "end": 7568, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7572, + "end": 7573, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7572, + "end": 7573, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7576, + "end": 7581, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7598, + "end": 7684, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7603, + "end": 7619, + "ctxt": 0 + }, + "value": "PStringLiteral11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7622, + "end": 7683, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7622, + "end": 7628, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7622, + "end": 7628, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7637, + "end": 7671, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7637, + "end": 7671, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7640, + "end": 7669, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7646, + "end": 7647, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7646, + "end": 7647, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7656, + "end": 7669, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 7656, + "end": 7662, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7656, + "end": 7662, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 7665, + "end": 7669, + "ctxt": 0 + }, + "kind": "null" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7638, + "end": 7638, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7670, + "end": 7670, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7674, + "end": 7675, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7674, + "end": 7675, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7678, + "end": 7683, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7788, + "end": 7888, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7793, + "end": 7813, + "ctxt": 0 + }, + "value": "PStringLiteralEnum00", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7816, + "end": 7887, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7816, + "end": 7819, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7816, + "end": 7819, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7828, + "end": 7875, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7828, + "end": 7875, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7831, + "end": 7873, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7837, + "end": 7838, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7837, + "end": 7838, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7847, + "end": 7873, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 7847, + "end": 7864, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7847, + "end": 7864, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 7867, + "end": 7873, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7829, + "end": 7829, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 7874, + "end": 7874, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 7878, + "end": 7879, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7878, + "end": 7879, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 7882, + "end": 7887, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 7946, + "end": 8054, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 7951, + "end": 7971, + "ctxt": 0 + }, + "value": "PStringLiteralEnum01", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 7974, + "end": 8053, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 7974, + "end": 7977, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 7974, + "end": 7977, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 7986, + "end": 8041, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 7986, + "end": 8041, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 7989, + "end": 8039, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 7995, + "end": 7996, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7995, + "end": 7996, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8005, + "end": 8039, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8005, + "end": 8022, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8005, + "end": 8022, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 8025, + "end": 8039, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8025, + "end": 8039, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 7987, + "end": 7987, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8040, + "end": 8040, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8044, + "end": 8045, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8044, + "end": 8045, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8048, + "end": 8053, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8146, + "end": 8241, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8151, + "end": 8171, + "ctxt": 0 + }, + "value": "PStringLiteralEnum02", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8174, + "end": 8240, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8174, + "end": 8177, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8174, + "end": 8177, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8186, + "end": 8228, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8186, + "end": 8228, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8189, + "end": 8226, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8195, + "end": 8196, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8195, + "end": 8196, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8205, + "end": 8226, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8205, + "end": 8222, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8205, + "end": 8222, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 8225, + "end": 8226, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 8225, + "end": 8226, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8187, + "end": 8187, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8227, + "end": 8227, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8231, + "end": 8232, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8231, + "end": 8232, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8235, + "end": 8240, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8268, + "end": 8379, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8273, + "end": 8293, + "ctxt": 0 + }, + "value": "PStringLiteralEnum03", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8296, + "end": 8378, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8296, + "end": 8299, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8296, + "end": 8299, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8308, + "end": 8366, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8308, + "end": 8366, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8311, + "end": 8364, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8317, + "end": 8318, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8317, + "end": 8318, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8327, + "end": 8364, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8327, + "end": 8344, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8327, + "end": 8344, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 8347, + "end": 8364, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8347, + "end": 8364, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8309, + "end": 8309, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8365, + "end": 8365, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8369, + "end": 8370, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8369, + "end": 8370, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8373, + "end": 8378, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8439, + "end": 8539, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8444, + "end": 8464, + "ctxt": 0 + }, + "value": "PStringLiteralEnum04", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8467, + "end": 8538, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8467, + "end": 8470, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8467, + "end": 8470, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8479, + "end": 8526, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8479, + "end": 8526, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8482, + "end": 8524, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8488, + "end": 8489, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8488, + "end": 8489, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8498, + "end": 8524, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8498, + "end": 8515, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8498, + "end": 8515, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 8518, + "end": 8524, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8480, + "end": 8480, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8525, + "end": 8525, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8529, + "end": 8530, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8529, + "end": 8530, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8533, + "end": 8538, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8607, + "end": 8703, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8612, + "end": 8632, + "ctxt": 0 + }, + "value": "PStringLiteralEnum05", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8635, + "end": 8702, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8635, + "end": 8638, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8635, + "end": 8638, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8647, + "end": 8690, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8647, + "end": 8690, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8650, + "end": 8688, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8656, + "end": 8657, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8656, + "end": 8657, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8666, + "end": 8688, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8666, + "end": 8683, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8666, + "end": 8683, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 8686, + "end": 8688, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 8686, + "end": 8688, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8648, + "end": 8648, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8689, + "end": 8689, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8693, + "end": 8694, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8693, + "end": 8694, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8697, + "end": 8702, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8764, + "end": 8868, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8769, + "end": 8789, + "ctxt": 0 + }, + "value": "PStringLiteralEnum06", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8792, + "end": 8867, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8792, + "end": 8798, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8792, + "end": 8798, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8807, + "end": 8855, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8807, + "end": 8855, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8810, + "end": 8853, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8816, + "end": 8817, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8816, + "end": 8817, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8826, + "end": 8853, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8826, + "end": 8843, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8826, + "end": 8843, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 8846, + "end": 8853, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8808, + "end": 8808, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8854, + "end": 8854, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8858, + "end": 8859, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8858, + "end": 8859, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8862, + "end": 8867, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8895, + "end": 9000, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8900, + "end": 8920, + "ctxt": 0 + }, + "value": "PStringLiteralEnum07", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8923, + "end": 8999, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 8923, + "end": 8930, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8923, + "end": 8930, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 8939, + "end": 8987, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 8939, + "end": 8987, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 8942, + "end": 8985, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 8948, + "end": 8949, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8948, + "end": 8949, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 8958, + "end": 8985, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8958, + "end": 8975, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8958, + "end": 8975, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 8978, + "end": 8985, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 8940, + "end": 8940, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 8986, + "end": 8986, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 8990, + "end": 8991, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8990, + "end": 8991, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8994, + "end": 8999, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9091, + "end": 9192, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9096, + "end": 9116, + "ctxt": 0 + }, + "value": "PStringLiteralEnum08", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9119, + "end": 9191, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9119, + "end": 9125, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9119, + "end": 9125, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9134, + "end": 9179, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9134, + "end": 9179, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9137, + "end": 9177, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9143, + "end": 9144, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9143, + "end": 9144, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9153, + "end": 9177, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 9153, + "end": 9170, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9153, + "end": 9170, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 9173, + "end": 9177, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 9173, + "end": 9177, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9135, + "end": 9135, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9178, + "end": 9178, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9182, + "end": 9183, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9182, + "end": 9183, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9186, + "end": 9191, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9219, + "end": 9322, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9224, + "end": 9244, + "ctxt": 0 + }, + "value": "PStringLiteralEnum09", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9247, + "end": 9321, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9247, + "end": 9254, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9247, + "end": 9254, + "ctxt": 0 + }, + "value": "false", + "raw": "\"false\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9263, + "end": 9309, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9263, + "end": 9309, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9266, + "end": 9307, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9272, + "end": 9273, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9272, + "end": 9273, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9282, + "end": 9307, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 9282, + "end": 9299, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9282, + "end": 9299, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 9302, + "end": 9307, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 9302, + "end": 9307, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9264, + "end": 9264, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9308, + "end": 9308, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9312, + "end": 9313, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9312, + "end": 9313, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9316, + "end": 9321, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9350, + "end": 9461, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9355, + "end": 9375, + "ctxt": 0 + }, + "value": "PStringLiteralEnum10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9378, + "end": 9460, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9378, + "end": 9389, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9378, + "end": 9389, + "ctxt": 0 + }, + "value": "undefined", + "raw": "\"undefined\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9398, + "end": 9448, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9398, + "end": 9448, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9401, + "end": 9446, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9407, + "end": 9408, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9407, + "end": 9408, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9417, + "end": 9446, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 9417, + "end": 9434, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9417, + "end": 9434, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 9437, + "end": 9446, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9399, + "end": 9399, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9447, + "end": 9447, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9451, + "end": 9452, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9451, + "end": 9452, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9455, + "end": 9460, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9493, + "end": 9594, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9498, + "end": 9518, + "ctxt": 0 + }, + "value": "PStringLiteralEnum11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9521, + "end": 9593, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9521, + "end": 9527, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9521, + "end": 9527, + "ctxt": 0 + }, + "value": "null", + "raw": "\"null\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9536, + "end": 9581, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9536, + "end": 9581, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9539, + "end": 9579, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9545, + "end": 9546, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9545, + "end": 9546, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9555, + "end": 9579, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 9555, + "end": 9572, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9555, + "end": 9572, + "ctxt": 0 + }, + "value": "StringLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 9575, + "end": 9579, + "ctxt": 0 + }, + "kind": "null" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9537, + "end": 9537, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9580, + "end": 9580, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9584, + "end": 9585, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9584, + "end": 9585, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9588, + "end": 9593, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9691, + "end": 9776, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9696, + "end": 9704, + "ctxt": 0 + }, + "value": "PNumber0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9707, + "end": 9775, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9707, + "end": 9710, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9707, + "end": 9710, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9719, + "end": 9763, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9719, + "end": 9763, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9722, + "end": 9761, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9728, + "end": 9729, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9728, + "end": 9729, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9738, + "end": 9761, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 9738, + "end": 9744, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsTypeReference", + "span": { + "start": 9747, + "end": 9761, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9747, + "end": 9761, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9720, + "end": 9720, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9762, + "end": 9762, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9766, + "end": 9767, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9766, + "end": 9767, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9770, + "end": 9775, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9815, + "end": 9903, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9820, + "end": 9828, + "ctxt": 0 + }, + "value": "PNumber1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9831, + "end": 9902, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9831, + "end": 9834, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9831, + "end": 9834, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9843, + "end": 9890, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9843, + "end": 9890, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9846, + "end": 9888, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9852, + "end": 9853, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9852, + "end": 9853, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9862, + "end": 9888, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 9862, + "end": 9868, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsTypeReference", + "span": { + "start": 9871, + "end": 9888, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9871, + "end": 9888, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9844, + "end": 9844, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9889, + "end": 9889, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9893, + "end": 9894, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9893, + "end": 9894, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 9897, + "end": 9902, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 9929, + "end": 10006, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 9934, + "end": 9942, + "ctxt": 0 + }, + "value": "PNumber2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 9945, + "end": 10005, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 9945, + "end": 9948, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 9945, + "end": 9948, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 9957, + "end": 9993, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 9957, + "end": 9993, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 9960, + "end": 9991, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 9966, + "end": 9967, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 9966, + "end": 9967, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 9976, + "end": 9991, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 9976, + "end": 9982, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 9985, + "end": 9991, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 9958, + "end": 9958, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 9992, + "end": 9992, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 9996, + "end": 9997, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 9996, + "end": 9997, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10000, + "end": 10005, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10040, + "end": 10113, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10045, + "end": 10053, + "ctxt": 0 + }, + "value": "PNumber3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10056, + "end": 10112, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10056, + "end": 10059, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10056, + "end": 10059, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10068, + "end": 10100, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10068, + "end": 10100, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10071, + "end": 10098, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10077, + "end": 10078, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10077, + "end": 10078, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10087, + "end": 10098, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 10087, + "end": 10093, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsLiteralType", + "span": { + "start": 10096, + "end": 10098, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 10096, + "end": 10098, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10069, + "end": 10069, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10099, + "end": 10099, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10103, + "end": 10104, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10103, + "end": 10104, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10107, + "end": 10112, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10187, + "end": 10281, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10192, + "end": 10198, + "ctxt": 0 + }, + "value": "PEnum0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10201, + "end": 10280, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10201, + "end": 10204, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10201, + "end": 10204, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10213, + "end": 10268, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10213, + "end": 10268, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10216, + "end": 10266, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10222, + "end": 10223, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10222, + "end": 10223, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10232, + "end": 10266, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 10232, + "end": 10246, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10232, + "end": 10246, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 10249, + "end": 10266, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10249, + "end": 10266, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10214, + "end": 10214, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10267, + "end": 10267, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10271, + "end": 10272, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10271, + "end": 10272, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10275, + "end": 10280, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10305, + "end": 10388, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10310, + "end": 10316, + "ctxt": 0 + }, + "value": "PEnum1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10319, + "end": 10387, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10319, + "end": 10322, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10319, + "end": 10322, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10331, + "end": 10375, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10331, + "end": 10375, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10334, + "end": 10373, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10340, + "end": 10341, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10340, + "end": 10341, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10350, + "end": 10373, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 10350, + "end": 10364, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10350, + "end": 10364, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 10367, + "end": 10373, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10332, + "end": 10332, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10374, + "end": 10374, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10378, + "end": 10379, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10378, + "end": 10379, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10382, + "end": 10387, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10420, + "end": 10499, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10425, + "end": 10431, + "ctxt": 0 + }, + "value": "PEnum2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10434, + "end": 10498, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10434, + "end": 10437, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10434, + "end": 10437, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10446, + "end": 10486, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10446, + "end": 10486, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10449, + "end": 10484, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10455, + "end": 10456, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10455, + "end": 10456, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10465, + "end": 10484, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 10465, + "end": 10479, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10465, + "end": 10479, + "ctxt": 0 + }, + "value": "NonLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 10482, + "end": 10484, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 10482, + "end": 10484, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10447, + "end": 10447, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10485, + "end": 10485, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10489, + "end": 10490, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10489, + "end": 10490, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10493, + "end": 10498, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10578, + "end": 10657, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10583, + "end": 10598, + "ctxt": 0 + }, + "value": "PNumberLiteral0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10601, + "end": 10656, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10601, + "end": 10604, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10601, + "end": 10604, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10613, + "end": 10644, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10613, + "end": 10644, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10616, + "end": 10642, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10622, + "end": 10623, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10622, + "end": 10623, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10632, + "end": 10642, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 10632, + "end": 10633, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 10632, + "end": 10633, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 10636, + "end": 10642, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10614, + "end": 10614, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10643, + "end": 10643, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10647, + "end": 10648, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10647, + "end": 10648, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10651, + "end": 10656, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10699, + "end": 10774, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10704, + "end": 10719, + "ctxt": 0 + }, + "value": "PNumberLiteral1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10722, + "end": 10773, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10722, + "end": 10725, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10722, + "end": 10725, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10734, + "end": 10761, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10734, + "end": 10761, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10737, + "end": 10759, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10743, + "end": 10744, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10743, + "end": 10744, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10753, + "end": 10759, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 10753, + "end": 10754, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 10753, + "end": 10754, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 10757, + "end": 10759, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 10757, + "end": 10759, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10735, + "end": 10735, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10760, + "end": 10760, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10764, + "end": 10765, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10764, + "end": 10765, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10768, + "end": 10773, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 10873, + "end": 10972, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 10878, + "end": 10897, + "ctxt": 0 + }, + "value": "PNumberLiteralEnum0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 10900, + "end": 10971, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 10900, + "end": 10903, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10900, + "end": 10903, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 10912, + "end": 10959, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 10912, + "end": 10959, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 10915, + "end": 10957, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 10921, + "end": 10922, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 10921, + "end": 10922, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 10931, + "end": 10957, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 10931, + "end": 10948, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10931, + "end": 10948, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 10951, + "end": 10957, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 10913, + "end": 10913, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 10958, + "end": 10958, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 10962, + "end": 10963, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 10962, + "end": 10963, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 10966, + "end": 10971, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11040, + "end": 11135, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11045, + "end": 11064, + "ctxt": 0 + }, + "value": "PNumberLiteralEnum1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11067, + "end": 11134, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11067, + "end": 11070, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11067, + "end": 11070, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11079, + "end": 11122, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11079, + "end": 11122, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11082, + "end": 11120, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11088, + "end": 11089, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11088, + "end": 11089, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11098, + "end": 11120, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 11098, + "end": 11115, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11098, + "end": 11115, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsLiteralType", + "span": { + "start": 11118, + "end": 11120, + "ctxt": 0 + }, + "literal": { + "type": "BigIntLiteral", + "span": { + "start": 11118, + "end": 11120, + "ctxt": 0 + }, + "value": [ + 0, + [] + ], + "raw": "0n" + } + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11080, + "end": 11080, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11121, + "end": 11121, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11125, + "end": 11126, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11125, + "end": 11126, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11129, + "end": 11134, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11240, + "end": 11315, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11245, + "end": 11254, + "ctxt": 0 + }, + "value": "PExclude0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11257, + "end": 11314, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11257, + "end": 11260, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11257, + "end": 11260, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11269, + "end": 11302, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11269, + "end": 11302, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11272, + "end": 11300, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11278, + "end": 11279, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11278, + "end": 11279, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11288, + "end": 11300, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 11288, + "end": 11291, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11288, + "end": 11291, + "ctxt": 0 + }, + "value": "1", + "raw": "\"1\"" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 11294, + "end": 11300, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11270, + "end": 11270, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11301, + "end": 11301, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11305, + "end": 11306, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11305, + "end": 11306, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11309, + "end": 11314, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11321, + "end": 11405, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11326, + "end": 11335, + "ctxt": 0 + }, + "value": "PExclude1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11338, + "end": 11404, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11338, + "end": 11341, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11338, + "end": 11341, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11350, + "end": 11392, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11350, + "end": 11392, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11353, + "end": 11390, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11359, + "end": 11360, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11359, + "end": 11360, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11369, + "end": 11390, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 11369, + "end": 11381, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11369, + "end": 11381, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 11373, + "end": 11379, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11370, + "end": 11371, + "ctxt": 0 + }, + "tail": false, + "cooked": "1", + "raw": "1" + }, + { + "type": "TemplateElement", + "span": { + "start": 11380, + "end": 11380, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 11384, + "end": 11390, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11351, + "end": 11351, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11391, + "end": 11391, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11395, + "end": 11396, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11395, + "end": 11396, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11399, + "end": 11404, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11411, + "end": 11484, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11416, + "end": 11425, + "ctxt": 0 + }, + "value": "PExclude2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11428, + "end": 11483, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11428, + "end": 11431, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11428, + "end": 11431, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11440, + "end": 11471, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11440, + "end": 11471, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11443, + "end": 11469, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11449, + "end": 11450, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11449, + "end": 11450, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11459, + "end": 11469, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 11459, + "end": 11460, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 11459, + "end": 11460, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 11463, + "end": 11469, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11441, + "end": 11441, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11470, + "end": 11470, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11474, + "end": 11475, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11474, + "end": 11475, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11478, + "end": 11483, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11491, + "end": 11584, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11496, + "end": 11505, + "ctxt": 0 + }, + "value": "PExclude3", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11508, + "end": 11583, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11508, + "end": 11511, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11508, + "end": 11511, + "ctxt": 0 + }, + "value": "0", + "raw": "\"0\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11520, + "end": 11571, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11520, + "end": 11571, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11523, + "end": 11569, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11529, + "end": 11530, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11529, + "end": 11530, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11539, + "end": 11569, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 11539, + "end": 11560, + "ctxt": 0 + }, + "typeName": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 11539, + "end": 11556, + "ctxt": 0 + }, + "value": "NumberLiteralEnum", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 11557, + "end": 11560, + "ctxt": 0 + }, + "value": "One", + "optional": false + } + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 11563, + "end": 11569, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11521, + "end": 11521, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11570, + "end": 11570, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11574, + "end": 11575, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11574, + "end": 11575, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11578, + "end": 11583, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11591, + "end": 11692, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11596, + "end": 11605, + "ctxt": 0 + }, + "value": "PExclude4", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11608, + "end": 11691, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11608, + "end": 11634, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11608, + "end": 11634, + "ctxt": 0 + }, + "value": "100000000000000000000000", + "raw": "\"100000000000000000000000\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11643, + "end": 11679, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11643, + "end": 11679, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11646, + "end": 11677, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11652, + "end": 11653, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11652, + "end": 11653, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 11662, + "end": 11677, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 11662, + "end": 11668, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 11671, + "end": 11677, + "ctxt": 0 + }, + "kind": "bigint" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11644, + "end": 11644, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11678, + "end": 11678, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11682, + "end": 11683, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11682, + "end": 11683, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11686, + "end": 11691, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11754, + "end": 11833, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11759, + "end": 11767, + "ctxt": 0 + }, + "value": "TPrefix0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11770, + "end": 11832, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11770, + "end": 11775, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11770, + "end": 11775, + "ctxt": 0 + }, + "value": "100", + "raw": "\"100\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11784, + "end": 11820, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11784, + "end": 11820, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11787, + "end": 11809, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11793, + "end": 11794, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11793, + "end": 11794, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 11803, + "end": 11809, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 11812, + "end": 11818, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11785, + "end": 11785, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11810, + "end": 11810, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11819, + "end": 11819, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11823, + "end": 11824, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11823, + "end": 11824, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11827, + "end": 11832, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11839, + "end": 11923, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11844, + "end": 11852, + "ctxt": 0 + }, + "value": "TPrefix1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11855, + "end": 11922, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11855, + "end": 11864, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 11855, + "end": 11864, + "ctxt": 0 + }, + "value": "trueabc", + "raw": "\"trueabc\"" + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 11873, + "end": 11910, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11873, + "end": 11910, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 11876, + "end": 11899, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 11882, + "end": 11883, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 11882, + "end": 11883, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 11892, + "end": 11899, + "ctxt": 0 + }, + "kind": "boolean" + }, + "default": null + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 11902, + "end": 11908, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11874, + "end": 11874, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11900, + "end": 11900, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 11909, + "end": 11909, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 11913, + "end": 11914, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 11913, + "end": 11914, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 11917, + "end": 11922, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 11979, + "end": 12069, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 11984, + "end": 11992, + "ctxt": 0 + }, + "value": "TPrefix2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 11995, + "end": 12068, + "ctxt": 0 + }, + "checkType": { + "type": "TsLiteralType", + "span": { + "start": 11995, + "end": 12010, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 11995, + "end": 12010, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 12002, + "end": 12008, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 11996, + "end": 12000, + "ctxt": 0 + }, + "tail": false, + "cooked": "100:", + "raw": "100:" + }, + { + "type": "TemplateElement", + "span": { + "start": 12009, + "end": 12009, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 12019, + "end": 12056, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 12019, + "end": 12056, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 12022, + "end": 12044, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 12028, + "end": 12029, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12028, + "end": 12029, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12038, + "end": 12044, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 12048, + "end": 12054, + "ctxt": 0 + }, + "kind": "string" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 12020, + "end": 12020, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 12045, + "end": 12046, + "ctxt": 0 + }, + "tail": false, + "cooked": ":", + "raw": ":" + }, + { + "type": "TemplateElement", + "span": { + "start": 12055, + "end": 12055, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 12059, + "end": 12060, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12059, + "end": 12060, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 12063, + "end": 12068, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12189, + "end": 12439, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12194, + "end": 12211, + "ctxt": 0 + }, + "value": "ExtractPrimitives", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 12211, + "end": 12229, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 12212, + "end": 12228, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12212, + "end": 12213, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12222, + "end": 12228, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 12236, + "end": 12433, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 12238, + "end": 12239, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12238, + "end": 12239, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 12246, + "end": 12297, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 12247, + "end": 12296, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 12247, + "end": 12248, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12247, + "end": 12248, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 12257, + "end": 12284, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 12257, + "end": 12284, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 12260, + "end": 12282, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 12266, + "end": 12267, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12266, + "end": 12267, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12276, + "end": 12282, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 12258, + "end": 12258, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 12283, + "end": 12283, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 12287, + "end": 12288, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12287, + "end": 12288, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 12291, + "end": 12296, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 12304, + "end": 12355, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 12305, + "end": 12354, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 12305, + "end": 12306, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12305, + "end": 12306, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 12315, + "end": 12342, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 12315, + "end": 12342, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 12318, + "end": 12340, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 12324, + "end": 12325, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12324, + "end": 12325, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12334, + "end": 12340, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 12316, + "end": 12316, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 12341, + "end": 12341, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 12345, + "end": 12346, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12345, + "end": 12346, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 12349, + "end": 12354, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 12362, + "end": 12433, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 12363, + "end": 12432, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 12363, + "end": 12364, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12363, + "end": 12364, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 12373, + "end": 12420, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 12373, + "end": 12420, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 12376, + "end": 12418, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 12382, + "end": 12383, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12382, + "end": 12383, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 12392, + "end": 12418, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 12392, + "end": 12399, + "ctxt": 0 + }, + "kind": "boolean" + }, + { + "type": "TsKeywordType", + "span": { + "start": 12402, + "end": 12406, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 12409, + "end": 12418, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 12374, + "end": 12374, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 12419, + "end": 12419, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 12423, + "end": 12424, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12423, + "end": 12424, + "ctxt": 0 + }, + "value": "U", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 12427, + "end": 12432, + "ctxt": 0 + }, + "kind": "never" + } + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12441, + "end": 12483, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12446, + "end": 12455, + "ctxt": 0 + }, + "value": "TExtract0", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 12458, + "end": 12482, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12458, + "end": 12475, + "ctxt": 0 + }, + "value": "ExtractPrimitives", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 12475, + "end": 12482, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 12476, + "end": 12481, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 12476, + "end": 12481, + "ctxt": 0 + }, + "value": "100", + "raw": "\"100\"" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12506, + "end": 12548, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12511, + "end": 12520, + "ctxt": 0 + }, + "value": "TExtract1", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 12523, + "end": 12547, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12523, + "end": 12540, + "ctxt": 0 + }, + "value": "ExtractPrimitives", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 12540, + "end": 12547, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 12541, + "end": 12546, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 12541, + "end": 12546, + "ctxt": 0 + }, + "value": "1.1", + "raw": "\"1.1\"" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12564, + "end": 12607, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12569, + "end": 12578, + "ctxt": 0 + }, + "value": "TExtract2", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 12581, + "end": 12606, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12581, + "end": 12598, + "ctxt": 0 + }, + "value": "ExtractPrimitives", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 12598, + "end": 12606, + "ctxt": 0 + }, + "params": [ + { + "type": "TsLiteralType", + "span": { + "start": 12599, + "end": 12605, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 12599, + "end": 12605, + "ctxt": 0 + }, + "value": "true", + "raw": "\"true\"" + } + } + ] + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12769, + "end": 12853, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12774, + "end": 12782, + "ctxt": 0 + }, + "value": "IndexFor", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 12782, + "end": 12800, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 12783, + "end": 12799, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12783, + "end": 12784, + "ctxt": 0 + }, + "value": "S", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12793, + "end": 12799, + "ctxt": 0 + }, + "kind": "string" + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 12803, + "end": 12852, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 12803, + "end": 12804, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12803, + "end": 12804, + "ctxt": 0 + }, + "value": "S", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 12813, + "end": 12840, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 12813, + "end": 12840, + "ctxt": 0 + }, + "types": [ + { + "type": "TsInferType", + "span": { + "start": 12816, + "end": 12838, + "ctxt": 0 + }, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 12822, + "end": 12823, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12822, + "end": 12823, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 12832, + "end": 12838, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 12814, + "end": 12814, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 12839, + "end": 12839, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + }, + "trueType": { + "type": "TsTypeReference", + "span": { + "start": 12843, + "end": 12844, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12843, + "end": 12844, + "ctxt": 0 + }, + "value": "N", + "optional": false + }, + "typeParams": null + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 12847, + "end": 12852, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 12854, + "end": 12909, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 12859, + "end": 12868, + "ctxt": 0 + }, + "value": "IndicesOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 12868, + "end": 12871, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 12869, + "end": 12870, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 12869, + "end": 12870, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 12874, + "end": 12908, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12874, + "end": 12882, + "ctxt": 0 + }, + "value": "IndexFor", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 12882, + "end": 12908, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 12883, + "end": 12907, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12883, + "end": 12890, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 12890, + "end": 12907, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeOperator", + "span": { + "start": 12891, + "end": 12898, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 12897, + "end": 12898, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 12897, + "end": 12898, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 12900, + "end": 12906, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + } + ] + } + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 12949, + "end": 13101, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 12959, + "end": 12974, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 12975, + "end": 13101, + "ctxt": 0 + }, + "body": [ + { + "type": "TsPropertySignature", + "span": { + "start": 12981, + "end": 13003, + "ctxt": 0 + }, + "readonly": true, + "key": { + "type": "Identifier", + "span": { + "start": 12990, + "end": 12994, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 12994, + "end": 13002, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 12996, + "end": 13002, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 13008, + "end": 13099, + "ctxt": 0 + }, + "readonly": true, + "key": { + "type": "Identifier", + "span": { + "start": 13017, + "end": 13021, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 13021, + "end": 13098, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 13023, + "end": 13098, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 13023, + "end": 13027, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13023, + "end": 13027, + "ctxt": 0 + }, + "value": "i8", + "raw": "\"i8\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13030, + "end": 13035, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13030, + "end": 13035, + "ctxt": 0 + }, + "value": "i16", + "raw": "\"i16\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13038, + "end": 13043, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13038, + "end": 13043, + "ctxt": 0 + }, + "value": "i32", + "raw": "\"i32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13046, + "end": 13051, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13046, + "end": 13051, + "ctxt": 0 + }, + "value": "i64", + "raw": "\"i64\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13054, + "end": 13058, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13054, + "end": 13058, + "ctxt": 0 + }, + "value": "u8", + "raw": "\"u8\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13061, + "end": 13066, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13061, + "end": 13066, + "ctxt": 0 + }, + "value": "u16", + "raw": "\"u16\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13069, + "end": 13074, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13069, + "end": 13074, + "ctxt": 0 + }, + "value": "u32", + "raw": "\"u32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13077, + "end": 13082, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13077, + "end": 13082, + "ctxt": 0 + }, + "value": "u64", + "raw": "\"u64\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13085, + "end": 13090, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13085, + "end": 13090, + "ctxt": 0 + }, + "value": "f32", + "raw": "\"f32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13093, + "end": 13098, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13093, + "end": 13098, + "ctxt": 0 + }, + "value": "f64", + "raw": "\"f64\"" + } + } + ] + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 13103, + "end": 13289, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 13108, + "end": 13117, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 13117, + "end": 13152, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 13118, + "end": 13151, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13118, + "end": 13119, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsIndexedAccessType", + "span": { + "start": 13128, + "end": 13151, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13128, + "end": 13143, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13128, + "end": 13143, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 13144, + "end": 13150, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13144, + "end": 13150, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 13159, + "end": 13288, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 13159, + "end": 13160, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13159, + "end": 13160, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsUnionType", + "span": { + "start": 13169, + "end": 13228, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 13169, + "end": 13173, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13169, + "end": 13173, + "ctxt": 0 + }, + "value": "i8", + "raw": "\"i8\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13176, + "end": 13181, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13176, + "end": 13181, + "ctxt": 0 + }, + "value": "i16", + "raw": "\"i16\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13184, + "end": 13189, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13184, + "end": 13189, + "ctxt": 0 + }, + "value": "i32", + "raw": "\"i32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13192, + "end": 13196, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13192, + "end": 13196, + "ctxt": 0 + }, + "value": "u8", + "raw": "\"u8\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13199, + "end": 13204, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13199, + "end": 13204, + "ctxt": 0 + }, + "value": "u16", + "raw": "\"u16\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13207, + "end": 13212, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13207, + "end": 13212, + "ctxt": 0 + }, + "value": "u32", + "raw": "\"u32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13215, + "end": 13220, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13215, + "end": 13220, + "ctxt": 0 + }, + "value": "f32", + "raw": "\"f32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13223, + "end": 13228, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13223, + "end": 13228, + "ctxt": 0 + }, + "value": "f64", + "raw": "\"f64\"" + } + } + ] + }, + "trueType": { + "type": "TsKeywordType", + "span": { + "start": 13231, + "end": 13237, + "ctxt": 0 + }, + "kind": "number" + }, + "falseType": { + "type": "TsConditionalType", + "span": { + "start": 13244, + "end": 13288, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 13244, + "end": 13245, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13244, + "end": 13245, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsUnionType", + "span": { + "start": 13254, + "end": 13267, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 13254, + "end": 13259, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13254, + "end": 13259, + "ctxt": 0 + }, + "value": "f32", + "raw": "\"f32\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13262, + "end": 13267, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13262, + "end": 13267, + "ctxt": 0 + }, + "value": "f64", + "raw": "\"f64\"" + } + } + ] + }, + "trueType": { + "type": "TsKeywordType", + "span": { + "start": 13270, + "end": 13276, + "ctxt": 0 + }, + "kind": "bigint" + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 13283, + "end": 13288, + "ctxt": 0 + }, + "kind": "never" + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 13414, + "end": 13587, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 13419, + "end": 13442, + "ctxt": 0 + }, + "value": "TypedObjectNamedMembers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 13442, + "end": 13483, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 13443, + "end": 13482, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13443, + "end": 13447, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 13456, + "end": 13482, + "ctxt": 0 + }, + "op": "readonly", + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 13465, + "end": 13482, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 13465, + "end": 13480, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13465, + "end": 13480, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 13486, + "end": 13586, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 13493, + "end": 13518, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13493, + "end": 13494, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsIndexedAccessType", + "span": { + "start": 13498, + "end": 13518, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsIndexedAccessType", + "span": { + "start": 13498, + "end": 13510, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13498, + "end": 13502, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13498, + "end": 13502, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 13503, + "end": 13509, + "ctxt": 0 + }, + "kind": "number" + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 13511, + "end": 13517, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13511, + "end": 13517, + "ctxt": 0 + }, + "value": "name", + "raw": "\"name\"" + } + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 13521, + "end": 13583, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13521, + "end": 13530, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 13530, + "end": 13583, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 13531, + "end": 13582, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13531, + "end": 13574, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13531, + "end": 13538, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 13538, + "end": 13574, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 13539, + "end": 13551, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13539, + "end": 13543, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13539, + "end": 13543, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 13544, + "end": 13550, + "ctxt": 0 + }, + "kind": "number" + } + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 13553, + "end": 13573, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 13555, + "end": 13571, + "ctxt": 0 + }, + "readonly": true, + "key": { + "type": "Identifier", + "span": { + "start": 13564, + "end": 13568, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 13568, + "end": 13571, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 13570, + "end": 13571, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13570, + "end": 13571, + "ctxt": 0 + }, + "value": "P", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 13575, + "end": 13581, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13575, + "end": 13581, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 13714, + "end": 13891, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 13719, + "end": 13744, + "ctxt": 0 + }, + "value": "TypedObjectOrdinalMembers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 13744, + "end": 13785, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 13745, + "end": 13784, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13745, + "end": 13749, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 13758, + "end": 13784, + "ctxt": 0 + }, + "op": "readonly", + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 13767, + "end": 13784, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 13767, + "end": 13782, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13767, + "end": 13782, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsMappedType", + "span": { + "start": 13788, + "end": 13890, + "ctxt": 0 + }, + "readonly": null, + "typeParam": { + "type": "TsTypeParameter", + "span": { + "start": 13795, + "end": 13832, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13795, + "end": 13796, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 13800, + "end": 13832, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13800, + "end": 13807, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 13807, + "end": 13832, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeOperator", + "span": { + "start": 13808, + "end": 13818, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 13814, + "end": 13818, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13814, + "end": 13818, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 13820, + "end": 13831, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 13820, + "end": 13831, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 13823, + "end": 13829, + "ctxt": 0 + }, + "kind": "number" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 13821, + "end": 13821, + "ctxt": 0 + }, + "tail": false, + "cooked": "", + "raw": "" + }, + { + "type": "TemplateElement", + "span": { + "start": 13830, + "end": 13830, + "ctxt": 0 + }, + "tail": true, + "cooked": "", + "raw": "" + } + ] + } + } + ] + } + }, + "default": null + }, + "nameType": null, + "optional": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 13835, + "end": 13887, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13835, + "end": 13844, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 13844, + "end": 13887, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 13845, + "end": 13886, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13845, + "end": 13878, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13845, + "end": 13852, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 13852, + "end": 13878, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 13853, + "end": 13860, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 13853, + "end": 13857, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13853, + "end": 13857, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 13858, + "end": 13859, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13858, + "end": 13859, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 13862, + "end": 13877, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13862, + "end": 13877, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 13879, + "end": 13885, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 13879, + "end": 13885, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 13912, + "end": 14511, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 13922, + "end": 13940, + "ctxt": 0 + }, + "value": "TypedObjectMembers", + "optional": false + }, + "declare": false, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 13940, + "end": 13981, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 13941, + "end": 13980, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 13941, + "end": 13945, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 13954, + "end": 13980, + "ctxt": 0 + }, + "op": "readonly", + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 13963, + "end": 13980, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 13963, + "end": 13978, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 13963, + "end": 13978, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + } + }, + "default": null + } + ] + }, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 13982, + "end": 14511, + "ctxt": 0 + }, + "body": [ + { + "type": "TsMethodSignature", + "span": { + "start": 14019, + "end": 14127, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14019, + "end": 14022, + "ctxt": 0 + }, + "value": "get", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 14055, + "end": 14061, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14058, + "end": 14061, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14060, + "end": 14061, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14060, + "end": 14061, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 14062, + "end": 14126, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14064, + "end": 14126, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14064, + "end": 14073, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14073, + "end": 14126, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14074, + "end": 14125, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14074, + "end": 14117, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14074, + "end": 14081, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14081, + "end": 14117, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14082, + "end": 14094, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14082, + "end": 14086, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14082, + "end": 14086, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 14087, + "end": 14093, + "ctxt": 0 + }, + "kind": "number" + } + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 14096, + "end": 14116, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 14098, + "end": 14114, + "ctxt": 0 + }, + "readonly": true, + "key": { + "type": "Identifier", + "span": { + "start": 14107, + "end": 14111, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14111, + "end": 14114, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14113, + "end": 14114, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14113, + "end": 14114, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14118, + "end": 14124, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14118, + "end": 14124, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 14022, + "end": 14054, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 14023, + "end": 14053, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 14023, + "end": 14024, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsIndexedAccessType", + "span": { + "start": 14033, + "end": 14053, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsIndexedAccessType", + "span": { + "start": 14033, + "end": 14045, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14033, + "end": 14037, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14033, + "end": 14037, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 14038, + "end": 14044, + "ctxt": 0 + }, + "kind": "number" + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14046, + "end": 14052, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14046, + "end": 14052, + "ctxt": 0 + }, + "value": "name", + "raw": "\"name\"" + } + } + }, + "default": null + } + ] + } + }, + { + "type": "TsMethodSignature", + "span": { + "start": 14132, + "end": 14253, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14132, + "end": 14135, + "ctxt": 0 + }, + "value": "set", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 14168, + "end": 14174, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14171, + "end": 14174, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14173, + "end": 14174, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14173, + "end": 14174, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 14176, + "end": 14245, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14181, + "end": 14245, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14183, + "end": 14245, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14183, + "end": 14192, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14192, + "end": 14245, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14193, + "end": 14244, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14193, + "end": 14236, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14193, + "end": 14200, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14200, + "end": 14236, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14201, + "end": 14213, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14201, + "end": 14205, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14201, + "end": 14205, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 14206, + "end": 14212, + "ctxt": 0 + }, + "kind": "number" + } + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 14215, + "end": 14235, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 14217, + "end": 14233, + "ctxt": 0 + }, + "readonly": true, + "key": { + "type": "Identifier", + "span": { + "start": 14226, + "end": 14230, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14230, + "end": 14233, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14232, + "end": 14233, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14232, + "end": 14233, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "typeParams": null + } + }, + "typeParams": null + } + ] + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14237, + "end": 14243, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14237, + "end": 14243, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 14246, + "end": 14252, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 14248, + "end": 14252, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 14135, + "end": 14167, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 14136, + "end": 14166, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 14136, + "end": 14137, + "ctxt": 0 + }, + "value": "K", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsIndexedAccessType", + "span": { + "start": 14146, + "end": 14166, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsIndexedAccessType", + "span": { + "start": 14146, + "end": 14158, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14146, + "end": 14150, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14146, + "end": 14150, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 14151, + "end": 14157, + "ctxt": 0 + }, + "kind": "number" + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14159, + "end": 14165, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14159, + "end": 14165, + "ctxt": 0 + }, + "value": "name", + "raw": "\"name\"" + } + } + }, + "default": null + } + ] + } + }, + { + "type": "TsMethodSignature", + "span": { + "start": 14291, + "end": 14391, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14291, + "end": 14299, + "ctxt": 0 + }, + "value": "getIndex", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 14327, + "end": 14335, + "ctxt": 0 + }, + "value": "index", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14332, + "end": 14335, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14334, + "end": 14335, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14334, + "end": 14335, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 14336, + "end": 14390, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14338, + "end": 14390, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14338, + "end": 14347, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14347, + "end": 14390, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14348, + "end": 14389, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14348, + "end": 14381, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14348, + "end": 14355, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14355, + "end": 14381, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14356, + "end": 14363, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14356, + "end": 14360, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14356, + "end": 14360, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 14361, + "end": 14362, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14361, + "end": 14362, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 14365, + "end": 14380, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14365, + "end": 14380, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14382, + "end": 14388, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14382, + "end": 14388, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 14299, + "end": 14326, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 14300, + "end": 14325, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 14300, + "end": 14301, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 14310, + "end": 14325, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14310, + "end": 14319, + "ctxt": 0 + }, + "value": "IndicesOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14319, + "end": 14325, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 14320, + "end": 14324, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14320, + "end": 14324, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "default": null + } + ] + } + }, + { + "type": "TsMethodSignature", + "span": { + "start": 14396, + "end": 14509, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14396, + "end": 14404, + "ctxt": 0 + }, + "value": "setIndex", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 14432, + "end": 14440, + "ctxt": 0 + }, + "value": "index", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14437, + "end": 14440, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14439, + "end": 14440, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14439, + "end": 14440, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "Identifier", + "span": { + "start": 14442, + "end": 14501, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14447, + "end": 14501, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14449, + "end": 14501, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14449, + "end": 14458, + "ctxt": 0 + }, + "value": "FieldType", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14458, + "end": 14501, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14459, + "end": 14500, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14459, + "end": 14492, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14459, + "end": 14466, + "ctxt": 0 + }, + "value": "Extract", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14466, + "end": 14492, + "ctxt": 0 + }, + "params": [ + { + "type": "TsIndexedAccessType", + "span": { + "start": 14467, + "end": 14474, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 14467, + "end": 14471, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14467, + "end": 14471, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 14472, + "end": 14473, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14472, + "end": 14473, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "typeParams": null + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 14476, + "end": 14491, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14476, + "end": 14491, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "indexType": { + "type": "TsLiteralType", + "span": { + "start": 14493, + "end": 14499, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14493, + "end": 14499, + "ctxt": 0 + }, + "value": "type", + "raw": "\"type\"" + } + } + } + ] + } + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 14502, + "end": 14508, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 14504, + "end": 14508, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 14404, + "end": 14431, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 14405, + "end": 14430, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 14405, + "end": 14406, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 14415, + "end": 14430, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14415, + "end": 14424, + "ctxt": 0 + }, + "value": "IndicesOf", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14424, + "end": 14430, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 14425, + "end": 14429, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14425, + "end": 14429, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "default": null + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 14513, + "end": 14678, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 14518, + "end": 14529, + "ctxt": 0 + }, + "value": "TypedObject", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 14529, + "end": 14570, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 14530, + "end": 14569, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 14530, + "end": 14534, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 14543, + "end": 14569, + "ctxt": 0 + }, + "op": "readonly", + "typeAnnotation": { + "type": "TsArrayType", + "span": { + "start": 14552, + "end": 14569, + "ctxt": 0 + }, + "elemType": { + "type": "TsTypeReference", + "span": { + "start": 14552, + "end": 14567, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14552, + "end": 14567, + "ctxt": 0 + }, + "value": "FieldDefinition", + "optional": false + }, + "typeParams": null + } + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 14577, + "end": 14677, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 14579, + "end": 14603, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14579, + "end": 14597, + "ctxt": 0 + }, + "value": "TypedObjectMembers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14597, + "end": 14603, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 14598, + "end": 14602, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14598, + "end": 14602, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 14610, + "end": 14639, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14610, + "end": 14633, + "ctxt": 0 + }, + "value": "TypedObjectNamedMembers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14633, + "end": 14639, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 14634, + "end": 14638, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14634, + "end": 14638, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 14646, + "end": 14677, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14646, + "end": 14671, + "ctxt": 0 + }, + "value": "TypedObjectOrdinalMembers", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14671, + "end": 14677, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 14672, + "end": 14676, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14672, + "end": 14676, + "ctxt": 0 + }, + "value": "TDef", + "optional": false + }, + "typeParams": null + } + ] + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 14810, + "end": 14904, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 14815, + "end": 14820, + "ctxt": 0 + }, + "value": "Point", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14823, + "end": 14903, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14823, + "end": 14834, + "ctxt": 0 + }, + "value": "TypedObject", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 14834, + "end": 14903, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTupleType", + "span": { + "start": 14835, + "end": 14902, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 14841, + "end": 14867, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeLiteral", + "span": { + "start": 14841, + "end": 14867, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 14843, + "end": 14853, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14843, + "end": 14847, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14847, + "end": 14852, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 14849, + "end": 14852, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14849, + "end": 14852, + "ctxt": 0 + }, + "value": "x", + "raw": "\"x\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 14854, + "end": 14865, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14854, + "end": 14858, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14858, + "end": 14865, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 14860, + "end": 14865, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14860, + "end": 14865, + "ctxt": 0 + }, + "value": "f64", + "raw": "\"f64\"" + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 14873, + "end": 14899, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsTypeLiteral", + "span": { + "start": 14873, + "end": 14899, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 14875, + "end": 14885, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14875, + "end": 14879, + "ctxt": 0 + }, + "value": "name", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14879, + "end": 14884, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 14881, + "end": 14884, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14881, + "end": 14884, + "ctxt": 0 + }, + "value": "y", + "raw": "\"y\"" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 14886, + "end": 14897, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 14886, + "end": 14890, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14890, + "end": 14897, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 14892, + "end": 14897, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 14892, + "end": 14897, + "ctxt": 0 + }, + "value": "f64", + "raw": "\"f64\"" + } + } + }, + "typeParams": null + } + ] + } + } + ] + } + ] + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 14906, + "end": 14929, + "ctxt": 0 + }, + "kind": "const", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 14920, + "end": 14928, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 14920, + "end": 14921, + "ctxt": 0 + }, + "value": "p", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 14921, + "end": 14928, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 14923, + "end": 14928, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 14923, + "end": 14928, + "ctxt": 0 + }, + "value": "Point", + "optional": false + }, + "typeParams": null + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 14930, + "end": 14944, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 14930, + "end": 14943, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 14930, + "end": 14940, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 14930, + "end": 14931, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 14932, + "end": 14940, + "ctxt": 0 + }, + "value": "getIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 14941, + "end": 14942, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 14971, + "end": 14985, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 14971, + "end": 14984, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 14971, + "end": 14981, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 14971, + "end": 14972, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 14973, + "end": 14981, + "ctxt": 0 + }, + "value": "getIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 14982, + "end": 14983, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15012, + "end": 15026, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15012, + "end": 15025, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 15012, + "end": 15022, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 15012, + "end": 15013, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 15014, + "end": 15022, + "ctxt": 0 + }, + "value": "getIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15023, + "end": 15024, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15061, + "end": 15078, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15061, + "end": 15077, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 15061, + "end": 15071, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 15061, + "end": 15062, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 15063, + "end": 15071, + "ctxt": 0 + }, + "value": "setIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15072, + "end": 15073, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15075, + "end": 15076, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15105, + "end": 15122, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15105, + "end": 15121, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 15105, + "end": 15115, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 15105, + "end": 15106, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 15107, + "end": 15115, + "ctxt": 0 + }, + "value": "setIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15116, + "end": 15117, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15119, + "end": 15120, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15149, + "end": 15166, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15149, + "end": 15165, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 15149, + "end": 15159, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 15149, + "end": 15150, + "ctxt": 0 + }, + "value": "p", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 15151, + "end": 15159, + "ctxt": 0 + }, + "value": "setIndex", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15160, + "end": 15161, + "ctxt": 0 + }, + "value": 2.0, + "raw": "2" + } + }, + { + "spread": null, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 15163, + "end": 15164, + "ctxt": 0 + }, + "value": 3.0, + "raw": "3" + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 15240, + "end": 15242, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 15270, + "end": 15283, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 15270, + "end": 15283, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 15271, + "end": 15283, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 15273, + "end": 15283, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 15273, + "end": 15283, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 15278, + "end": 15279, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15278, + "end": 15279, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 15274, + "end": 15276, + "ctxt": 0 + }, + "tail": false, + "cooked": "**", + "raw": "**" + }, + { + "type": "TemplateElement", + "span": { + "start": 15280, + "end": 15282, + "ctxt": 0 + }, + "tail": true, + "cooked": "**", + "raw": "**" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 15223, + "end": 15288, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 15242, + "end": 15269, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 15243, + "end": 15268, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 15243, + "end": 15244, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 15253, + "end": 15268, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 15253, + "end": 15259, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 15262, + "end": 15268, + "ctxt": 0 + }, + "kind": "number" + } + ] + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 15284, + "end": 15287, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 15286, + "end": 15287, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15286, + "end": 15287, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15289, + "end": 15303, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15289, + "end": 15302, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 15289, + "end": 15291, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 15292, + "end": 15301, + "ctxt": 0 + }, + "value": "**123**", + "raw": "\"**123**\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 15331, + "end": 15333, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 15352, + "end": 15365, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 15352, + "end": 15365, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 15353, + "end": 15365, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 15355, + "end": 15365, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 15355, + "end": 15365, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 15360, + "end": 15361, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15360, + "end": 15361, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 15356, + "end": 15358, + "ctxt": 0 + }, + "tail": false, + "cooked": "**", + "raw": "**" + }, + { + "type": "TemplateElement", + "span": { + "start": 15362, + "end": 15364, + "ctxt": 0 + }, + "tail": true, + "cooked": "**", + "raw": "**" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 15314, + "end": 15370, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 15333, + "end": 15351, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 15334, + "end": 15350, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 15334, + "end": 15335, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 15344, + "end": 15350, + "ctxt": 0 + }, + "kind": "number" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 15366, + "end": 15369, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 15368, + "end": 15369, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15368, + "end": 15369, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15371, + "end": 15385, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15371, + "end": 15384, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 15371, + "end": 15373, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 15374, + "end": 15383, + "ctxt": 0 + }, + "value": "**123**", + "raw": "\"**123**\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 15411, + "end": 15413, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 15432, + "end": 15445, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 15432, + "end": 15445, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 15433, + "end": 15445, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 15435, + "end": 15445, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 15435, + "end": 15445, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 15440, + "end": 15441, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15440, + "end": 15441, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 15436, + "end": 15438, + "ctxt": 0 + }, + "tail": false, + "cooked": "**", + "raw": "**" + }, + { + "type": "TemplateElement", + "span": { + "start": 15442, + "end": 15444, + "ctxt": 0 + }, + "tail": true, + "cooked": "**", + "raw": "**" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 15394, + "end": 15450, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 15413, + "end": 15431, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 15414, + "end": 15430, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 15414, + "end": 15415, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 15424, + "end": 15430, + "ctxt": 0 + }, + "kind": "bigint" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 15446, + "end": 15449, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 15448, + "end": 15449, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15448, + "end": 15449, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15451, + "end": 15465, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15451, + "end": 15464, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 15451, + "end": 15453, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 15454, + "end": 15463, + "ctxt": 0 + }, + "value": "**123**", + "raw": "\"**123**\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 15492, + "end": 15494, + "ctxt": 0 + }, + "value": "f4", + "optional": false + }, + "declare": true, + "params": [ + { + "type": "Parameter", + "span": { + "start": 15514, + "end": 15527, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 15514, + "end": 15527, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 15515, + "end": 15527, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 15517, + "end": 15527, + "ctxt": 0 + }, + "literal": { + "type": "TemplateLiteral", + "span": { + "start": 15517, + "end": 15527, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 15522, + "end": 15523, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15522, + "end": 15523, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ], + "quasis": [ + { + "type": "TemplateElement", + "span": { + "start": 15518, + "end": 15520, + "ctxt": 0 + }, + "tail": false, + "cooked": "**", + "raw": "**" + }, + { + "type": "TemplateElement", + "span": { + "start": 15524, + "end": 15526, + "ctxt": 0 + }, + "tail": true, + "cooked": "**", + "raw": "**" + } + ] + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 15475, + "end": 15532, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 15494, + "end": 15513, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 15495, + "end": 15512, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 15495, + "end": 15496, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 15505, + "end": 15512, + "ctxt": 0 + }, + "kind": "boolean" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 15528, + "end": 15531, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 15530, + "end": 15531, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 15530, + "end": 15531, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15533, + "end": 15548, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15533, + "end": 15547, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 15533, + "end": 15535, + "ctxt": 0 + }, + "value": "f4", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 15536, + "end": 15546, + "ctxt": 0 + }, + "value": "**true**", + "raw": "\"**true**\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 15566, + "end": 15582, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 15566, + "end": 15581, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 15566, + "end": 15568, + "ctxt": 0 + }, + "value": "f4", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 15569, + "end": 15580, + "ctxt": 0 + }, + "value": "**false**", + "raw": "\"**false**\"" + } + } + ], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.ts b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.ts new file mode 100644 index 00000000000..1acdf04de8e --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/templateLiteralTypes4.ts @@ -0,0 +1,307 @@ +// @strict: true +// @target: esnext +// @declaration: true + +// infer from number +type TNumber0 = "100" extends `${infer N extends number}` ? N : never; // 100 +type TNumber1 = "-100" extends `${infer N extends number}` ? N : never; // -100 +type TNumber2 = "1.1" extends `${infer N extends number}` ? N : never; // 1.1 +type TNumber3 = "8e-11" extends `${infer N extends number}` ? N : never; // 8e-11 (0.00000000008) +type TNumber4 = "0x10" extends `${infer N extends number}` ? N : never; // number (not round-trippable) +type TNumber5 = "0o10" extends `${infer N extends number}` ? N : never; // number (not round-trippable) +type TNumber6 = "0b10" extends `${infer N extends number}` ? N : never; // number (not round-trippable) +type TNumber7 = "10e2" extends `${infer N extends number}` ? N : never; // number (not round-trippable) +type TNumber8 = "abcd" extends `${infer N extends number}` ? N : never; // never + +// infer from bigint +type TBigInt0 = "100" extends `${infer N extends bigint}` ? N : never; // 100n +type TBigInt1 = "-100" extends `${infer N extends bigint}` ? N : never; // -100n +type TBigInt2 = "0x10" extends `${infer N extends bigint}` ? N : never; // bigint (not round-trippable) +type TBigInt3 = "0o10" extends `${infer N extends bigint}` ? N : never; // bigint (not round-trippable) +type TBigInt4 = "0b10" extends `${infer N extends bigint}` ? N : never; // bigint (not round-trippable) +type TBigInt5 = "1.1" extends `${infer N extends bigint}` ? N : never; // never +type TBigInt6 = "10e2" extends `${infer N extends bigint}` ? N : never; // never +type TBigInt7 = "abcd" extends `${infer N extends bigint}` ? N : never; // never + +// infer from boolean +type TBoolean0 = "true" extends `${infer T extends boolean}` ? T : never; // true +type TBoolean1 = "false" extends `${infer T extends boolean}` ? T : never; // false +type TBoolean2 = "abcd" extends `${infer T extends boolean}` ? T : never; // never + +// infer from null +type TNull0 = "null" extends `${infer T extends null}` ? T : never; // null +type TNull1 = "abcd" extends `${infer T extends null}` ? T : never; // never + +// infer from undefined +type TUndefined0 = "undefined" extends `${infer T extends undefined}` ? T : never; // undefined +type TUndefined1 = "abcd" extends `${infer T extends undefined}` ? T : never; // never + +// infer from literal enums +const enum StringLiteralEnum { Zero = "0", True = "true", False = "false", Undefined = "undefined", Null = "null" } +type TStringLiteralEnum0 = "0" extends `${infer T extends StringLiteralEnum}` ? T : never; // StringLiteralEnum.Zero + +const enum NumberLiteralEnum { Zero, One } +type TNumberLiteralEnum0 = "0" extends `${infer T extends NumberLiteralEnum}` ? T : never; // NumberLiteralEnum.Zero + +// infer from non-literal enums +const enum NonLiteralEnum { Zero = NumberLiteralEnum.Zero, One = NumberLiteralEnum.One } +type TNonLiteralEnum0 = "0" extends `${infer T extends NonLiteralEnum}` ? T : never; // 0 + +// infer using priority: +// string > template-literal > (string-literal | string-literal-enum) > +// number > enum > (number-literal | number-literal-enum) > +// bigint > bigint-literal > +// boolean > (boolean-literal | undefined | null) + +// #region string +// string > string-literal-enum +type PString00 = "0" extends `${infer T extends string | StringLiteralEnum}` ? T : never; // "0" + +// string > number +type PString01 = "0" extends `${infer T extends string | number}` ? T : never; // "0" + +// string > enum +type PString02 = "0" extends `${infer T extends string | NonLiteralEnum}` ? T : never; // "0" + +// string > (number-literal | number-literal-enum) +type PString03 = "0" extends `${infer T extends string | 0}` ? T : never; // "0" +type PString04 = "0" extends `${infer T extends string | NumberLiteralEnum}` ? T : never; // "0" + +// string > bigint +type PString05 = "0" extends `${infer T extends string | bigint}` ? T : never; // "0" + +// string > bigint-literal +type PString06 = "0" extends `${infer T extends string | 0n}` ? T : never; // "0" + +// string > boolean +type PString07 = "true" extends `${infer T extends string | boolean}` ? T : never; // "true" +type PString08 = "false" extends `${infer T extends string | boolean}` ? T : never; // "false" + +// string > (boolean-literal | undefined | null) +type PString09 = "true" extends `${infer T extends string | true}` ? T : never; // "true" +type PString10 = "false" extends `${infer T extends string | false}` ? T : never; // "false" +type PString11 = "undefined" extends `${infer T extends string | undefined}` ? T : never; // "undefined" +type PString12 = "null" extends `${infer T extends string | null}` ? T : never; // "null" +// #endregion string + +// #region template-literal +// template-literal > number +type PTemplate00 = "10" extends `${infer T extends `1${string}` | number}` ? T : never; // "10" + +// template-literal > enum +type PTemplate01 = "10" extends `${infer T extends `1${string}` | NonLiteralEnum}` ? T : never; // "10" + +// template-literal > (number-literal | number-literal-enum) +type PTemplate02 = "10" extends `${infer T extends `1${string}` | 10}` ? T : never; // "10" +type PTemplate03 = "10" extends `${infer T extends `1${string}` | NumberLiteralEnum}` ? T : never; // "10" + +// template-literal > bigint +type PTemplate04 = "10" extends `${infer T extends `1${string}` | bigint}` ? T : never; // "10" + +// template-literal > bigint-literal +type PTemplate05 = "10" extends `${infer T extends `1${string}` | 10n}` ? T : never; // "10" + +// template-literal > boolean +type PTemplate06 = "true" extends `${infer T extends `${string}e` | boolean}` ? T : never; // "true" +type PTemplate07 = "false" extends `${infer T extends `${string}e` | boolean}` ? T : never; // "false" + +// template-literal > (boolean-literal | undefined | null) +type PTemplate08 = "true" extends `${infer T extends `${"t"}${string}` | true}` ? T : never; // "true" +type PTemplate09 = "false" extends `${infer T extends `${"f"}${string}` | false}` ? T : never; // "false" +type PTemplate10 = "undefined" extends `${infer T extends `${"u"}${string}` | undefined}` ? T : never; // "undefined" +type PTemplate11 = "null" extends `${infer T extends `${"n"}${string}` | null}` ? T : never; // "null" +// #endregion template-literal + +// #region string-literal +// string-literal > number +type PStringLiteral00 = "0" extends `${infer T extends "0" | number}` ? T : never; // "0" + +// string-literal > enum +type PStringLiteral01 = "0" extends `${infer T extends "0" | NonLiteralEnum}` ? T : never; // "0" + +// string-literal > (number-literal | number-literal-enum) +type PStringLiteral02 = "0" extends `${infer T extends "0" | 0}` ? T : never; // "0" +type PStringLiteral03 = "0" extends `${infer T extends "0" | NumberLiteralEnum}` ? T : never; // "0" + +// string-literal > bigint +type PStringLiteral04 = "0" extends `${infer T extends "0" | bigint}` ? T : never; // "0" + +// string-literal > bigint-literal +type PStringLiteral05 = "0" extends `${infer T extends "0" | 0n}` ? T : never; // "0" + +// string-literal > boolean +type PStringLiteral06 = "true" extends `${infer T extends "true" | "false" | boolean}` ? T : never; // "true" +type PStringLiteral07 = "false" extends `${infer T extends "true" | "false" | boolean}` ? T : never; // "false" + +// string-literal > (boolean-literal | undefined | null) +type PStringLiteral08 = "true" extends `${infer T extends "true" | true}` ? T : never; // "true" +type PStringLiteral09 = "false" extends `${infer T extends "false" | false}` ? T : never; // "false" +type PStringLiteral10 = "undefined" extends `${infer T extends "undefined" | undefined}` ? T : never; // "undefined" +type PStringLiteral11 = "null" extends `${infer T extends "null" | null}` ? T : never; // "null" +// #endregion string-literal + +// #region string-literal-enum +// string-literal-enum > number +type PStringLiteralEnum00 = "0" extends `${infer T extends StringLiteralEnum | number}` ? T : never; // StringLiteralEnum.Zero + +// string-literal-enum > enum +type PStringLiteralEnum01 = "0" extends `${infer T extends StringLiteralEnum | NonLiteralEnum}` ? T : never; // StringLiteralEnum.Zero + +// string-literal-enum > (number-literal | number-literal-enum) +type PStringLiteralEnum02 = "0" extends `${infer T extends StringLiteralEnum | 0}` ? T : never; // StringLiteralEnum.Zero +type PStringLiteralEnum03 = "0" extends `${infer T extends StringLiteralEnum | NumberLiteralEnum}` ? T : never; // StringLiteralEnum.Zero + +// string-literal-enum > bigint +type PStringLiteralEnum04 = "0" extends `${infer T extends StringLiteralEnum | bigint}` ? T : never; // StringLiteralEnum.Zero + +// string-literal-enum > bigint-literal +type PStringLiteralEnum05 = "0" extends `${infer T extends StringLiteralEnum | 0n}` ? T : never; // StringLiteralEnum.Zero + +// string-literal-enum > boolean +type PStringLiteralEnum06 = "true" extends `${infer T extends StringLiteralEnum | boolean}` ? T : never; // StringLiteralEnum.True +type PStringLiteralEnum07 = "false" extends `${infer T extends StringLiteralEnum | boolean}` ? T : never; // StringLiteralEnum.False + +// string-literal-enum > (boolean-literal | undefined | null) +type PStringLiteralEnum08 = "true" extends `${infer T extends StringLiteralEnum | true}` ? T : never; // StringLiteralEnum.True +type PStringLiteralEnum09 = "false" extends `${infer T extends StringLiteralEnum | false}` ? T : never; // StringLiteralEnum.False +type PStringLiteralEnum10 = "undefined" extends `${infer T extends StringLiteralEnum | undefined}` ? T : never; // StringLiteralEnum.Undefined +type PStringLiteralEnum11 = "null" extends `${infer T extends StringLiteralEnum | null}` ? T : never; // StringLiteralEnum.Null +// #endregion string-literal-enum + +// #region number +// number > enum +type PNumber0 = "0" extends `${infer T extends number | NonLiteralEnum}` ? T : never; // 0 + +// number > number-literal-enum +type PNumber1 = "0" extends `${infer T extends number | NumberLiteralEnum}` ? T : never; // 0 + +// number > bigint +type PNumber2 = "0" extends `${infer T extends number | bigint}` ? T : never; // 0 + +// number > bigint-literal +type PNumber3 = "0" extends `${infer T extends number | 0n}` ? T : never; // 0 +// #endregion number + +// #region enum +// enum > number-literal-enum +type PEnum0 = "0" extends `${infer T extends NonLiteralEnum | NumberLiteralEnum}` ? T : never; // 0 + +// enum > bigint +type PEnum1 = "0" extends `${infer T extends NonLiteralEnum | bigint}` ? T : never; // 0 + +// enum > bigint-literal +type PEnum2 = "0" extends `${infer T extends NonLiteralEnum | 0n}` ? T : never; // 0 +// #endregion enum + +// #region number-literal +// number-literal > bigint +type PNumberLiteral0 = "0" extends `${infer T extends 0 | bigint}` ? T : never; // 0 + +// number-literal > bigint-literal +type PNumberLiteral1 = "0" extends `${infer T extends 0 | 0n}` ? T : never; // 0 +// #endregion number-literal + +// #region number-literal-enum +// number-literal-enum > bigint +type PNumberLiteralEnum0 = "0" extends `${infer T extends NumberLiteralEnum | bigint}` ? T : never; // NumberLiteralEnum.Zero + +// number-literal-enum > bigint-literal +type PNumberLiteralEnum1 = "0" extends `${infer T extends NumberLiteralEnum | 0n}` ? T : never; // NumberLiteralEnum.Zero +// #endregion number-literal-enum + +// non-matchable constituents are excluded +type PExclude0 = "0" extends `${infer T extends "1" | number}` ? T : never; // 0 +type PExclude1 = "0" extends `${infer T extends `1${string}` | number}` ? T : never; // 0 +type PExclude2 = "0" extends `${infer T extends 1 | bigint}` ? T : never; // 0n +type PExclude3 = "0" extends `${infer T extends NumberLiteralEnum.One | bigint}` ? T : never; // 0n +type PExclude4 = "100000000000000000000000" extends `${infer T extends number | bigint}` ? T : never; // 100000000000000000000000n + +// infer to prefix from string +type TPrefix0 = "100" extends `${infer T extends number}${string}` ? T : never; // 1 +type TPrefix1 = "trueabc" extends `${infer T extends boolean}${string}` ? T : never; // boolean (T only receives 't', not the whole string) +type TPrefix2 = `100:${string}` extends `${infer T extends number}:${string}` ? T : never; // 100 (T receives '100' because it scans until ':') + +// can use union w/multiple branches to extract each possibility +type ExtractPrimitives = + | T + | (T extends `${infer U extends number}` ? U : never) + | (T extends `${infer U extends bigint}` ? U : never) + | (T extends `${infer U extends boolean | null | undefined}` ? U : never) + ; + +type TExtract0 = ExtractPrimitives<"100">; // "100" | 100 | 100n +type TExtract1 = ExtractPrimitives<"1.1">; // "1.1" | 1.1 +type TExtract2 = ExtractPrimitives<"true">; // "true" | true + + + +// example use case (based on old TypedObjects proposal): + +// Use constrained `infer` in template literal to get ordinal indices as numbers: +type IndexFor = S extends `${infer N extends number}` ? N : never; +type IndicesOf = IndexFor>; // ordinal indices as number literals + +interface FieldDefinition { + readonly name: string; + readonly type: "i8" | "i16" | "i32" | "i64" | "u8" | "u16" | "u32" | "u64" | "f32" | "f64"; +} + +type FieldType = + T extends "i8" | "i16" | "i32" | "u8" | "u16" | "u32" | "f32" | "f64" ? number : + T extends "f32" | "f64" ? bigint : + never; + +// Generates named members like `{ x: number, y: bigint }` from `[{ name: "x", type: "i32" }, { name: "y", type: "i64" }]` +type TypedObjectNamedMembers = { + [P in TDef[number]["name"]]: FieldType["type"]>; +}; + +// Generates ordinal members like `{ 0: number, 1: bigint }` from `[{ name: "x", type: "i32" }, { name: "y", type: "i64" }]` +type TypedObjectOrdinalMembers = { + [I in Extract]: FieldType["type"]>; +}; + +// Default members +interface TypedObjectMembers { + // get/set a field by name + get(key: K): FieldType["type"]>; + set(key: K, value: FieldType["type"]>): void; + + // get/set a field by index + getIndex>(index: I): FieldType["type"]>; + setIndex>(index: I, value: FieldType["type"]>): void; +} + +type TypedObject = + & TypedObjectMembers + & TypedObjectNamedMembers + & TypedObjectOrdinalMembers; + +// NOTE: type would normally be created from something like `const Point = TypedObject([...])` from which we would infer the type +type Point = TypedObject<[ + { name: "x", type: "f64" }, + { name: "y", type: "f64" }, +]>; + +declare const p: Point; +p.getIndex(0); // ok, 0 is a valid index +p.getIndex(1); // ok, 1 is a valid index +p.getIndex(2); // error, 2 is not a valid index + +p.setIndex(0, 0); // ok, 0 is a valid index +p.setIndex(1, 0); // ok, 1 is a valid index +p.setIndex(2, 3); // error, 2 is not a valid index + +// function inference +declare function f1(s: `**${T}**`): T; +f1("**123**"); // "123" + +declare function f2(s: `**${T}**`): T; +f2("**123**"); // 123 + +declare function f3(s: `**${T}**`): T; +f3("**123**"); // 123n + +declare function f4(s: `**${T}**`): T; +f4("**true**"); // true | "true" +f4("**false**"); // false | "false" diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperations.ts b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperations.ts index a22c9799e19..461a55b59f1 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperations.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperations.ts @@ -1,4 +1,4 @@ -var a = 1 + `${ 3 }`; +var a = 1 + `${ 3 }`; var b = 1 + `2${ 3 }`; var c = 1 + `${ 3 }4`; var d = 1 + `2${ 3 }4`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6.ts index 33742529189..fd9b7f2b929 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var a = 1 + `${ 3 }`; var b = 1 + `2${ 3 }`; var c = 1 + `${ 3 }4`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6Invalid.ts b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6Invalid.ts index a5169678aeb..330e2abef00 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6Invalid.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsES6Invalid.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var a = 1 - `${ 3 }`; var b = 1 - `2${ 3 }`; var c = 1 - `${ 3 }4`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsInvalid.ts b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsInvalid.ts index 0986b6d969d..91d0b3dcc7d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsInvalid.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringBinaryOperationsInvalid.ts @@ -1,4 +1,4 @@ -var a = 1 - `${ 3 }`; +var a = 1 - `${ 3 }`; var b = 1 - `2${ 3 }`; var c = 1 - `${ 3 }4`; var d = 1 - `2${ 3 }4`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01.ts index 7f1d4ccda18..16e4abdfdfe 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01.ts @@ -1,3 +1,3 @@ - + var x = `\0\x00\u0000 0 00 0000`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01_ES6.ts index d96c09074e3..db9e438311c 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes01_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\0\x00\u0000 0 00 0000`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02.ts index 652c509349c..057eed4e89d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02.ts @@ -1,3 +1,3 @@ - + var x = `\x19\u0019 19`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02_ES6.ts index 526b8b1ba98..04996809621 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\x19\u0019 19`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03.ts index ff1bd03270b..78731fb79d1 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03.ts @@ -1,3 +1,3 @@ - + var x = `\x1F\u001f 1F 1f`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03_ES6.ts index e5591e1c45c..357662ebea2 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes03_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\x1F\u001f 1F 1f`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04.ts index 31d0c30e3f0..6ef41ff74c1 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04.ts @@ -1,3 +1,3 @@ - + var x = `\x20\u0020 20`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04_ES6.ts index bec13580573..a76f3898796 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringControlCharacterEscapes04_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\x20\u0020 20`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInArray.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInArray.ts index b3272bfff3f..2d2e5e323b5 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInArray.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInArray.ts @@ -1 +1 @@ -var x = [1, 2, `abc${ 123 }def`]; \ No newline at end of file +var x = [1, 2, `abc${ 123 }def`]; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunction.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunction.ts index 1da62969b84..9820edb2ac3 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunction.ts @@ -1 +1 @@ -var x = x => `abc${ x }def`; \ No newline at end of file +var x = x => `abc${ x }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunctionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunctionES6.ts index 25f9fe73268..32f00bd5aec 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunctionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInArrowFunctionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = x => `abc${ x }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpression.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpression.ts index 5b4fd595760..04597a4c120 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpression.ts @@ -1 +1 @@ -`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpressionES6.ts index f29390e9cdc..f47daa7af34 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInCallExpressionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInConditional.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInConditional.ts index 86bce041d6d..aff80b60efc 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInConditional.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInConditional.ts @@ -1 +1 @@ -var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; \ No newline at end of file +var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInConditionalES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInConditionalES6.ts index 070bf37c4bb..eccc52539b0 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInConditionalES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInConditionalES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpression.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpression.ts index 62790939c10..f3af01582a5 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpression.ts @@ -1 +1 @@ -delete `abc${0}abc`; \ No newline at end of file +delete `abc${0}abc`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpressionES6.ts index 1362cbf7cfe..863acbe8837 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInDeleteExpressionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 delete `abc${0}abc`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInDivision.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInDivision.ts index 4f2bd7bf37d..9650f5e2455 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInDivision.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInDivision.ts @@ -1 +1 @@ -var x = `abc${ 1 }def` / 1; \ No newline at end of file +var x = `abc${ 1 }def` / 1; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecks.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecks.ts index 4ce451fbf93..6cd20ab1d01 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecks.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecks.ts @@ -1,4 +1,4 @@ -var x = `abc${0}abc` === `abc` || +var x = `abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecksES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecksES6.ts index 2c09b7ef8dd..3b55db44b1a 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecksES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInEqualityChecksES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var x = `abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInInOperator.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInInOperator.ts index 02be9e2603b..cc50b275144 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInInOperator.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInInOperator.ts @@ -1 +1 @@ -var x = `${ "hi" }` in { hi: 10, hello: 20}; \ No newline at end of file +var x = `${ "hi" }` in { hi: 10, hello: 20}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInInOperatorES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInInOperatorES6.ts index 03b3fcf3f6d..68c6dbb8c38 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInInOperatorES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInInOperatorES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `${ "hi" }` in { hi: 10, hello: 20}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpression.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpression.ts index 2b48179e63b..792e92a4dc7 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpression.ts @@ -1 +1 @@ -`abc${0}abc`[`0`]; \ No newline at end of file +`abc${0}abc`[`0`]; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpressionES6.ts index e500d5647a4..9dbe42f403d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInIndexExpressionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `abc${0}abc`[`0`]; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOf.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOf.ts index 0ca4bd08574..12ec4e7baf7 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOf.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOf.ts @@ -1 +1 @@ -var x = `abc${ 0 }def` instanceof String; \ No newline at end of file +var x = `abc${ 0 }def` instanceof String; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOfES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOfES6.ts index b87376a50f4..cf6ef1f2f38 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOfES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInInstanceOfES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 0 }def` instanceof String; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInModulo.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInModulo.ts index 8b6dd8da243..69d7faeda75 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInModulo.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInModulo.ts @@ -1 +1 @@ -var x = 1 % `abc${ 1 }def`; \ No newline at end of file +var x = 1 % `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInModuloES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInModuloES6.ts index 9532fdd834e..6622ca01a3f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInModuloES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInModuloES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = 1 % `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplication.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplication.ts index 45f6e98c32d..a8ba70bf102 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplication.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplication.ts @@ -1 +1 @@ -var x = 1 * `abc${ 1 }def`; \ No newline at end of file +var x = 1 * `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplicationES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplicationES6.ts index 7fd6c4aa4da..0f4d9dddd3f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplicationES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInMultiplicationES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = 1 * `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpression.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpression.ts index a839e29aaff..cac8571553f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpression.ts @@ -1 +1 @@ -new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpressionES6.ts index 312f9dbe85e..2e31877ad53 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInNewExpressionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperator.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperator.ts index 056dc8c97ca..f53dd3023d2 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperator.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperator.ts @@ -1 +1 @@ -var x = new `abc${ 1 }def`; \ No newline at end of file +var x = new `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperatorES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperatorES6.ts index 9cc113fdfc2..bf1874a477f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperatorES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInNewOperatorES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = new `abc${ 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInParentheses.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInParentheses.ts index bd75521f7cf..de5948e2bc2 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInParentheses.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInParentheses.ts @@ -1 +1 @@ -var x = (`abc${0}abc`); \ No newline at end of file +var x = (`abc${0}abc`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInParenthesesES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInParenthesesES6.ts index 2c296ab6cb0..bdb37c9ef0d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInParenthesesES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInParenthesesES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = (`abc${0}abc`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignment.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignment.ts index b8924da27b8..934e90fffff 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignment.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignment.ts @@ -1,3 +1,3 @@ -var x = { +var x = { a: `abc${ 123 }def${ 456 }ghi` } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignmentES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignmentES6.ts index dae8d6fb237..7d1e3e57ee9 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignmentES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInPropertyAssignmentES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var x = { a: `abc${ 123 }def${ 456 }ghi` } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCase.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCase.ts index 1684bb13dd0..aca5f06d4e9 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCase.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCase.ts @@ -1,4 +1,4 @@ -switch (`abc${0}abc`) { +switch (`abc${0}abc`) { case `abc`: case `123`: case `abc${0}abc`: diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCaseES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCaseES6.ts index 6a8a09f889f..02b8fd919a0 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCaseES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInSwitchAndCaseES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 switch (`abc${0}abc`) { case `abc`: case `123`: diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplate.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplate.ts index 7ef48a541ca..79a0d770bee 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplate.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplate.ts @@ -1 +1 @@ -`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` \ No newline at end of file +`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplateES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplateES6.ts index d171c5fa3f8..06a49bbe8a4 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplateES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTaggedTemplateES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertion.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertion.ts index c7d66ee0a4a..b5a29156f56 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertion.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertion.ts @@ -1 +1 @@ -var x = `abc${ 123 }def`; \ No newline at end of file +var x = `abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertionES6.ts index 011f71a3597..3829f850490 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeAssertionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOf.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOf.ts index 2141e94badb..da69e86c0b7 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOf.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOf.ts @@ -1 +1 @@ -var x = typeof `abc${ 123 }def`; \ No newline at end of file +var x = typeof `abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOfES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOfES6.ts index c5ab50f83be..beb86027bce 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOfES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInTypeOfES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = typeof `abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlus.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlus.ts index 2c40532e67f..3f9b667d51d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlus.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlus.ts @@ -1 +1 @@ -var x = +`abc${ 123 }def`; \ No newline at end of file +var x = +`abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlusES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlusES6.ts index 9a3345f3516..353030d9d09 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlusES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInUnaryPlusES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = +`abc${ 123 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInWhile.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInWhile.ts index e32cd36747e..3655b9e329d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInWhile.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInWhile.ts @@ -1,3 +1,3 @@ -while (`abc${0}abc`) { +while (`abc${0}abc`) { `def${1}def`; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInWhileES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInWhileES6.ts index b489bfe4822..c39359b97c5 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInWhileES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInWhileES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 while (`abc${0}abc`) { `def${1}def`; } \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringInYieldKeyword.ts b/crates/swc_ecma_parser/tests/tsc/templateStringInYieldKeyword.ts index c1e0a886ed3..d2307545ce2 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringInYieldKeyword.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringInYieldKeyword.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 function* gen() { // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1.ts index 0e331127420..6ee4f9a1e59 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1.ts @@ -1,4 +1,4 @@ - + // newlines are ` diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1_ES6.ts index 98df5062137..092fe37db61 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline1_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 // newlines are ` diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2.ts index 1fe50b41b8e..1de31c36175 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2.ts @@ -1,4 +1,4 @@ - + // newlines are ` diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2_ES6.ts index 8faaf498abb..69be653d938 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline2_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 // newlines are ` diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.json b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.json index f467151e7d0..e6ebc6ba5b0 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.json +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.json @@ -1,41 +1,10 @@ { "type": "Script", "span": { - "start": 24, - "end": 29, + "start": 1, + "end": 1, "ctxt": 0 }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 24, - "end": 29, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 24, - "end": 29, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 25, - "end": 28, - "ctxt": 0 - }, - "tail": true, - "cooked": "\n", - "raw": "\n\\\r" - } - ] - } - } - ], + "body": [], "interpreter": null } diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.ts index bcf8f63a700..045d5995ccd 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3.ts @@ -1 +1 @@ - // newlines are ` \ ` \ No newline at end of file +// newlines are `\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.json b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.json index a6887797b9c..e6ebc6ba5b0 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.json +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.json @@ -1,41 +1,10 @@ { "type": "Script", "span": { - "start": 38, - "end": 43, + "start": 1, + "end": 1, "ctxt": 0 }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 38, - "end": 43, - "ctxt": 0 - }, - "expression": { - "type": "TemplateLiteral", - "span": { - "start": 38, - "end": 43, - "ctxt": 0 - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "span": { - "start": 39, - "end": 42, - "ctxt": 0 - }, - "tail": true, - "cooked": "\n", - "raw": "\n\\\r" - } - ] - } - } - ], + "body": [], "interpreter": null } diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.ts index 6d173fccbf6..739dafbf098 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringMultiline3_ES6.ts @@ -1 +1 @@ -//@target: es6 // newlines are ` \ ` \ No newline at end of file +//@target: es6// newlines are `\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01.ts b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01.ts index 24b6850cd9e..606083c0f1f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01.ts @@ -1,2 +1,2 @@ - + `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.ts index c5cf0241415..2d7ab242cac 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes01_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 `0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02.ts b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02.ts index 372f976b875..78cc08b941c 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02.ts @@ -1,3 +1,3 @@ - + `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.ts index a8b702ce65a..c46a14ede55 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination1.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination1.ts index 51c959289eb..ac732d607af 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination1.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination1.ts @@ -1,2 +1,2 @@ - + `` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination1_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination1_ES6.ts index e127e2c34fb..2703430ac23 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination1_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination1_ES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination2.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination2.ts index 6291eadbb20..4fba1c727c6 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination2.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination2.ts @@ -1,2 +1,2 @@ - + `\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination2_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination2_ES6.ts index 26baad0be70..6d294bb2652 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination2_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination2_ES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination3.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination3.ts index e338e82be90..39c54393549 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination3.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination3.ts @@ -1,2 +1,2 @@ - + `\`` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination3_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination3_ES6.ts index 237473bc676..c2727d6d72c 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination3_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination3_ES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `\`` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination4.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination4.ts index 190f2cff669..69f458b4b62 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination4.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination4.ts @@ -1,2 +1,2 @@ - + `\\\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination4_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination4_ES6.ts index 0463db633ed..1545f03acc7 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination4_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination4_ES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `\\\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination5.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination5.ts index 1af1583698b..f5362a055bc 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination5.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination5.ts @@ -1,2 +1,2 @@ - + `\\\\\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringTermination5_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringTermination5_ES6.ts index 450bbdacb3d..989e3585610 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringTermination5_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringTermination5_ES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `\\\\\\` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1.ts index 3e26dd2b392..b3e6ed1805e 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1.ts @@ -1,3 +1,3 @@ - + `\t\n\v\f\r`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1_ES6.ts index 4fabb3868b2..17179d6d20c 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes1_ES6.ts @@ -1,3 +1,3 @@ -//@target: es6 +//@target: es6 `\t\n\v\f\r`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2.ts index 15f9767ae4e..56d226ab002 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2.ts @@ -1,4 +1,4 @@ - + // , , , , , `\u0009\u000B\u000C\u0020\u00A0\uFEFF`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2_ES6.ts index fd037795a58..2d2a7b3bc36 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWhitespaceEscapes2_ES6.ts @@ -1,4 +1,4 @@ -//@target: es6 +//@target: es6 // , , , , , `\u0009\u000B\u000C\u0020\u00A0\uFEFF`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01.ts index 131e8a1988a..de2d4119d68 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01.ts @@ -1,4 +1,4 @@ - + var a = `hello\world`; var b = `hello\\world`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01_ES6.ts index 11cb2d4c54f..316d256b96b 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithBackslashEscapes01_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 var a = `hello\world`; var b = `hello\\world`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithCommentsInArrowFunction.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithCommentsInArrowFunction.ts index fceb3651aab..c6326e68468 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithCommentsInArrowFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithCommentsInArrowFunction.ts @@ -1,4 +1,4 @@ -// @removeComments: false +// @removeComments: false const a = 1; const f1 = () => diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAddition.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAddition.ts index 15a0842c483..73f9c6b6b84 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAddition.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAddition.ts @@ -1 +1 @@ -var x = `abc${ 10 + 10 }def`; \ No newline at end of file +var x = `abc${ 10 + 10 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAdditionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAdditionES6.ts index 25adebc085e..fbaeb336409 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAdditionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedAdditionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 10 + 10 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArray.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArray.ts index 26d9703ca19..77ea762070b 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArray.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArray.ts @@ -1 +1 @@ -var x = `abc${ [1,2,3] }def`; \ No newline at end of file +var x = `abc${ [1,2,3] }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrayES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrayES6.ts index 5b4c7d6cc7a..72739a3df1a 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrayES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrayES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ [1,2,3] }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunction.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunction.ts index 11532c877d9..8d879732c79 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunction.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunction.ts @@ -1 +1 @@ -var x = `abc${ x => x }def`; \ No newline at end of file +var x = `abc${ x => x }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunctionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunctionES6.ts index a9d5b9a1074..5a588a877de 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunctionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedArrowFunctionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ x => x }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedComments.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedComments.ts index f7e8d84cd6b..72ddc3f8904 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedComments.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedComments.ts @@ -1,4 +1,4 @@ -`head${ // single line comment +`head${ // single line comment 10 } middle${ diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedCommentsES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedCommentsES6.ts index eea2da1cb9b..f2668071b62 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedCommentsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedCommentsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 `head${ // single line comment 10 } diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditional.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditional.ts index 4f551a57e97..6c70bbc9b04 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditional.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditional.ts @@ -1 +1 @@ -var x = `abc${ true ? false : " " }def`; \ No newline at end of file +var x = `abc${ true ? false : " " }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditionalES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditionalES6.ts index 2d68d3bd961..89c2ec1e4ad 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditionalES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedConditionalES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ true ? false : " " }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivision.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivision.ts index ba923ddb935..82ea537dc13 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivision.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivision.ts @@ -1 +1 @@ -var x = `abc${ 1 / 1 }def`; \ No newline at end of file +var x = `abc${ 1 / 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivisionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivisionES6.ts index f09a2ef7205..d99e05eff1a 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivisionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedDivisionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 1 / 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperator.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperator.ts index 4c39942e911..0e823e0ee11 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperator.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperator.ts @@ -1 +1 @@ -var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; \ No newline at end of file +var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperatorES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperatorES6.ts index 57d87c5ec6e..9d3ac63abfc 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperatorES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInOperatorES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOf.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOf.ts index 037599d94ff..b8cd9ba5740 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOf.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOf.ts @@ -1 +1 @@ -var x = `abc${ "hello" instanceof String }def`; \ No newline at end of file +var x = `abc${ "hello" instanceof String }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOfES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOfES6.ts index 61a72fa4160..6277b33f3ae 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOfES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedInstanceOfES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ "hello" instanceof String }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModulo.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModulo.ts index cfabdebbb12..675627cb25d 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModulo.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModulo.ts @@ -1 +1 @@ -var x = `abc${ 1 % 1 }def`; \ No newline at end of file +var x = `abc${ 1 % 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModuloES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModuloES6.ts index 7eb4858e28f..ae4c63951a2 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModuloES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedModuloES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 1 % 1 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplication.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplication.ts index 750760fcb38..09a99646fc8 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplication.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplication.ts @@ -1 +1 @@ -var x = `abc${ 7 * 6 }def`; \ No newline at end of file +var x = `abc${ 7 * 6 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplicationES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplicationES6.ts index c339235fdfd..eb547ed5751 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplicationES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedMultiplicationES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ 7 * 6 }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperator.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperator.ts index 42949021a92..0f2652f892b 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperator.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperator.ts @@ -1 +1 @@ -var x = `abc${ new String("Hi") }def`; \ No newline at end of file +var x = `abc${ new String("Hi") }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperatorES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperatorES6.ts index 2e55ec40129..5e775fef1e5 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperatorES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedNewOperatorES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ new String("Hi") }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteral.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteral.ts index 0a011c1a800..bfdbb3d6a34 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteral.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteral.ts @@ -1 +1 @@ -var x = `abc${ { x: 10, y: 20 } }def`; \ No newline at end of file +var x = `abc${ { x: 10, y: 20 } }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteralES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteralES6.ts index 0ad22f7f977..3f45f934dc4 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteralES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedObjectLiteralES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ { x: 10, y: 20 } }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateString.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateString.ts index d490f4dc270..4fc2778aa4f 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateString.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateString.ts @@ -1 +1 @@ -var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; \ No newline at end of file +var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateStringES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateStringES6.ts index 26de27540b9..82c06e17a38 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateStringES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTemplateStringES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAddition.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAddition.ts index 6b9115d7f3f..90a0e3561a3 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAddition.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAddition.ts @@ -1 +1 @@ -var x = `abc${ (10 + 10) }def`; \ No newline at end of file +var x = `abc${ (10 + 10) }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts index d85546d41df..05657c761cb 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ (10 + 10) }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperator.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperator.ts index c9c991d22d8..1a93e586bda 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperator.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperator.ts @@ -1 +1 @@ -var x = `abc${ typeof "hi" }def`; \ No newline at end of file +var x = `abc${ typeof "hi" }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperatorES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperatorES6.ts index 1c39e02b36c..72d10a9d8bc 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperatorES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedTypeOfOperatorES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ typeof "hi" }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlus.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlus.ts index d1859ed6f43..f97583812e4 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlus.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlus.ts @@ -1 +1 @@ -var x = `abc${ +Infinity }def`; \ No newline at end of file +var x = `abc${ +Infinity }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlusES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlusES6.ts index 78a1591835b..85e6d6a8adb 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlusES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedUnaryPlusES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 var x = `abc${ +Infinity }def`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedYieldKeywordES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedYieldKeywordES6.ts index 25728227a81..c5315731d63 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedYieldKeywordES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmbeddedYieldKeywordES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 function* gen() { // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortions.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortions.ts index 9a7124fbc93..57922d96d72 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortions.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortions.ts @@ -1,4 +1,4 @@ -var a = ``; +var a = ``; var b = `${ 0 }`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortionsES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortionsES6.ts index 5dfbe68d896..46da8a9f935 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortionsES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithEmptyLiteralPortionsES6.ts @@ -1,4 +1,4 @@ -// @target: ES6 +// @target: ES6 var a = ``; var b = `${ 0 }`; diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortion.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortion.ts index 28f946b019a..9101c8e3e6b 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortion.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortion.ts @@ -1 +1 @@ -` /**head ${ 10 } // still middle ${ 20 } /* still tail ` \ No newline at end of file +` /**head ${ 10 } // still middle ${ 20 } /* still tail ` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortionES6.ts index 4a2a578ebaf..6a166146097 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithOpenCommentInStringPortionES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccess.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccess.ts index 3e35b9fc56f..87682fff572 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccess.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccess.ts @@ -1 +1 @@ -`abc${0}abc`.indexOf(`abc`); \ No newline at end of file +`abc${0}abc`.indexOf(`abc`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccessES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccessES6.ts index 1a564b525f2..17c33dd6d72 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccessES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringWithPropertyAccessES6.ts @@ -1,2 +1,2 @@ -// @target: ES6 +// @target: ES6 `abc${0}abc`.indexOf(`abc`); \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts b/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts index 67ff35d45c0..e8bcf4756d1 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts @@ -1,3 +1,3 @@ - + `${function (x: number) { x = "bad"; } }`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts b/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts index a29197687d2..1375da48233 100644 --- a/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts @@ -1,3 +1,3 @@ -//@target: es6 +//@target: es6 `${function (x: number) { x = "bad"; } }`; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.json b/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.json deleted file mode 100644 index b14e0e9c68e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.json +++ /dev/null @@ -1,749 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 815, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 19, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 26, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 37, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 44, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 44, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 59, - "end": 81, - "ctxt": 0 - }, - "value": "ClassWithNoInitializer", - "optional": false - }, - "declare": false, - "span": { - "start": 53, - "end": 205, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 109, - "end": 111, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 109, - "end": 110, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 152, - "end": 203, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 152, - "end": 163, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 166, - "end": 203, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 176, - "end": 188, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 176, - "end": 187, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 182, - "end": 186, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 90, - "end": 102, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 213, - "end": 233, - "ctxt": 0 - }, - "value": "ClassWithInitializer", - "optional": false - }, - "declare": false, - "span": { - "start": 207, - "end": 361, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 261, - "end": 267, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 265, - "end": 266, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 308, - "end": 359, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 308, - "end": 319, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 322, - "end": 359, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 332, - "end": 344, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 332, - "end": 343, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 332, - "end": 337, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 338, - "end": 342, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 242, - "end": 254, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 363, - "end": 434, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 372, - "end": 434, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 410, - "end": 423, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 414, - "end": 415, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ThisExpression", - "span": { - "start": 418, - "end": 422, - "ctxt": 0 - } - }, - "definite": false - } - ] - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 559, - "end": 570, - "ctxt": 0 - }, - "value": "genericFunc", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 574, - "end": 578, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 574, - "end": 578, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 575, - "end": 578, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 577, - "end": 578, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 577, - "end": 578, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 550, - "end": 583, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 580, - "end": 583, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 570, - "end": 573, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 571, - "end": 572, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 572, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 584, - "end": 613, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 584, - "end": 612, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 584, - "end": 595, - "ctxt": 0 - }, - "value": "genericFunc", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 602, - "end": 611, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 595, - "end": 601, - "ctxt": 0 - }, - "params": [ - { - "type": "TsThisType", - "span": { - "start": 596, - "end": 600, - "ctxt": 0 - } - } - ] - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 644, - "end": 653, - "ctxt": 0 - }, - "value": "ErrClass3", - "optional": false - }, - "declare": false, - "span": { - "start": 638, - "end": 671, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "ThisExpression", - "span": { - "start": 662, - "end": 666, - "ctxt": 0 - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsEnumDeclaration", - "span": { - "start": 707, - "end": 815, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 712, - "end": 720, - "ctxt": 0 - }, - "value": "SomeEnum", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 727, - "end": 735, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 727, - "end": 728, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "init": { - "type": "ThisExpression", - "span": { - "start": 731, - "end": 735, - "ctxt": 0 - } - } - }, - { - "type": "TsEnumMember", - "span": { - "start": 766, - "end": 783, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 766, - "end": 767, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 770, - "end": 783, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 770, - "end": 774, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 775, - "end": 783, - "ctxt": 0 - }, - "value": "spaaaace", - "optional": false - } - } - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.ts b/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.ts deleted file mode 100644 index 6c9acb62e91..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContexts.ts +++ /dev/null @@ -1,42 +0,0 @@ -class BaseErrClass { - constructor(t: any) { } -} - -class ClassWithNoInitializer extends BaseErrClass { - t; - //'this' in optional super call - constructor() { - super(this); // Error - } -} - -class ClassWithInitializer extends BaseErrClass { - t = 4; - //'this' in required super call - constructor() { - super(this); // Error - } -} - -module M { - //'this' in module variable - var x = this; // Error -} - -//'this' as type parameter constraint -// function fn() { } // Error - -//'this' as a type argument -function genericFunc(x: T) { } -genericFunc(undefined); // Should be an error - -class ErrClass3 extends this { - -} - -//'this' as a computed enum value -enum SomeEnum { - A = this, // Should not be allowed - B = this.spaaaace // Also should not be allowed -} - diff --git a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.json b/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.json deleted file mode 100644 index ff7f2c26d5f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.json +++ /dev/null @@ -1,765 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 1, - "end": 881, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 7, - "end": 19, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "declare": false, - "span": { - "start": 1, - "end": 51, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 26, - "end": 49, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 26, - "end": 37, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 44, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 41, - "end": 44, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 46, - "end": 49, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 59, - "end": 81, - "ctxt": 0 - }, - "value": "ClassWithNoInitializer", - "optional": false - }, - "declare": false, - "span": { - "start": 53, - "end": 255, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 109, - "end": 111, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 109, - "end": 110, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "value": null, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 152, - "end": 253, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 152, - "end": 163, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 166, - "end": 253, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 176, - "end": 188, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 176, - "end": 187, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 182, - "end": 186, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 90, - "end": 102, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 263, - "end": 283, - "ctxt": 0 - }, - "value": "ClassWithInitializer", - "optional": false - }, - "declare": false, - "span": { - "start": 257, - "end": 411, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 311, - "end": 317, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 315, - "end": 316, - "ctxt": 0 - }, - "value": 4.0, - "raw": "4" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 358, - "end": 409, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 358, - "end": 369, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 372, - "end": 409, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 382, - "end": 394, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 382, - "end": 393, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 382, - "end": 387, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ThisExpression", - "span": { - "start": 388, - "end": 392, - "ctxt": 0 - } - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 292, - "end": 304, - "ctxt": 0 - }, - "value": "BaseErrClass", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 413, - "end": 484, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 420, - "end": 421, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 422, - "end": 484, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 460, - "end": 473, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 464, - "end": 472, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ThisExpression", - "span": { - "start": 468, - "end": 472, - "ctxt": 0 - } - }, - "definite": false - } - ] - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 609, - "end": 620, - "ctxt": 0 - }, - "value": "genericFunc", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 624, - "end": 628, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 624, - "end": 628, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 625, - "end": 628, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 627, - "end": 628, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 627, - "end": 628, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 600, - "end": 633, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 630, - "end": 633, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 620, - "end": 623, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 621, - "end": 622, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 621, - "end": 622, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 634, - "end": 663, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 634, - "end": 662, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 634, - "end": 645, - "ctxt": 0 - }, - "value": "genericFunc", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 652, - "end": 661, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ], - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 645, - "end": 651, - "ctxt": 0 - }, - "params": [ - { - "type": "TsThisType", - "span": { - "start": 646, - "end": 650, - "ctxt": 0 - } - } - ] - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 694, - "end": 703, - "ctxt": 0 - }, - "value": "ErrClass3", - "optional": false - }, - "declare": false, - "span": { - "start": 688, - "end": 721, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "ThisExpression", - "span": { - "start": 712, - "end": 716, - "ctxt": 0 - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsEnumDeclaration", - "span": { - "start": 757, - "end": 865, - "ctxt": 0 - }, - "declare": false, - "isConst": false, - "id": { - "type": "Identifier", - "span": { - "start": 762, - "end": 770, - "ctxt": 0 - }, - "value": "SomeEnum", - "optional": false - }, - "members": [ - { - "type": "TsEnumMember", - "span": { - "start": 777, - "end": 785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 777, - "end": 778, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "init": { - "type": "ThisExpression", - "span": { - "start": 781, - "end": 785, - "ctxt": 0 - } - } - }, - { - "type": "TsEnumMember", - "span": { - "start": 816, - "end": 833, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 816, - "end": 817, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 820, - "end": 833, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 820, - "end": 824, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 825, - "end": 833, - "ctxt": 0 - }, - "value": "spaaaace", - "optional": false - } - } - } - ] - }, - { - "type": "TsExportAssignment", - "span": { - "start": 867, - "end": 881, - "ctxt": 0 - }, - "expression": { - "type": "ThisExpression", - "span": { - "start": 876, - "end": 880, - "ctxt": 0 - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.ts b/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.ts deleted file mode 100644 index 5c19d1e0958..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/thisInInvalidContextsExternalModule.ts +++ /dev/null @@ -1,43 +0,0 @@ -class BaseErrClass { - constructor(t: any) { } -} - -class ClassWithNoInitializer extends BaseErrClass { - t; - //'this' in optional super call - constructor() { - super(this); // error: "super" has to be called before "this" accessing - } -} - -class ClassWithInitializer extends BaseErrClass { - t = 4; - //'this' in required super call - constructor() { - super(this); // Error - } -} - -module M { - //'this' in module variable - var x = this; // Error -} - -//'this' as type parameter constraint -// function fn() { } // Error - -//'this' as a type argument -function genericFunc(x: T) { } -genericFunc(undefined); // Should be an error - -class ErrClass3 extends this { - -} - -//'this' as a computed enum value -enum SomeEnum { - A = this, // Should not be allowed - B = this.spaaaace // Also should not be allowed -} - -export = this; // Should be an error \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.json b/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.json deleted file mode 100644 index 76c7fba48e6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.json +++ /dev/null @@ -1,699 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 206, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1, - "end": 20, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 7, - "end": 19, - "ctxt": 0 - }, - "id": { - "type": "ArrayPattern", - "span": { - "start": 7, - "end": 14, - "ctxt": 0 - }, - "elements": [ - { - "type": "RestElement", - "span": { - "start": 8, - "end": 12, - "ctxt": 0 - }, - "rest": { - "start": 8, - "end": 11, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 11, - "end": 12, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrayExpression", - "span": { - "start": 17, - "end": 19, - "ctxt": 0 - }, - "elements": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 21, - "end": 40, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 27, - "end": 39, - "ctxt": 0 - }, - "id": { - "type": "ObjectPattern", - "span": { - "start": 27, - "end": 34, - "ctxt": 0 - }, - "properties": [ - { - "type": "RestElement", - "span": { - "start": 28, - "end": 32, - "ctxt": 0 - }, - "rest": { - "start": 28, - "end": 31, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 37, - "end": 39, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 51, - "end": 66, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 51, - "end": 65, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 52, - "end": 64, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "ArrayPattern", - "span": { - "start": 52, - "end": 59, - "ctxt": 0 - }, - "elements": [ - { - "type": "RestElement", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "rest": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 56, - "end": 57, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ArrayExpression", - "span": { - "start": 62, - "end": 64, - "ctxt": 0 - }, - "elements": [] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 67, - "end": 82, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 67, - "end": 81, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 68, - "end": 80, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "ObjectPattern", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "properties": [ - { - "type": "RestElement", - "span": { - "start": 69, - "end": 73, - "ctxt": 0 - }, - "rest": { - "start": 69, - "end": 72, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 72, - "end": 73, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "ObjectExpression", - "span": { - "start": 78, - "end": 80, - "ctxt": 0 - }, - "properties": [] - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 117, - "end": 138, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 123, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "ArrayPattern", - "span": { - "start": 123, - "end": 127, - "ctxt": 0 - }, - "elements": [ - { - "type": "Identifier", - "span": { - "start": 124, - "end": 125, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsTypeAssertion", - "span": { - "start": 130, - "end": 137, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 135, - "end": 137, - "ctxt": 0 - }, - "elements": [] - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 131, - "end": 134, - "ctxt": 0 - }, - "kind": "any" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 139, - "end": 160, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 145, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "ObjectPattern", - "span": { - "start": 145, - "end": 149, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsTypeAssertion", - "span": { - "start": 152, - "end": 159, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 157, - "end": 159, - "ctxt": 0 - }, - "properties": [] - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 153, - "end": 156, - "ctxt": 0 - }, - "kind": "any" - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 161, - "end": 170, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "h", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 171, - "end": 188, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 171, - "end": 187, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 172, - "end": 186, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "ArrayPattern", - "span": { - "start": 172, - "end": 176, - "ctxt": 0 - }, - "elements": [ - { - "type": "Identifier", - "span": { - "start": 173, - "end": 174, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsTypeAssertion", - "span": { - "start": 179, - "end": 186, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 184, - "end": 186, - "ctxt": 0 - }, - "elements": [] - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 189, - "end": 206, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 189, - "end": 205, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 190, - "end": 204, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "ObjectPattern", - "span": { - "start": 190, - "end": 194, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "h", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "right": { - "type": "TsTypeAssertion", - "span": { - "start": 197, - "end": 204, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 202, - "end": 204, - "ctxt": 0 - }, - "properties": [] - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.ts b/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.ts deleted file mode 100644 index 6323111b04d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/trailingCommasInBindingPatterns.ts +++ /dev/null @@ -1,12 +0,0 @@ -const [...a,] = []; -const {...b,} = {}; -let c, d; -([...c,] = []); -({...d,} = {}); - -// Allowed for non-rest elements -const [e,] = []; -const {f,} = {}; -let g, h; -([g,] = []); -({h,} = {}); diff --git a/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.json b/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.json deleted file mode 100644 index 1716ef9999d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.json +++ /dev/null @@ -1,840 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 472, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 27, - "end": 29, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 30, - "end": 31, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 18, - "end": 36, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 34, - "end": 36, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 38, - "end": 45, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 38, - "end": 44, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 38, - "end": 40, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 41, - "end": 42, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 56, - "end": 58, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 59, - "end": 66, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 59, - "end": 66, - "ctxt": 0 - }, - "rest": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 62, - "end": 66, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 47, - "end": 71, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 69, - "end": 71, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "value": "f25", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 130, - "end": 137, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 130, - "end": 137, - "ctxt": 0 - }, - "rest": { - "start": 130, - "end": 133, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 133, - "end": 137, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 109, - "end": 146, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 139, - "end": 145, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 141, - "end": 145, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 148, - "end": 159, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 148, - "end": 150, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "arguments": [ - { - "spread": { - "start": 151, - "end": 154, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 154, - "end": 156, - "ctxt": 0 - }, - "elements": [] - } - } - ], - "typeArguments": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 209, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 190, - "end": 223, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 241, - "end": 243, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - }, - { - "type": "Parameter", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 247, - "end": 248, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 224, - "end": 259, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 250, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 252, - "end": 258, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 261, - "end": 276, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 261, - "end": 275, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 269, - "end": 271, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 262, - "end": 268, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 277, - "end": 295, - "ctxt": 0 - }, - "expression": { - "type": "TsTypeAssertion", - "span": { - "start": 277, - "end": 294, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 285, - "end": 294, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 285, - "end": 287, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 291, - "end": 292, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ], - "typeArguments": null - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 278, - "end": 284, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 333, - "end": 334, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "declare": false, - "span": { - "start": 327, - "end": 421, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 341, - "end": 360, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 341, - "end": 352, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 402, - "end": 419, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 406, - "end": 407, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 408, - "end": 413, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 408, - "end": 413, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 402, - "end": 419, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 416, - "end": 419, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 422, - "end": 460, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 432, - "end": 433, - "ctxt": 0 - }, - "value": "Y", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 434, - "end": 460, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 440, - "end": 448, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 444, - "end": 445, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 453, - "end": 458, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "typeAnnotation": null, - "typeParams": null - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 462, - "end": 472, - "ctxt": 0 - }, - "expression": { - "type": "NewExpression", - "span": { - "start": 462, - "end": 471, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 466, - "end": 467, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 468, - "end": 469, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.ts b/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.ts deleted file mode 100644 index 303bacdbcdb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/trailingCommasInFunctionParametersAndArguments.ts +++ /dev/null @@ -1,32 +0,0 @@ -// @target: es5 - -function f1(x,) {} - -f1(1,); - -function f2(...args,) {} - -// Allowed for ambient declarations -declare function f25(...args,): void; - -f2(...[],); - -// Not confused by overloads -declare function f3(x, ): number; -declare function f3(x, y,): string; - -f3(1,); -f3(1, 2,); - -// Works for constructors too -class X { - constructor(a,) { } - // See trailingCommasInGetter.ts - set x(value,) { } -} -interface Y { - new(x,); - (x,); -} - -new X(1,); diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeErrors.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeErrors.json deleted file mode 100644 index acec6a089d5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeErrors.json +++ /dev/null @@ -1,644 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 447, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 165, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 41, - "end": 165, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 44, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 61, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 67, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 77, - "end": 94, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 95, - "end": 163, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 99, - "end": 146, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 99, - "end": 102, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 102, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 104, - "end": 146, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 109, - "end": 123, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 109, - "end": 113, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 114, - "end": 122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 116, - "end": 122, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 127, - "end": 142, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 127, - "end": 132, - "ctxt": 0 - }, - "value": "width", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 133, - "end": 141, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 135, - "end": 141, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 150, - "end": 160, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 150, - "end": 154, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 154, - "end": 159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 156, - "end": 159, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 212, - "end": 230, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 212, - "end": 229, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 212, - "end": 229, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 217, - "end": 226, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 222, - "end": 226, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 223, - "end": 225, - "ctxt": 0 - }, - "value": 42.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 277, - "end": 299, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 277, - "end": 298, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 281, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 277, - "end": 298, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 282, - "end": 295, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 282, - "end": 287, - "ctxt": 0 - }, - "value": "width", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 288, - "end": 295, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 289, - "end": 294, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 346, - "end": 374, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 350, - "end": 373, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 350, - "end": 357, - "ctxt": 0 - }, - "value": "attribs", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 360, - "end": 373, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 362, - "end": 366, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 368, - "end": 371, - "ctxt": 0 - }, - "value": 100.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 375, - "end": 396, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 375, - "end": 395, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 375, - "end": 395, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 381, - "end": 384, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 384, - "end": 391, - "ctxt": 0 - }, - "value": "attribs", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 416, - "end": 447, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 416, - "end": 446, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 421, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 416, - "end": 446, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 422, - "end": 431, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 425, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 426, - "end": 431, - "ctxt": 0 - }, - "value": "bar", - "raw": "'bar'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 432, - "end": 443, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 432, - "end": 435, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 436, - "end": 443, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 437, - "end": 442, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeInvalidNames.tsx b/crates/swc_ecma_parser/tests/tsc/tsxAttributeInvalidNames.tsx deleted file mode 100644 index 8790f8223ca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeInvalidNames.tsx +++ /dev/null @@ -1,13 +0,0 @@ -//@filename: file.tsx -//@jsx: preserve -declare module JSX { - interface Element { } - interface IntrinsicElements { - test1: { "data-foo"?: string }; - test2: { "data-foo"?: string }; - } -} - -// Invalid names -; -; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution.json deleted file mode 100644 index bf2f90b3ba2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 109, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 18, - "end": 109, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 40, - "end": 109, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 43, - "end": 107, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 70, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 71, - "end": 107, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 75, - "end": 104, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 75, - "end": 76, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 76, - "end": 103, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 78, - "end": 103, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 80, - "end": 90, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 81, - "end": 89, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 83, - "end": 89, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 91, - "end": 101, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 91, - "end": 92, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 92, - "end": 100, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 94, - "end": 100, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution1.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution1.json deleted file mode 100644 index 6c76e477f06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution1.json +++ /dev/null @@ -1,1302 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 738, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 188, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 188, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 186, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 186, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 132, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 135, - "end": 159, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 135, - "end": 140, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 142, - "end": 158, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 144, - "end": 156, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 144, - "end": 148, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 148, - "end": 156, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 150, - "end": 156, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 162, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "value": "var", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 182, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 167, - "end": 182, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 169, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "value": "var", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 189, - "end": 237, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 199, - "end": 207, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 208, - "end": 237, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 211, - "end": 222, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 211, - "end": 212, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 226, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 228, - "end": 234, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 245, - "end": 261, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 245, - "end": 260, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 246, - "end": 251, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 245, - "end": 260, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 252, - "end": 257, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 252, - "end": 253, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 254, - "end": 257, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 255, - "end": 256, - "ctxt": 0 - }, - "value": 0.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 268, - "end": 278, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 268, - "end": 277, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 268, - "end": 277, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 285, - "end": 309, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 285, - "end": 308, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 285, - "end": 308, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 292, - "end": 305, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 298, - "ctxt": 0 - }, - "value": "data-x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 299, - "end": 305, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 300, - "end": 304, - "ctxt": 0 - }, - "value": true - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 317, - "end": 339, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 317, - "end": 338, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 323, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 317, - "end": 338, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 324, - "end": 335, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 328, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 329, - "end": 335, - "ctxt": 0 - }, - "value": "true", - "raw": "'true'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 346, - "end": 370, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 346, - "end": 369, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 347, - "end": 352, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 346, - "end": 369, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 353, - "end": 366, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 353, - "end": 357, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 358, - "end": 366, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 359, - "end": 365, - "ctxt": 0 - }, - "value": "true", - "raw": "'true'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 388, - "end": 406, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 388, - "end": 405, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 389, - "end": 394, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 388, - "end": 405, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 395, - "end": 402, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 397, - "end": 402, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 398, - "end": 401, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 435, - "end": 451, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 435, - "end": 450, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 436, - "end": 441, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 435, - "end": 450, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 442, - "end": 447, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 442, - "end": 443, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 445, - "end": 446, - "ctxt": 0 - }, - "value": 0.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 478, - "end": 496, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 478, - "end": 495, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 479, - "end": 484, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 478, - "end": 495, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 485, - "end": 492, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 485, - "end": 486, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 487, - "end": 492, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 523, - "end": 540, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 523, - "end": 539, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 524, - "end": 529, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 523, - "end": 539, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 530, - "end": 536, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 530, - "end": 531, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 532, - "end": 536, - "ctxt": 0 - }, - "value": "32", - "raw": "\"32\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 570, - "end": 589, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 570, - "end": 588, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 576, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 570, - "end": 588, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 577, - "end": 585, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 577, - "end": 580, - "ctxt": 0 - }, - "value": "var", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 581, - "end": 585, - "ctxt": 0 - }, - "value": "10", - "raw": "\"10\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 619, - "end": 629, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 619, - "end": 628, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 620, - "end": 625, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 619, - "end": 628, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 653, - "end": 673, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 653, - "end": 672, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 654, - "end": 659, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 653, - "end": 672, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 660, - "end": 669, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 660, - "end": 664, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 665, - "end": 669, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 666, - "end": 668, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 720, - "end": 738, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 720, - "end": 737, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 721, - "end": 724, - "ctxt": 0 - }, - "value": "var", - "optional": false - }, - "span": { - "start": 720, - "end": 737, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 725, - "end": 734, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 725, - "end": 728, - "ctxt": 0 - }, - "value": "var", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 729, - "end": 734, - "ctxt": 0 - }, - "value": "var", - "raw": "'var'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution10.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution10.json deleted file mode 100644 index d5def6510d5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution10.json +++ /dev/null @@ -1,551 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 57, - "end": 447, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 187, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 187, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 136, - "end": 185, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 171, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 185, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 182, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 211, - "end": 299, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 218, - "end": 299, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 242, - "end": 256, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 242, - "end": 248, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 242, - "end": 256, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 251, - "end": 256, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 260, - "end": 297, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 260, - "end": 265, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 297, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 267, - "end": 297, - "ctxt": 0 - }, - "members": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 273, - "end": 282, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 274, - "end": 282, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 276, - "end": 282, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 283, - "end": 292, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 285, - "end": 292, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 272, - "end": 293, - "ctxt": 0 - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 323, - "end": 351, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 323, - "end": 350, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 335, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 323, - "end": 350, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 336, - "end": 347, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 336, - "end": 339, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 340, - "end": 347, - "ctxt": 0 - }, - "value": "world", - "raw": "'world'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 369, - "end": 396, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 369, - "end": 395, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 370, - "end": 381, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 369, - "end": 395, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 382, - "end": 392, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 385, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 386, - "end": 392, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 387, - "end": 391, - "ctxt": 0 - }, - "value": true - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 414, - "end": 447, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 414, - "end": 446, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 415, - "end": 426, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 414, - "end": 446, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 427, - "end": 443, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 427, - "end": 435, - "ctxt": 0 - }, - "value": "data-bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 436, - "end": 443, - "ctxt": 0 - }, - "value": "hello", - "raw": "'hello'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution11.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution11.json deleted file mode 100644 index 55f5e0ff9c8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution11.json +++ /dev/null @@ -1,481 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 57, - "end": 393, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 239, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 239, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 136, - "end": 185, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 171, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 185, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 182, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 187, - "end": 237, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 197, - "end": 216, - "ctxt": 0 - }, - "value": "IntrinsicAttributes", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 217, - "end": 237, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 221, - "end": 234, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 221, - "end": 224, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 225, - "end": 233, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 227, - "end": 233, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 269, - "end": 280, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 263, - "end": 336, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 287, - "end": 301, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 287, - "end": 293, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 287, - "end": 301, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 305, - "end": 334, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 305, - "end": 310, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 310, - "end": 334, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 312, - "end": 334, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 317, - "end": 330, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 317, - "end": 320, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 321, - "end": 329, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 323, - "end": 329, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 357, - "end": 393, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 361, - "end": 392, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 361, - "end": 362, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 365, - "end": 392, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 377, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 365, - "end": 392, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 378, - "end": 389, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 378, - "end": 381, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 382, - "end": 389, - "ctxt": 0 - }, - "value": "world", - "raw": "'world'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution12.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution12.json deleted file mode 100644 index 7e2c0c2c7e7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution12.json +++ /dev/null @@ -1,1757 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 42, - "end": 850, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 42, - "end": 224, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 60, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 61, - "end": 224, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 64, - "end": 85, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 81, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 82, - "end": 85, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 87, - "end": 119, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 97, - "end": 114, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 115, - "end": 119, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 121, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 131, - "end": 156, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 157, - "end": 170, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 161, - "end": 167, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 161, - "end": 166, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 172, - "end": 222, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 182, - "end": 201, - "ctxt": 0 - }, - "value": "IntrinsicAttributes", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 202, - "end": 222, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 206, - "end": 219, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 218, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 263, - "end": 272, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": true, - "span": { - "start": 249, - "end": 547, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 283, - "end": 321, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 283, - "end": 294, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 295, - "end": 304, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 295, - "end": 304, - "ctxt": 0 - }, - "value": "props", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 301, - "end": 304, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "value": "context", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 314, - "end": 319, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 323, - "end": 394, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 323, - "end": 331, - "ctxt": 0 - }, - "value": "setState", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 332, - "end": 364, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 332, - "end": 364, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 333, - "end": 364, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 335, - "end": 364, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 336, - "end": 348, - "ctxt": 0 - }, - "value": "prevState", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 345, - "end": 348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 347, - "end": 348, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 347, - "end": 348, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "Identifier", - "span": { - "start": 350, - "end": 358, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 355, - "end": 358, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 360, - "end": 364, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 363, - "end": 364, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 363, - "end": 364, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - } - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 366, - "end": 386, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 366, - "end": 386, - "ctxt": 0 - }, - "value": "callback", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 375, - "end": 386, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 377, - "end": 386, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 380, - "end": 386, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 323, - "end": 394, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 387, - "end": 393, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 389, - "end": 393, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 396, - "end": 443, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 396, - "end": 404, - "ctxt": 0 - }, - "value": "setState", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 405, - "end": 413, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 405, - "end": 413, - "ctxt": 0 - }, - "value": "state", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 410, - "end": 413, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 412, - "end": 413, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 412, - "end": 413, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 415, - "end": 435, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 415, - "end": 435, - "ctxt": 0 - }, - "value": "callback", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 424, - "end": 435, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 426, - "end": 435, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 429, - "end": 435, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 432, - "end": 435, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 396, - "end": 443, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 436, - "end": 442, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 438, - "end": 442, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 445, - "end": 485, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 445, - "end": 456, - "ctxt": 0 - }, - "value": "forceUpdate", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 457, - "end": 477, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 457, - "end": 477, - "ctxt": 0 - }, - "value": "callBack", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 466, - "end": 477, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 468, - "end": 477, - "ctxt": 0 - }, - "params": [], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 471, - "end": 477, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 474, - "end": 477, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 445, - "end": 485, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 478, - "end": 484, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 480, - "end": 484, - "ctxt": 0 - }, - "kind": "void" - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 487, - "end": 509, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 487, - "end": 493, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 487, - "end": 509, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 495, - "end": 508, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 497, - "end": 508, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 501, - "end": 508, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 511, - "end": 520, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 511, - "end": 516, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 516, - "end": 519, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 518, - "end": 519, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 518, - "end": 519, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 522, - "end": 531, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 522, - "end": 527, - "ctxt": 0 - }, - "value": "state", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 527, - "end": 530, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 529, - "end": 530, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 529, - "end": 530, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 533, - "end": 545, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 533, - "end": 540, - "ctxt": 0 - }, - "value": "context", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 540, - "end": 544, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 542, - "end": 544, - "ctxt": 0 - }, - "members": [] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 272, - "end": 278, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 550, - "end": 633, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 560, - "end": 574, - "ctxt": 0 - }, - "value": "ComponentClass", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 574, - "end": 577, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 575, - "end": 576, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 575, - "end": 576, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 578, - "end": 633, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 581, - "end": 631, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 586, - "end": 595, - "ctxt": 0 - }, - "value": "props", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 592, - "end": 595, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 594, - "end": 595, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 594, - "end": 595, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "Identifier", - "span": { - "start": 597, - "end": 610, - "ctxt": 0 - }, - "value": "context", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 605, - "end": 610, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 607, - "end": 610, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 611, - "end": 630, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 613, - "end": 630, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 613, - "end": 622, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 622, - "end": 630, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 623, - "end": 624, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 623, - "end": 624, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 626, - "end": 629, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 635, - "end": 745, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 650, - "end": 657, - "ctxt": 0 - }, - "value": "TestMod", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 658, - "end": 745, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 661, - "end": 721, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 671, - "end": 680, - "ctxt": 0 - }, - "value": "TestClass", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 689, - "end": 716, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 689, - "end": 703, - "ctxt": 0 - }, - "value": "ComponentClass", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 703, - "end": 716, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 704, - "end": 715, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 705, - "end": 714, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 705, - "end": 709, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 709, - "end": 714, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 711, - "end": 714, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - ] - } - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 717, - "end": 721, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 723, - "end": 743, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 727, - "end": 742, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 727, - "end": 731, - "ctxt": 0 - }, - "value": "Test", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 731, - "end": 742, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 733, - "end": 742, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 733, - "end": 742, - "ctxt": 0 - }, - "value": "TestClass", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 767, - "end": 790, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 773, - "end": 789, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 773, - "end": 774, - "ctxt": 0 - }, - "value": "T", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 777, - "end": 789, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 777, - "end": 784, - "ctxt": 0 - }, - "value": "TestMod", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 785, - "end": 789, - "ctxt": 0 - }, - "value": "Test", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 791, - "end": 806, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 795, - "end": 805, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 795, - "end": 797, - "ctxt": 0 - }, - "value": "t1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 800, - "end": 805, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 801, - "end": 802, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "span": { - "start": 800, - "end": 805, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 824, - "end": 850, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 828, - "end": 849, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 828, - "end": 830, - "ctxt": 0 - }, - "value": "t2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 833, - "end": 849, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 834, - "end": 841, - "ctxt": 0 - }, - "value": "TestMod", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 842, - "end": 846, - "ctxt": 0 - }, - "value": "Test", - "optional": false - } - }, - "span": { - "start": 833, - "end": 849, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution13.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution13.json deleted file mode 100644 index 9e6b44acd32..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution13.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 40, - "end": 73, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 49, - "end": 53, - "ctxt": 0 - }, - "value": "Test", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 40, - "end": 59, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 56, - "end": 59, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 60, - "end": 73, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 60, - "end": 73, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 61, - "end": 65, - "ctxt": 0 - }, - "value": "Test", - "optional": false - }, - "span": { - "start": 60, - "end": 66, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 66, - "end": 73, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 68, - "end": 72, - "ctxt": 0 - }, - "value": "Test", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.json deleted file mode 100644 index b429a365015..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.json +++ /dev/null @@ -1,924 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 57, - "end": 683, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 208, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 208, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 140, - "end": 149, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 140, - "end": 143, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 143, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 145, - "end": 148, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 157, - "end": 206, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 167, - "end": 192, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 193, - "end": 206, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 195, - "end": 204, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 195, - "end": 199, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 199, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 201, - "end": 204, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 233, - "end": 314, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 243, - "end": 249, - "ctxt": 0 - }, - "value": "IProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 250, - "end": 314, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 254, - "end": 274, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 254, - "end": 265, - "ctxt": 0 - }, - "value": "primaryText", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 278, - "end": 294, - "ctxt": 0 - }, - "value": "propName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 286, - "end": 294, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 288, - "end": 294, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 295, - "end": 312, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 297, - "end": 312, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 297, - "end": 303, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 306, - "end": 312, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 277, - "end": 312, - "ctxt": 0 - } - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 325, - "end": 344, - "ctxt": 0 - }, - "value": "VerticalNavMenuItem", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 345, - "end": 357, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 345, - "end": 357, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 349, - "end": 357, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 351, - "end": 357, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 351, - "end": 357, - "ctxt": 0 - }, - "value": "IProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 316, - "end": 400, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 359, - "end": 400, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 363, - "end": 398, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 370, - "end": 398, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 371, - "end": 374, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 370, - "end": 375, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 375, - "end": 392, - "ctxt": 0 - }, - "value": "props.primaryText", - "raw": "props.primaryText" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 392, - "end": 398, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 411, - "end": 422, - "ctxt": 0 - }, - "value": "VerticalNav", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 402, - "end": 683, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 425, - "end": 683, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 429, - "end": 681, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 436, - "end": 681, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 442, - "end": 677, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 443, - "end": 446, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 442, - "end": 447, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 447, - "end": 454, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 454, - "end": 493, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 455, - "end": 474, - "ctxt": 0 - }, - "value": "VerticalNavMenuItem", - "optional": false - }, - "span": { - "start": 454, - "end": 493, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 475, - "end": 490, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 475, - "end": 486, - "ctxt": 0 - }, - "value": "primaryText", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 488, - "end": 489, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 493, - "end": 510, - "ctxt": 0 - }, - "value": " // error\n\n ", - "raw": " // error\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 510, - "end": 574, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 511, - "end": 530, - "ctxt": 0 - }, - "value": "VerticalNavMenuItem", - "optional": false - }, - "span": { - "start": 510, - "end": 574, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 531, - "end": 549, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 531, - "end": 545, - "ctxt": 0 - }, - "value": "justRandomProp", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 546, - "end": 549, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 547, - "end": 548, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 550, - "end": 571, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 550, - "end": 561, - "ctxt": 0 - }, - "value": "primaryText", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 562, - "end": 571, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 563, - "end": 570, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 574, - "end": 588, - "ctxt": 0 - }, - "value": " // ok\n\n ", - "raw": " // ok\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 588, - "end": 656, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 589, - "end": 608, - "ctxt": 0 - }, - "value": "VerticalNavMenuItem", - "optional": false - }, - "span": { - "start": 588, - "end": 656, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 609, - "end": 631, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 609, - "end": 624, - "ctxt": 0 - }, - "value": "justRandomProp1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 625, - "end": 631, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 626, - "end": 630, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 632, - "end": 653, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 632, - "end": 643, - "ctxt": 0 - }, - "value": "primaryText", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 644, - "end": 653, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 645, - "end": 652, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 656, - "end": 671, - "ctxt": 0 - }, - "value": " // error\n\n ", - "raw": " // error\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 671, - "end": 677, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 673, - "end": 676, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.tsx b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.tsx index 4c1c5cc8cac..7d6449043a6 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution14.tsx @@ -1,4 +1,4 @@ -//@jsx: preserve +//@jsx: preserve //@module: amd //@filename: react.d.ts diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.json deleted file mode 100644 index 08d50c50345..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.json +++ /dev/null @@ -1,652 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 139, - "end": 468, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 139, - "end": 171, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 151, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 154, - "end": 170, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 162, - "end": 169, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 179, - "end": 189, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "declare": false, - "span": { - "start": 173, - "end": 307, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 229, - "end": 283, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 229, - "end": 235, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 229, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 238, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 248, - "end": 277, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 255, - "end": 276, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 256, - "end": 259, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 255, - "end": 260, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 260, - "end": 270, - "ctxt": 0 - }, - "value": "Default hi", - "raw": "Default hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 270, - "end": 276, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 272, - "end": 275, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 288, - "end": 305, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 288, - "end": 296, - "ctxt": 0 - }, - "value": "greeting", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 296, - "end": 304, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 298, - "end": 304, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 198, - "end": 213, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 198, - "end": 203, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 204, - "end": 213, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 219, - "end": 221, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 354, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 322, - "end": 354, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 326, - "end": 354, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 327, - "end": 337, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 326, - "end": 354, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 338, - "end": 351, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 343, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 344, - "end": 351, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 362, - "end": 429, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 366, - "end": 429, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 366, - "end": 367, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 370, - "end": 429, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 371, - "end": 381, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 370, - "end": 429, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 382, - "end": 426, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 385, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 386, - "end": 426, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 387, - "end": 425, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "value": "input", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 398, - "end": 425, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 400, - "end": 423, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 400, - "end": 422, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 400, - "end": 414, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 400, - "end": 404, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 405, - "end": 414, - "ctxt": 0 - }, - "value": "textInput", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "value": "input", - "optional": false - } - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 430, - "end": 468, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 434, - "end": 468, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 434, - "end": 435, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 438, - "end": 468, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 439, - "end": 449, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 438, - "end": 468, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 450, - "end": 465, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 450, - "end": 460, - "ctxt": 0 - }, - "value": "data-extra", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 461, - "end": 465, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.tsx b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.tsx index 3445be6a088..f12e7793cc8 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution15.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: preserve // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.json deleted file mode 100644 index f43f9ee0bb4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.json +++ /dev/null @@ -1,725 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 591, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 207, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 166, - "ctxt": 0 - }, - "value": "Address", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 167, - "end": 207, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 171, - "end": 186, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 171, - "end": 177, - "ctxt": 0 - }, - "value": "street", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 177, - "end": 185, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 189, - "end": 205, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 189, - "end": 196, - "ctxt": 0 - }, - "value": "country", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 209, - "end": 278, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 219, - "end": 234, - "ctxt": 0 - }, - "value": "CanadianAddress", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 243, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 243, - "end": 250, - "ctxt": 0 - }, - "value": "Address", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 251, - "end": 278, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 257, - "end": 276, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 257, - "end": 267, - "ctxt": 0 - }, - "value": "postalCode", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 267, - "end": 275, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 280, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 290, - "end": 305, - "ctxt": 0 - }, - "value": "AmericanAddress", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "value": "Address", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 322, - "end": 346, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 328, - "end": 344, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 328, - "end": 335, - "ctxt": 0 - }, - "value": "zipCode", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 335, - "end": 343, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 337, - "end": 343, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 348, - "end": 400, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 353, - "end": 363, - "ctxt": 0 - }, - "value": "Properties", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 366, - "end": 399, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 366, - "end": 381, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 366, - "end": 381, - "ctxt": 0 - }, - "value": "CanadianAddress", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 384, - "end": 399, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 384, - "end": 399, - "ctxt": 0 - }, - "value": "AmericanAddress", - "optional": false - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 402, - "end": 513, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 415, - "end": 426, - "ctxt": 0 - }, - "value": "AddressComp", - "optional": false - }, - "declare": false, - "span": { - "start": 409, - "end": 513, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 473, - "end": 511, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 480, - "end": 486, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 473, - "end": 511, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 489, - "end": 511, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 495, - "end": 507, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 502, - "end": 506, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 435, - "end": 450, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 435, - "end": 440, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 441, - "end": 450, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 450, - "end": 468, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 451, - "end": 461, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 451, - "end": 461, - "ctxt": 0 - }, - "value": "Properties", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 463, - "end": 467, - "ctxt": 0 - }, - "kind": "void" - } - ] - }, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 515, - "end": 591, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 519, - "end": 591, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 519, - "end": 520, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 523, - "end": 591, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 524, - "end": 535, - "ctxt": 0 - }, - "value": "AddressComp", - "optional": false - }, - "span": { - "start": 523, - "end": 591, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 536, - "end": 556, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 536, - "end": 546, - "ctxt": 0 - }, - "value": "postalCode", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 547, - "end": 556, - "ctxt": 0 - }, - "value": "T1B 0L3", - "raw": "'T1B 0L3'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 557, - "end": 575, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 557, - "end": 563, - "ctxt": 0 - }, - "value": "street", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 564, - "end": 575, - "ctxt": 0 - }, - "value": "vancouver", - "raw": "\"vancouver\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 576, - "end": 588, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 576, - "end": 583, - "ctxt": 0 - }, - "value": "country", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 584, - "end": 588, - "ctxt": 0 - }, - "value": "CA", - "raw": "\"CA\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.tsx b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.tsx index 0f661fe90e6..592833c3102 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution16.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: preserve // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution2.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution2.json deleted file mode 100644 index 91d5688e588..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution2.json +++ /dev/null @@ -1,628 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 315, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 137, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 137, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 132, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 138, - "end": 187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 156, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 157, - "end": 187, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 160, - "end": 185, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 160, - "end": 162, - "ctxt": 0 - }, - "value": "c1", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 163, - "end": 184, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 165, - "end": 184, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 167, - "end": 175, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 169, - "end": 175, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 177, - "end": 184, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 195, - "end": 226, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 195, - "end": 225, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 195, - "end": 225, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 202, - "end": 222, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 204, - "ctxt": 0 - }, - "value": "c1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 205, - "end": 222, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 206, - "end": 221, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 233, - "end": 267, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 233, - "end": 266, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 234, - "end": 239, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 233, - "end": 266, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 240, - "end": 263, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 240, - "end": 247, - "ctxt": 0 - }, - "value": "data-c1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 248, - "end": 263, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 249, - "end": 262, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 256, - "end": 262, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 256, - "end": 257, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 258, - "end": 262, - "ctxt": 0 - }, - "value": "leng", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 286, - "end": 315, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 286, - "end": 314, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 286, - "end": 314, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 293, - "end": 311, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 293, - "end": 295, - "ctxt": 0 - }, - "value": "c1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 296, - "end": 311, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 297, - "end": 310, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 306, - "end": 310, - "ctxt": 0 - }, - "value": "leng", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution3.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution3.json deleted file mode 100644 index 7b7f77c37fa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution3.json +++ /dev/null @@ -1,1343 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 661, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 137, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 137, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 132, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 138, - "end": 198, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 156, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 157, - "end": 198, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 160, - "end": 170, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 161, - "end": 169, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 163, - "end": 169, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 172, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 174, - "end": 182, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 176, - "end": 182, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 196, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 189, - "end": 195, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 206, - "end": 230, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 210, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 214, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 217, - "end": 229, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 222, - "end": 227, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 231, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 231, - "end": 250, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 232, - "end": 237, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 231, - "end": 250, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 239, - "end": 242, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 242, - "end": 246, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 278, - "end": 299, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 282, - "end": 298, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 282, - "end": 286, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 289, - "end": 298, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 291, - "end": 292, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 294, - "end": 296, - "ctxt": 0 - }, - "value": 32.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 300, - "end": 319, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 300, - "end": 319, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 301, - "end": 306, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 300, - "end": 319, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 311, - "end": 315, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 344, - "end": 365, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 348, - "end": 364, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "value": "obj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 355, - "end": 364, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 360, - "end": 362, - "ctxt": 0 - }, - "value": 32.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 366, - "end": 385, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 366, - "end": 385, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 367, - "end": 372, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 366, - "end": 385, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 377, - "end": 381, - "ctxt": 0 - }, - "value": "obj3", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 393, - "end": 421, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 397, - "end": 420, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 397, - "end": 401, - "ctxt": 0 - }, - "value": "obj4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 404, - "end": 420, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 406, - "end": 407, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 409, - "end": 411, - "ctxt": 0 - }, - "value": 32.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 413, - "end": 414, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 416, - "end": 418, - "ctxt": 0 - }, - "value": 32.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 422, - "end": 448, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 422, - "end": 448, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 423, - "end": 428, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 422, - "end": 448, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 430, - "end": 433, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 433, - "end": 437, - "ctxt": 0 - }, - "value": "obj4", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 439, - "end": 445, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 439, - "end": 440, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 441, - "end": 445, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 459, - "end": 487, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 486, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 467, - "ctxt": 0 - }, - "value": "obj5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 470, - "end": 486, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 475, - "end": 477, - "ctxt": 0 - }, - "value": 32.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 479, - "end": 480, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 482, - "end": 484, - "ctxt": 0 - }, - "value": 32.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 488, - "end": 514, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 488, - "end": 514, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 489, - "end": 494, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 488, - "end": 514, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 495, - "end": 501, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 495, - "end": 496, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 497, - "end": 501, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 503, - "end": 506, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 506, - "end": 510, - "ctxt": 0 - }, - "value": "obj5", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 522, - "end": 564, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 526, - "end": 563, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "obj6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 533, - "end": 563, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 535, - "end": 536, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 538, - "end": 542, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 544, - "end": 545, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 547, - "end": 549, - "ctxt": 0 - }, - "value": 32.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 551, - "end": 556, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 558, - "end": 561, - "ctxt": 0 - }, - "value": 100.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 565, - "end": 584, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 565, - "end": 584, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 566, - "end": 571, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 565, - "end": 584, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 573, - "end": 576, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 576, - "end": 580, - "ctxt": 0 - }, - "value": "obj6", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 610, - "end": 634, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 614, - "end": 633, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 614, - "end": 618, - "ctxt": 0 - }, - "value": "obj7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 621, - "end": 633, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 623, - "end": 624, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 626, - "end": 631, - "ctxt": 0 - }, - "value": "foo", - "raw": "'foo'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 635, - "end": 661, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 635, - "end": 661, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 636, - "end": 641, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 635, - "end": 661, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 642, - "end": 648, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 644, - "end": 648, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 645, - "end": 647, - "ctxt": 0 - }, - "value": 32.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 650, - "end": 653, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 653, - "end": 657, - "ctxt": 0 - }, - "value": "obj7", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution4.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution4.json deleted file mode 100644 index 10104b5686b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution4.json +++ /dev/null @@ -1,481 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 295, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 137, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 137, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 132, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 138, - "end": 181, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 156, - "ctxt": 0 - }, - "value": "Attribs1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 157, - "end": 181, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 160, - "end": 161, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "params": [ - { - "type": "Identifier", - "span": { - "start": 162, - "end": 171, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 163, - "end": 171, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 165, - "end": 171, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 178, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 189, - "end": 220, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 189, - "end": 219, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 190, - "end": 195, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 189, - "end": 219, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 201, - "end": 214, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 203, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 205, - "end": 213, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 206, - "end": 207, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "NumericLiteral", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": 0.0 - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 260, - "end": 295, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 260, - "end": 294, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 261, - "end": 266, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 260, - "end": 294, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 272, - "end": 289, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 276, - "end": 288, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 277, - "end": 278, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 283, - "end": 288, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 283, - "end": 284, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "value": "len", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution6.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution6.json deleted file mode 100644 index 3242d55e242..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution6.json +++ /dev/null @@ -1,668 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 289, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 181, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 181, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 179, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 179, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 150, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 149, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 123, - "end": 149, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 125, - "end": 137, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 125, - "end": 126, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 136, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 136, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 138, - "end": 148, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 140, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 142, - "end": 148, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 153, - "end": 176, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 158, - "end": 175, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 160, - "end": 175, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 162, - "end": 173, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 192, - "end": 204, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 192, - "end": 203, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 193, - "end": 198, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 192, - "end": 203, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "value": "s", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 205, - "end": 224, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 205, - "end": 223, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 206, - "end": 211, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 205, - "end": 223, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 214, - "end": 220, - "ctxt": 0 - }, - "value": "true", - "raw": "'true'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 225, - "end": 235, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 226, - "end": 231, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 243, - "end": 255, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 243, - "end": 254, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 244, - "end": 249, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 243, - "end": 254, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 256, - "end": 276, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 256, - "end": 275, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 257, - "end": 262, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 256, - "end": 275, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 263, - "end": 272, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 265, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 266, - "end": 271, - "ctxt": 0 - }, - "value": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 277, - "end": 289, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 277, - "end": 288, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 283, - "ctxt": 0 - }, - "value": "test2", - "optional": false - }, - "span": { - "start": 277, - "end": 288, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 284, - "end": 285, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 284, - "end": 285, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution7.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution7.json deleted file mode 100644 index b5852438de9..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution7.json +++ /dev/null @@ -1,487 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 273, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 152, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 150, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 147, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 123, - "end": 146, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 125, - "end": 144, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 125, - "end": 135, - "ctxt": 0 - }, - "value": "data-foo", - "raw": "\"data-foo\"" - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 163, - "end": 187, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 163, - "end": 186, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 164, - "end": 169, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 163, - "end": 186, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 170, - "end": 183, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "value": "data-foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 179, - "end": 183, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 180, - "end": 182, - "ctxt": 0 - }, - "value": 32.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 195, - "end": 221, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 195, - "end": 220, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 195, - "end": 220, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 202, - "end": 217, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "value": "data-foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 211, - "end": 217, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "value": "32", - "raw": "'32'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 222, - "end": 248, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 222, - "end": 247, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 222, - "end": 247, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 229, - "end": 244, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 229, - "end": 237, - "ctxt": 0 - }, - "value": "data-bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 238, - "end": 244, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 239, - "end": 243, - "ctxt": 0 - }, - "value": "32", - "raw": "'32'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 249, - "end": 273, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 249, - "end": 272, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 250, - "end": 255, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 249, - "end": 272, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 256, - "end": 269, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 256, - "end": 264, - "ctxt": 0 - }, - "value": "data-bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 266, - "end": 268, - "ctxt": 0 - }, - "value": 32.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution8.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution8.json deleted file mode 100644 index ab4aee67881..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution8.json +++ /dev/null @@ -1,292 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 186, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 140, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 140, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 138, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 138, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 135, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 134, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 123, - "end": 134, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 124, - "end": 133, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 124, - "end": 125, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 125, - "end": 133, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 127, - "end": 133, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 142, - "end": 153, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 146, - "end": 152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 147, - "end": 152, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 170, - "end": 186, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 170, - "end": 186, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 171, - "end": 176, - "ctxt": 0 - }, - "value": "test1", - "optional": false - }, - "span": { - "start": 170, - "end": 186, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution9.json b/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution9.json deleted file mode 100644 index a6ddfece18e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution9.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 57, - "end": 384, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 187, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 187, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 136, - "end": 185, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 171, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 185, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 182, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 189, - "end": 225, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 199, - "end": 204, - "ctxt": 0 - }, - "value": "Props", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 205, - "end": 225, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 211, - "end": 223, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 249, - "end": 323, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 262, - "end": 273, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 256, - "end": 323, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 280, - "end": 294, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 280, - "end": 286, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 280, - "end": 294, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 289, - "end": 294, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 298, - "end": 321, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 298, - "end": 303, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 303, - "end": 321, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 305, - "end": 321, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 307, - "end": 319, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 310, - "end": 318, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 312, - "end": 318, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 325, - "end": 351, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 325, - "end": 350, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 326, - "end": 337, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 325, - "end": 350, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 338, - "end": 347, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 341, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 342, - "end": 347, - "ctxt": 0 - }, - "value": "bar", - "raw": "\"bar\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 360, - "end": 384, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 360, - "end": 383, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 361, - "end": 372, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 360, - "end": 383, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 373, - "end": 380, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": 0.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.json b/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.json deleted file mode 100644 index 58a89432306..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.json +++ /dev/null @@ -1,745 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 15, - "end": 408, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 15, - "end": 88, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 30, - "end": 33, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 34, - "end": 88, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 40, - "end": 86, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 50, - "end": 57, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 58, - "end": 86, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 68, - "end": 80, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 68, - "end": 71, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 71, - "end": 79, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 73, - "end": 79, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 89, - "end": 215, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 107, - "end": 112, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 113, - "end": 215, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 125, - "end": 134, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 119, - "end": 213, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 151, - "end": 189, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 151, - "end": 162, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 163, - "end": 172, - "ctxt": 0 - }, - "value": "props", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 171, - "end": 172, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 171, - "end": 172, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 174, - "end": 187, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 174, - "end": 187, - "ctxt": 0 - }, - "value": "context", - "optional": true, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 182, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassProperty", - "span": { - "start": 198, - "end": 207, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 198, - "end": 203, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 203, - "end": 206, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 217, - "end": 408, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 230, - "end": 242, - "ctxt": 0 - }, - "value": "ShortDetails", - "optional": false - }, - "declare": false, - "span": { - "start": 224, - "end": 408, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 293, - "end": 406, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 300, - "end": 306, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 293, - "end": 406, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 322, - "end": 406, - "ctxt": 0 - }, - "stmts": [ - { - "type": "IfStatement", - "span": { - "start": 332, - "end": 400, - "ctxt": 0 - }, - "test": { - "type": "BinaryExpression", - "span": { - "start": 336, - "end": 353, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "MemberExpression", - "span": { - "start": 336, - "end": 349, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 336, - "end": 346, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 336, - "end": 340, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 347, - "end": 349, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 352, - "end": 353, - "ctxt": 0 - }, - "value": 1.0 - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 355, - "end": 400, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 369, - "end": 390, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 376, - "end": 389, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 377, - "end": 388, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 378, - "end": 381, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 382, - "end": 388, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 384, - "end": 387, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - } - ] - }, - "alternate": null - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 308, - "end": 321, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 310, - "end": 321, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 251, - "end": 266, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 251, - "end": 256, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 257, - "end": 266, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 266, - "end": 286, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 267, - "end": 281, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 269, - "end": 279, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 271, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 271, - "end": 279, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 273, - "end": 279, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 283, - "end": 285, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.tsx b/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.tsx index 96df997c851..df589387e6a 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxCorrectlyParseLessThanComparison1.tsx @@ -1,4 +1,4 @@ -// @jsx: react +// @jsx: react declare module JSX { interface Element { div: string; diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution1.json b/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution1.json deleted file mode 100644 index 5a514e59183..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution1.json +++ /dev/null @@ -1,410 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 320, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 183, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 181, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 180, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 190, - "end": 198, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 184, - "end": 290, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 239, - "end": 288, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 239, - "end": 288, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 248, - "end": 288, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 258, - "end": 282, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 281, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 269, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 265, - "end": 270, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 275, - "end": 281, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 207, - "end": 222, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 207, - "end": 212, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 222, - "end": 232, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 229, - "end": 231, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 298, - "end": 320, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 302, - "end": 319, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 307, - "end": 315, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution2.json b/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution2.json deleted file mode 100644 index d8bb0874418..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution2.json +++ /dev/null @@ -1,418 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 317, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 180, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 180, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 173, - "end": 177, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 173, - "end": 177, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 181, - "end": 287, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 236, - "end": 285, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 236, - "end": 285, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 285, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 255, - "end": 279, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 262, - "end": 278, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 262, - "end": 267, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 267, - "end": 272, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 272, - "end": 278, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 274, - "end": 277, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 204, - "end": 219, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 204, - "end": 209, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 219, - "end": 229, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 226, - "end": 228, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 295, - "end": 317, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 299, - "end": 316, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 303, - "end": 316, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 304, - "end": 312, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 303, - "end": 316, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution3.json b/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution3.json deleted file mode 100644 index 516fb458beb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDefaultAttributesResolution3.json +++ /dev/null @@ -1,418 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 321, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 181, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 181, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 173, - "end": 178, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 173, - "end": 178, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 188, - "end": 196, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 182, - "end": 288, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 237, - "end": 286, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 237, - "end": 243, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 237, - "end": 286, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 246, - "end": 286, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 256, - "end": 280, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 263, - "end": 279, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 268, - "end": 273, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 273, - "end": 279, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 275, - "end": 278, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 205, - "end": 220, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 205, - "end": 210, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 211, - "end": 220, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 220, - "end": 230, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 221, - "end": 225, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 221, - "end": 225, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 227, - "end": 229, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 299, - "end": 321, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 303, - "end": 320, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 307, - "end": 320, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 316, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 307, - "end": 320, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName1.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName1.json deleted file mode 100644 index 97b3d90a467..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName1.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 77, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 19, - "end": 40, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 23, - "end": 39, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 23, - "end": 32, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 35, - "end": 39, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 41, - "end": 77, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 41, - "end": 77, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 42, - "end": 51, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - }, - "span": { - "start": 41, - "end": 52, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 52, - "end": 65, - "ctxt": 0 - }, - "value": " Hello World ", - "raw": " Hello World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 65, - "end": 77, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 67, - "end": 76, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName2.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName2.json deleted file mode 100644 index e59150f251f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName2.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 175, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 115, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 38, - "end": 115, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 41, - "end": 62, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 64, - "end": 113, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 91, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 92, - "end": 113, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 102, - "end": 110, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 105, - "end": 110, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 107, - "end": 110, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 117, - "end": 138, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 121, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 121, - "end": 130, - "ctxt": 0 - }, - "value": "customTag", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 133, - "end": 137, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 139, - "end": 175, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 139, - "end": 175, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 140, - "end": 149, - "ctxt": 0 - }, - "value": "customTag", - "optional": false - }, - "span": { - "start": 139, - "end": 150, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 150, - "end": 163, - "ctxt": 0 - }, - "value": " Hello World ", - "raw": " Hello World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 163, - "end": 175, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "value": "customTag", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName3.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName3.json deleted file mode 100644 index f5de9462aeb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName3.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 175, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 109, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 38, - "end": 109, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 41, - "end": 62, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 64, - "end": 107, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 91, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 92, - "end": 107, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 96, - "end": 104, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 111, - "end": 138, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 115, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 115, - "end": 124, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 130, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - } - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 133, - "end": 137, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 139, - "end": 175, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 139, - "end": 175, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 140, - "end": 149, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - }, - "span": { - "start": 139, - "end": 150, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 150, - "end": 163, - "ctxt": 0 - }, - "value": " Hello World ", - "raw": " Hello World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 163, - "end": 175, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName4.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName4.json deleted file mode 100644 index b1294a18a5a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName4.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 185, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 119, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 38, - "end": 119, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 41, - "end": 62, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 64, - "end": 117, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 91, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 92, - "end": 117, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 96, - "end": 104, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 107, - "end": 114, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 107, - "end": 109, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 109, - "end": 114, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 111, - "end": 114, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 121, - "end": 148, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 125, - "end": 147, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 125, - "end": 134, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - } - } - } - }, - "init": { - "type": "StringLiteral", - "span": { - "start": 143, - "end": 147, - "ctxt": 0 - }, - "value": "h1", - "raw": "\"h1\"" - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 149, - "end": 185, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 149, - "end": 185, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 150, - "end": 159, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - }, - "span": { - "start": 149, - "end": 160, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 160, - "end": 173, - "ctxt": 0 - }, - "value": " Hello World ", - "raw": " Hello World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 173, - "end": 185, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 175, - "end": 184, - "ctxt": 0 - }, - "value": "CustomTag", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName5.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName5.json deleted file mode 100644 index 4b81a327212..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName5.json +++ /dev/null @@ -1,410 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 295, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 96, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 66, - "end": 96, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 75, - "end": 84, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 69, - "end": 94, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 84, - "end": 90, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 119, - "end": 150, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 152, - "end": 295, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 165, - "end": 169, - "ctxt": 0 - }, - "value": "Text", - "optional": false - }, - "declare": false, - "span": { - "start": 159, - "end": 295, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 206, - "end": 231, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "div", - "raw": "'div'" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 235, - "end": 293, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 241, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 235, - "end": 293, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 244, - "end": 293, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 250, - "end": 289, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 257, - "end": 288, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 282, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 266, - "end": 270, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 271, - "end": 279, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - } - }, - "span": { - "start": 265, - "end": 282, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 178, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 193, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 193, - "end": 201, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName6.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName6.json deleted file mode 100644 index 6c69926f081..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName6.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 109, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 34, - "end": 37, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 38, - "end": 109, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 41, - "end": 62, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 58, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 64, - "end": 107, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 91, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 92, - "end": 107, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 96, - "end": 104, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 111, - "end": 131, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 117, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 117, - "end": 118, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 121, - "end": 131, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 125, - "ctxt": 0 - }, - "value": "tag", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 126, - "end": 130, - "ctxt": 0 - }, - "value": "h1", - "raw": "'h1'" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 132, - "end": 152, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 138, - "end": 152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 144, - "end": 152, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 145, - "end": 146, - "ctxt": 0 - }, - "value": "t", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "value": "tag", - "optional": false - } - }, - "span": { - "start": 144, - "end": 152, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName7.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName7.json deleted file mode 100644 index a4a8da63eb2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName7.json +++ /dev/null @@ -1,397 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 313, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 96, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 66, - "end": 96, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 75, - "end": 84, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 69, - "end": 94, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 84, - "end": 90, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 119, - "end": 150, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 152, - "end": 313, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 165, - "end": 169, - "ctxt": 0 - }, - "value": "Text", - "optional": false - }, - "declare": false, - "span": { - "start": 159, - "end": 313, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 206, - "end": 231, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "div", - "raw": "'div'" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 235, - "end": 311, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 241, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 235, - "end": 311, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 244, - "end": 311, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 250, - "end": 307, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 257, - "end": 306, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 272, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 270, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "span": { - "start": 265, - "end": 272, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 178, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 193, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 193, - "end": 201, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName8.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName8.json deleted file mode 100644 index d30c5de8208..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName8.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 322, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 96, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 66, - "end": 96, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 75, - "end": 84, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 69, - "end": 94, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 84, - "end": 90, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 119, - "end": 150, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 152, - "end": 322, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 165, - "end": 169, - "ctxt": 0 - }, - "value": "Text", - "optional": false - }, - "declare": false, - "span": { - "start": 159, - "end": 322, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 206, - "end": 231, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "div", - "raw": "'div'" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 222, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 235, - "end": 320, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 241, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 235, - "end": 320, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 244, - "end": 320, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 250, - "end": 316, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 257, - "end": 315, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 309, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 266, - "end": 270, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 271, - "end": 279, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - } - }, - "span": { - "start": 265, - "end": 280, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 280, - "end": 293, - "ctxt": 0 - }, - "value": " Hello world ", - "raw": " Hello world " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 293, - "end": 309, - "ctxt": 0 - }, - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 295, - "end": 299, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 300, - "end": 308, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - } - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 178, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 193, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 193, - "end": 201, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName9.json b/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName9.json deleted file mode 100644 index 328b81f54b7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxDynamicTagName9.json +++ /dev/null @@ -1,460 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 43, - "end": 321, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 43, - "end": 96, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 58, - "end": 65, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 66, - "end": 96, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 75, - "end": 84, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 69, - "end": 94, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 84, - "end": 90, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 85, - "end": 86, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 88, - "end": 89, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 119, - "end": 150, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 131, - "end": 136, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 142, - "end": 149, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 152, - "end": 321, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 165, - "end": 169, - "ctxt": 0 - }, - "value": "Text", - "optional": false - }, - "declare": false, - "span": { - "start": 159, - "end": 321, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 206, - "end": 230, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 206, - "end": 214, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 224, - "end": 229, - "ctxt": 0 - }, - "value": "div", - "raw": "'div'" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "value": "div", - "raw": "\"div\"" - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 234, - "end": 319, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 234, - "end": 319, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 243, - "end": 319, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 249, - "end": 315, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 256, - "end": 314, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 264, - "end": 308, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 270, - "end": 278, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - } - }, - "span": { - "start": 264, - "end": 279, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 279, - "end": 292, - "ctxt": 0 - }, - "value": " Hello world ", - "raw": " Hello world " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 292, - "end": 308, - "ctxt": 0 - }, - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - }, - "value": "this", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 299, - "end": 307, - "ctxt": 0 - }, - "value": "_tagName", - "optional": false - } - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 178, - "end": 193, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 193, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 193, - "end": 201, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution.json deleted file mode 100644 index 852a157e41a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 502, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 18, - "end": 133, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 36, - "end": 39, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 40, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 43, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 53, - "end": 70, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 71, - "end": 131, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 75, - "end": 101, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 75, - "end": 85, - "ctxt": 0 - }, - "value": "foundFirst", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 85, - "end": 100, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 87, - "end": 100, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 89, - "end": 98, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 89, - "end": 90, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 90, - "end": 98, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 92, - "end": 98, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 104, - "end": 119, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 104, - "end": 118, - "ctxt": 0 - }, - "value": "string_named", - "raw": "'string_named'" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 122, - "end": 128, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "var", - "raw": "'var'" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 141, - "end": 151, - "ctxt": 0 - }, - "value": "foundFirst", - "optional": false - }, - "declare": false, - "span": { - "start": 135, - "end": 155, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "value": "Other", - "optional": false - }, - "declare": false, - "span": { - "start": 156, - "end": 170, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 172, - "end": 212, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "value": "Dotted", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 186, - "end": 212, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 189, - "end": 210, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 202, - "end": 206, - "ctxt": 0 - }, - "value": "Name", - "optional": false - }, - "declare": false, - "span": { - "start": 196, - "end": 210, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 274, - "end": 308, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 278, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 282, - "end": 307, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 283, - "end": 293, - "ctxt": 0 - }, - "value": "foundFirst", - "optional": false - }, - "span": { - "start": 282, - "end": 307, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 295, - "end": 304, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 296, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 297, - "end": 304, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 334, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 313, - "end": 333, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 317, - "end": 333, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 330, - "ctxt": 0 - }, - "value": "string_named", - "optional": false - }, - "span": { - "start": 317, - "end": 333, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 459, - "end": 477, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 476, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 464, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 467, - "end": 476, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 468, - "end": 473, - "ctxt": 0 - }, - "value": "Other", - "optional": false - }, - "span": { - "start": 467, - "end": 476, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 478, - "end": 502, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 482, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 486, - "end": 501, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 487, - "end": 493, - "ctxt": 0 - }, - "value": "Dotted", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 494, - "end": 498, - "ctxt": 0 - }, - "value": "Name", - "optional": false - } - }, - "span": { - "start": 486, - "end": 501, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution1.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution1.json deleted file mode 100644 index 91714cf9d4a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution1.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 164, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 129, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 129, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 127, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 127, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 116, - "end": 124, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 116, - "end": 119, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 121, - "end": 124, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 137, - "end": 145, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 137, - "end": 144, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 137, - "end": 144, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 155, - "end": 164, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 156, - "end": 160, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution10.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution10.json deleted file mode 100644 index 7db37c6c8b0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution10.json +++ /dev/null @@ -1,773 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 398, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 161, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 161, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 106, - "ctxt": 0 - }, - "value": "ElementClass", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 107, - "end": 126, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 111, - "end": 123, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 111, - "end": 117, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 117, - "end": 122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 128, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 155, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 156, - "end": 159, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 163, - "end": 217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 173, - "end": 181, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 182, - "end": 217, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 185, - "end": 215, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 189, - "end": 198, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 190, - "end": 198, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 192, - "end": 198, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 199, - "end": 214, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 201, - "end": 214, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 204, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 218, - "end": 237, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 222, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 222, - "end": 226, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 226, - "end": 236, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 228, - "end": 236, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 228, - "end": 236, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 238, - "end": 254, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 238, - "end": 253, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 239, - "end": 243, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 238, - "end": 253, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 244, - "end": 250, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 246, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 247, - "end": 249, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 283, - "end": 348, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 301, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 302, - "end": 348, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 305, - "end": 346, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 306, - "end": 315, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 307, - "end": 315, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 309, - "end": 315, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 316, - "end": 345, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 318, - "end": 345, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 320, - "end": 330, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 321, - "end": 329, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 323, - "end": 329, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 331, - "end": 343, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 337, - "end": 342, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 349, - "end": 368, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 353, - "end": 367, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 353, - "end": 357, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 359, - "end": 367, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 359, - "end": 367, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 369, - "end": 398, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 369, - "end": 397, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 370, - "end": 374, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "span": { - "start": 369, - "end": 397, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 375, - "end": 381, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 375, - "end": 376, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 377, - "end": 381, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 378, - "end": 380, - "ctxt": 0 - }, - "value": 32.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 382, - "end": 394, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 388, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 389, - "end": 394, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution11.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution11.json deleted file mode 100644 index da06537a1b5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution11.json +++ /dev/null @@ -1,875 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 444, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 158, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 158, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 123, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 120, - "end": 123, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 125, - "end": 156, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 135, - "end": 152, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 153, - "end": 156, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 160, - "end": 204, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 179, - "end": 204, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 182, - "end": 202, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 186, - "end": 195, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 189, - "end": 195, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 205, - "end": 224, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 209, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 209, - "end": 213, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 223, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 215, - "end": 223, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 215, - "end": 223, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 225, - "end": 241, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 225, - "end": 240, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 226, - "end": 230, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 225, - "end": 240, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 231, - "end": 237, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 233, - "end": 237, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 234, - "end": 236, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 249, - "end": 304, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 259, - "end": 267, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 268, - "end": 304, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 271, - "end": 302, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 275, - "end": 284, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 276, - "end": 284, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 278, - "end": 284, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 285, - "end": 301, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 287, - "end": 301, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 289, - "end": 299, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 291, - "end": 299, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 293, - "end": 299, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 305, - "end": 324, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 309, - "end": 323, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 309, - "end": 313, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 323, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 315, - "end": 323, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 315, - "end": 323, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 325, - "end": 341, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 325, - "end": 340, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 326, - "end": 330, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "span": { - "start": 325, - "end": 340, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 331, - "end": 337, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 333, - "end": 337, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 334, - "end": 336, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 352, - "end": 407, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 362, - "end": 370, - "ctxt": 0 - }, - "value": "Obj3type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 371, - "end": 407, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 374, - "end": 405, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 378, - "end": 387, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 379, - "end": 387, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 404, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 390, - "end": 404, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 392, - "end": 402, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 392, - "end": 393, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 393, - "end": 401, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 395, - "end": 401, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 408, - "end": 427, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 412, - "end": 426, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 412, - "end": 416, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 416, - "end": 426, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 418, - "end": 426, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 418, - "end": 426, - "ctxt": 0 - }, - "value": "Obj3type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 428, - "end": 444, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 428, - "end": 443, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 429, - "end": 433, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 428, - "end": 443, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 434, - "end": 440, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 434, - "end": 435, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 436, - "end": 440, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution12.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution12.json deleted file mode 100644 index 67cbdcc9d6c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution12.json +++ /dev/null @@ -1,1543 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 686, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 167, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 167, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 132, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 120, - "end": 132, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 122, - "end": 130, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 124, - "ctxt": 0 - }, - "value": "pr", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 134, - "end": 165, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 144, - "end": 161, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 169, - "end": 213, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 188, - "end": 213, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 191, - "end": 211, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 195, - "end": 204, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 198, - "end": 204, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 205, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 214, - "end": 233, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 218, - "end": 232, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 218, - "end": 222, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 222, - "end": 232, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 224, - "end": 232, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 224, - "end": 232, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 234, - "end": 250, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 234, - "end": 249, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 235, - "end": 239, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 234, - "end": 249, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 240, - "end": 246, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 240, - "end": 241, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 242, - "end": 246, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 243, - "end": 245, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 258, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 268, - "end": 276, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 277, - "end": 322, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 280, - "end": 320, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 284, - "end": 293, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 285, - "end": 293, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 287, - "end": 293, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 319, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 296, - "end": 319, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 298, - "end": 309, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 300, - "end": 308, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 302, - "end": 308, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 310, - "end": 317, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 310, - "end": 312, - "ctxt": 0 - }, - "value": "pr", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 312, - "end": 317, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 323, - "end": 342, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 327, - "end": 341, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 327, - "end": 331, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 331, - "end": 341, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 333, - "end": 341, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 333, - "end": 341, - "ctxt": 0 - }, - "value": "Obj2type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 343, - "end": 359, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 343, - "end": 358, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 348, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "span": { - "start": 343, - "end": 358, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 349, - "end": 355, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 351, - "end": 355, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 352, - "end": 354, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 367, - "end": 422, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 377, - "end": 385, - "ctxt": 0 - }, - "value": "Obj3type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 386, - "end": 422, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 389, - "end": 420, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 393, - "end": 402, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 394, - "end": 402, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 396, - "end": 402, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 403, - "end": 419, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 405, - "end": 419, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 407, - "end": 417, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 407, - "end": 408, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 408, - "end": 416, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 410, - "end": 416, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 423, - "end": 442, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 427, - "end": 441, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 427, - "end": 431, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 431, - "end": 441, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 433, - "end": 441, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 433, - "end": 441, - "ctxt": 0 - }, - "value": "Obj3type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 443, - "end": 459, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 443, - "end": 458, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 444, - "end": 448, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 443, - "end": 458, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 449, - "end": 455, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 449, - "end": 450, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 451, - "end": 455, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 452, - "end": 454, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 469, - "end": 489, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 473, - "end": 488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 473, - "end": 483, - "ctxt": 0 - }, - "value": "attributes", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 483, - "end": 488, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 485, - "end": 488, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 490, - "end": 515, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 490, - "end": 514, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 491, - "end": 495, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 490, - "end": 514, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 497, - "end": 500, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 500, - "end": 510, - "ctxt": 0 - }, - "value": "attributes", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 525, - "end": 542, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 525, - "end": 541, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 525, - "end": 541, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 532, - "end": 535, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 535, - "end": 537, - "ctxt": 0 - }, - "properties": [] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 550, - "end": 624, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 560, - "end": 568, - "ctxt": 0 - }, - "value": "Obj4type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 569, - "end": 624, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 572, - "end": 622, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 576, - "end": 585, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 577, - "end": 585, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 579, - "end": 585, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 586, - "end": 621, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 588, - "end": 621, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 590, - "end": 600, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 590, - "end": 591, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 591, - "end": 599, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 593, - "end": 599, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 601, - "end": 619, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 601, - "end": 603, - "ctxt": 0 - }, - "value": "pr", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 603, - "end": 619, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 605, - "end": 619, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 607, - "end": 617, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 607, - "end": 608, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 608, - "end": 616, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 610, - "end": 616, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 625, - "end": 644, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 629, - "end": 643, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 629, - "end": 633, - "ctxt": 0 - }, - "value": "Obj4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 633, - "end": 643, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 635, - "end": 643, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 635, - "end": 643, - "ctxt": 0 - }, - "value": "Obj4type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 645, - "end": 661, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 645, - "end": 660, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 646, - "end": 650, - "ctxt": 0 - }, - "value": "Obj4", - "optional": false - }, - "span": { - "start": 645, - "end": 660, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 651, - "end": 657, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 653, - "end": 657, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 654, - "end": 656, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 668, - "end": 686, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 668, - "end": 685, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 669, - "end": 673, - "ctxt": 0 - }, - "value": "Obj4", - "optional": false - }, - "span": { - "start": 668, - "end": 685, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 674, - "end": 682, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 674, - "end": 675, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 676, - "end": 682, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 677, - "end": 681, - "ctxt": 0 - }, - "value": "10", - "raw": "'10'" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution13.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution13.json deleted file mode 100644 index cc7c5e2d82b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution13.json +++ /dev/null @@ -1,404 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 220, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 145, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 145, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 120, - "end": 143, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 122, - "end": 131, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 125, - "ctxt": 0 - }, - "value": "pr1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 125, - "end": 130, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 127, - "end": 130, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 132, - "end": 141, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "pr2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 140, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 147, - "end": 187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 157, - "end": 161, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 162, - "end": 187, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 165, - "end": 185, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 169, - "end": 178, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 172, - "end": 178, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 184, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 188, - "end": 203, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 192, - "end": 202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 192, - "end": 196, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 198, - "end": 202, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 198, - "end": 202, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 204, - "end": 220, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 204, - "end": 219, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 205, - "end": 209, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "span": { - "start": 204, - "end": 219, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 210, - "end": 216, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 213, - "end": 215, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution14.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution14.json deleted file mode 100644 index 331d491e58f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution14.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 158, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 84, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 84, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 86, - "end": 125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 96, - "end": 100, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 101, - "end": 125, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 104, - "end": 123, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 108, - "end": 117, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 109, - "end": 117, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 111, - "end": 117, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 118, - "end": 122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 120, - "end": 122, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 126, - "end": 141, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 130, - "end": 140, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 142, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 142, - "end": 157, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 143, - "end": 147, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "span": { - "start": 142, - "end": 157, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 150, - "end": 154, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 151, - "end": 153, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution15.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution15.json deleted file mode 100644 index 4a7ba0bd792..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution15.json +++ /dev/null @@ -1,434 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 260, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 178, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 178, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 119, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 120, - "end": 143, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 122, - "end": 131, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 122, - "end": 125, - "ctxt": 0 - }, - "value": "pr1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 125, - "end": 130, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 127, - "end": 130, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 132, - "end": 141, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "pr2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 140, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 145, - "end": 176, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 172, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 173, - "end": 176, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 180, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 190, - "end": 198, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 199, - "end": 223, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 202, - "end": 221, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 206, - "end": 215, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 207, - "end": 215, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 209, - "end": 215, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 216, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 218, - "end": 220, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 224, - "end": 243, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 228, - "end": 242, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 228, - "end": 232, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 234, - "end": 242, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 234, - "end": 242, - "ctxt": 0 - }, - "value": "Obj1type", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 244, - "end": 260, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 244, - "end": 259, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 245, - "end": 249, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 244, - "end": 259, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 250, - "end": 256, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 250, - "end": 251, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 253, - "end": 255, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution16.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution16.json deleted file mode 100644 index 167399d2ee8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution16.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 62, - "end": 158, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 62, - "end": 84, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 77, - "end": 80, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 81, - "end": 84, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 86, - "end": 125, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 96, - "end": 100, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 101, - "end": 125, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 104, - "end": 123, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 108, - "end": 117, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 109, - "end": 117, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 111, - "end": 117, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 118, - "end": 122, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 120, - "end": 122, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 126, - "end": 141, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 130, - "end": 140, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 134, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 136, - "end": 140, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 142, - "end": 158, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 142, - "end": 157, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 143, - "end": 147, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - }, - "span": { - "start": 142, - "end": 157, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 150, - "end": 154, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 151, - "end": 153, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution17.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution17.json deleted file mode 100644 index 80949d2561d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution17.json +++ /dev/null @@ -1,343 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 55, - "end": 420, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 55, - "end": 133, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 70, - "end": 73, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 74, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 77, - "end": 98, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 87, - "end": 94, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 95, - "end": 98, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 100, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 110, - "end": 127, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 135, - "end": 188, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 150, - "end": 161, - "ctxt": 0 - }, - "value": "elements1", - "raw": "'elements1'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 162, - "end": 188, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "value": "MyElement", - "optional": false - }, - "declare": false, - "span": { - "start": 165, - "end": 186, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 190, - "end": 243, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 205, - "end": 216, - "ctxt": 0 - }, - "value": "elements2", - "raw": "'elements2'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 217, - "end": 243, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 226, - "end": 235, - "ctxt": 0 - }, - "value": "MyElement", - "optional": false - }, - "declare": false, - "span": { - "start": 220, - "end": 241, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 335, - "end": 368, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 342, - "end": 344, - "ctxt": 0 - }, - "value": "s1", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 347, - "end": 367, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 355, - "end": 366, - "ctxt": 0 - }, - "value": "elements1", - "raw": "'elements1'" - } - } - }, - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 369, - "end": 402, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 376, - "end": 378, - "ctxt": 0 - }, - "value": "s2", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 381, - "end": 401, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 389, - "end": 400, - "ctxt": 0 - }, - "value": "elements2", - "raw": "'elements2'" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 403, - "end": 420, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 403, - "end": 419, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 404, - "end": 406, - "ctxt": 0 - }, - "value": "s1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 407, - "end": 416, - "ctxt": 0 - }, - "value": "MyElement", - "optional": false - } - }, - "span": { - "start": 403, - "end": 419, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution18.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution18.json deleted file mode 100644 index e2a9b7fb9f4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution18.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 63, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 63, - "end": 108, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 78, - "end": 81, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 82, - "end": 108, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 85, - "end": 106, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 95, - "end": 102, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 103, - "end": 106, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 138, - "end": 152, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 138, - "end": 151, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 139, - "end": 142, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 138, - "end": 151, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 143, - "end": 148, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 143, - "end": 144, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 145, - "end": 148, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution19.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution19.json deleted file mode 100644 index 383c02e9f4d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution19.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 54, - "end": 316, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 54, - "end": 81, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 69, - "end": 76, - "ctxt": 0 - }, - "value": "react", - "raw": "\"react\"" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 77, - "end": 81, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 106, - "end": 154, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 121, - "end": 124, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 125, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 131, - "end": 152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 141, - "end": 148, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 155, - "end": 179, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 168, - "end": 175, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "declare": false, - "span": { - "start": 162, - "end": 179, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 238, - "end": 269, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 245, - "end": 255, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 250, - "end": 255, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 261, - "end": 268, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 270, - "end": 302, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 278, - "end": 285, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 278, - "end": 285, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "value": "./file1", - "raw": "'./file1'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExpressionStatement", - "span": { - "start": 304, - "end": 316, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 304, - "end": 315, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 305, - "end": 312, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 304, - "end": 315, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution2.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution2.json deleted file mode 100644 index 7bc912ab2dd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution2.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 174, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 141, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 141, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 139, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 123, - "end": 129, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 130, - "end": 135, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 119, - "end": 136, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 149, - "end": 157, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 149, - "end": 156, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 150, - "end": 153, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 149, - "end": 156, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 165, - "end": 174, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 165, - "end": 173, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 165, - "end": 173, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution3.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution3.json deleted file mode 100644 index c7bf67078cf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution3.json +++ /dev/null @@ -1,336 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 202, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 152, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 150, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 150, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 120, - "end": 129, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 123, - "end": 129, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 132, - "end": 146, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 134, - "end": 144, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "readonly": false, - "static": false, - "span": { - "start": 119, - "end": 147, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 160, - "end": 174, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 160, - "end": 173, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 161, - "end": 164, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 160, - "end": 173, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 185, - "end": 202, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 185, - "end": 201, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 186, - "end": 190, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 185, - "end": 201, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 191, - "end": 198, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "w", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 193, - "end": 198, - "ctxt": 0 - }, - "value": "err", - "raw": "'err'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution4.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution4.json deleted file mode 100644 index 3fd416e1e6c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution4.json +++ /dev/null @@ -1,472 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 242, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 171, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 171, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 169, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 119, - "end": 139, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 122, - "end": 138, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 124, - "end": 138, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 126, - "end": 136, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 126, - "end": 127, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 135, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 135, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 145, - "end": 166, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 145, - "end": 149, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 149, - "end": 165, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 151, - "end": 165, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 153, - "end": 163, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 153, - "end": 154, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 154, - "end": 162, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 156, - "end": 162, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 179, - "end": 193, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 179, - "end": 192, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 179, - "end": 192, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 184, - "end": 189, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 184, - "end": 185, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 186, - "end": 189, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 201, - "end": 217, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 201, - "end": 216, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 206, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 201, - "end": 216, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 207, - "end": 213, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 209, - "end": 213, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 228, - "end": 242, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 228, - "end": 241, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 229, - "end": 233, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 228, - "end": 241, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 236, - "end": 238, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution5.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution5.json deleted file mode 100644 index 03cc2dceedb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution5.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 40, - "end": 125, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 40, - "end": 85, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 55, - "end": 58, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 59, - "end": 85, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 62, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 79, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 80, - "end": 83, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 111, - "end": 125, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 111, - "end": 124, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 111, - "end": 124, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 116, - "end": 117, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 118, - "end": 121, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution6.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution6.json deleted file mode 100644 index eb89c7cdc49..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution6.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 165, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 117, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 117, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 119, - "end": 132, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 123, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 123, - "end": 126, - "ctxt": 0 - }, - "value": "div", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 126, - "end": 131, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 128, - "end": 131, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 151, - "end": 165, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 151, - "end": 164, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 151, - "end": 164, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 156, - "end": 161, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 156, - "end": 157, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 158, - "end": 161, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution7.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution7.json deleted file mode 100644 index e4f04327c54..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution7.json +++ /dev/null @@ -1,515 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 305, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 117, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 117, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 119, - "end": 157, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 126, - "end": 128, - "ctxt": 0 - }, - "value": "my", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 129, - "end": 157, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 135, - "end": 155, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 142, - "end": 155, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 146, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 149, - "ctxt": 0 - }, - "value": "div", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 151, - "end": 154, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 164, - "end": 181, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 164, - "end": 180, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 165, - "end": 167, - "ctxt": 0 - }, - "value": "my", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - }, - "span": { - "start": 164, - "end": 180, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 172, - "end": 173, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 191, - "end": 204, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 191, - "end": 203, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 192, - "end": 194, - "ctxt": 0 - }, - "value": "my", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 195, - "end": 200, - "ctxt": 0 - }, - "value": "other", - "optional": false - } - }, - "span": { - "start": 191, - "end": 203, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 206, - "end": 305, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "value": "q", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 215, - "end": 305, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 221, - "end": 238, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 228, - "end": 232, - "ctxt": 0 - }, - "value": "mine", - "optional": false - }, - "moduleRef": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "my", - "optional": false - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 253, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 253, - "end": 271, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 254, - "end": 258, - "ctxt": 0 - }, - "value": "mine", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 259, - "end": 262, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - }, - "span": { - "start": 253, - "end": 271, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 265, - "end": 268, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 290, - "end": 303, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 290, - "end": 302, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 291, - "end": 295, - "ctxt": 0 - }, - "value": "mine", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 296, - "end": 299, - "ctxt": 0 - }, - "value": "non", - "optional": false - } - }, - "span": { - "start": 290, - "end": 302, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution8.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution8.json deleted file mode 100644 index 0b30082512b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution8.json +++ /dev/null @@ -1,861 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 480, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 117, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 117, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 115, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 128, - "end": 140, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 132, - "end": 139, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "Div", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": 3.0 - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 141, - "end": 149, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 141, - "end": 148, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "value": "Div", - "optional": false - }, - "span": { - "start": 141, - "end": 148, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 166, - "end": 170, - "ctxt": 0 - }, - "value": "Fact", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 157, - "end": 194, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 178, - "end": 194, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 180, - "end": 192, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 187, - "end": 191, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 195, - "end": 203, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 195, - "end": 203, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 196, - "end": 200, - "ctxt": 0 - }, - "value": "Fact", - "optional": false - }, - "span": { - "start": 195, - "end": 203, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "value": "Fnum", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 214, - "end": 251, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 237, - "end": 251, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 239, - "end": 249, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 246, - "end": 248, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 229, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 231, - "end": 237, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 252, - "end": 260, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 252, - "end": 260, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 253, - "end": 257, - "ctxt": 0 - }, - "value": "Fnum", - "optional": false - }, - "span": { - "start": 252, - "end": 260, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 262, - "end": 305, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 272, - "end": 276, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 277, - "end": 305, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 280, - "end": 290, - "ctxt": 0 - }, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 285, - "end": 289, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 287, - "end": 289, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - }, - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 292, - "end": 303, - "ctxt": 0 - }, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 302, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 296, - "end": 302, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 306, - "end": 321, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 310, - "end": 320, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 310, - "end": 314, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 314, - "end": 320, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 322, - "end": 331, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 327, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 368, - "end": 399, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 378, - "end": 382, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 383, - "end": 399, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 386, - "end": 397, - "ctxt": 0 - }, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 396, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 390, - "end": 396, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 400, - "end": 415, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 404, - "end": 414, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 404, - "end": 408, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 408, - "end": 414, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 410, - "end": 414, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 410, - "end": 414, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 416, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 421, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "span": { - "start": 416, - "end": 424, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 436, - "end": 454, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 446, - "end": 450, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 455, - "end": 470, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 459, - "end": 469, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 459, - "end": 463, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 465, - "end": 469, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 465, - "end": 469, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 471, - "end": 480, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 471, - "end": 479, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 472, - "end": 476, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 471, - "end": 479, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution9.json b/crates/swc_ecma_parser/tests/tsc/tsxElementResolution9.json deleted file mode 100644 index a8ba65a7319..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxElementResolution9.json +++ /dev/null @@ -1,1173 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 552, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 128, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 128, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 93, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 93, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 81, - "end": 91, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 81, - "end": 90, - "ctxt": 0 - }, - "value": "something", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 95, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 105, - "end": 122, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 123, - "end": 126, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 130, - "end": 212, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 140, - "end": 144, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 145, - "end": 212, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 148, - "end": 178, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 152, - "end": 161, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 162, - "end": 177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 164, - "end": 177, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 167, - "end": 175, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 169, - "end": 175, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 180, - "end": 210, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 184, - "end": 193, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 185, - "end": 193, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 209, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 196, - "end": 209, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 198, - "end": 207, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 198, - "end": 199, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 199, - "end": 207, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 201, - "end": 207, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 213, - "end": 228, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 217, - "end": 227, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 221, - "end": 227, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 229, - "end": 238, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 229, - "end": 237, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "value": "Obj1", - "optional": false - }, - "span": { - "start": 229, - "end": 237, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 284, - "end": 360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 299, - "end": 360, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 302, - "end": 329, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 304, - "end": 312, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 306, - "end": 312, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 328, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 315, - "end": 328, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 317, - "end": 326, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 318, - "end": 326, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 320, - "end": 326, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 331, - "end": 358, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 332, - "end": 341, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 333, - "end": 341, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 335, - "end": 341, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 342, - "end": 357, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 344, - "end": 357, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 346, - "end": 355, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 347, - "end": 355, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 349, - "end": 355, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 361, - "end": 376, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 365, - "end": 375, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 365, - "end": 369, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 369, - "end": 375, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 371, - "end": 375, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 371, - "end": 375, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 377, - "end": 386, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 377, - "end": 385, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 378, - "end": 382, - "ctxt": 0 - }, - "value": "Obj2", - "optional": false - }, - "span": { - "start": 377, - "end": 385, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 432, - "end": 519, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 442, - "end": 446, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 447, - "end": 519, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 450, - "end": 477, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 451, - "end": 460, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 452, - "end": 460, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 454, - "end": 460, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 461, - "end": 476, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 463, - "end": 476, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 465, - "end": 474, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 465, - "end": 466, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 466, - "end": 474, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 468, - "end": 474, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 479, - "end": 517, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 480, - "end": 489, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 481, - "end": 489, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 483, - "end": 489, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 490, - "end": 516, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 492, - "end": 516, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 494, - "end": 504, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 495, - "end": 503, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 497, - "end": 503, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 505, - "end": 514, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 505, - "end": 506, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 506, - "end": 514, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 520, - "end": 535, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 524, - "end": 534, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 524, - "end": 528, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 528, - "end": 534, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 536, - "end": 552, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 536, - "end": 551, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 537, - "end": 541, - "ctxt": 0 - }, - "value": "Obj3", - "optional": false - }, - "span": { - "start": 536, - "end": 551, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 542, - "end": 548, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 542, - "end": 543, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 544, - "end": 548, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 545, - "end": 547, - "ctxt": 0 - }, - "value": 42.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxEmit1.json b/crates/swc_ecma_parser/tests/tsc/tsxEmit1.json deleted file mode 100644 index a975a8c0b0c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxEmit1.json +++ /dev/null @@ -1,2742 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 1018, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 138, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 138, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 136, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 117, - "end": 126, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 118, - "end": 126, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 120, - "end": 126, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 132, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 116, - "end": 133, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 140, - "end": 146, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 147, - "end": 173, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 151, - "end": 172, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 151, - "end": 162, - "ctxt": 0 - }, - "value": "selfClosed1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 166, - "end": 169, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 174, - "end": 206, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 178, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 178, - "end": 189, - "ctxt": 0 - }, - "value": "selfClosed2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 192, - "end": 205, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 193, - "end": 196, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 192, - "end": 205, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 197, - "end": 202, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 199, - "end": 202, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 207, - "end": 239, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 211, - "end": 238, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 211, - "end": 222, - "ctxt": 0 - }, - "value": "selfClosed3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 225, - "end": 238, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 226, - "end": 229, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 225, - "end": 238, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 230, - "end": 235, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 232, - "end": 235, - "ctxt": 0 - }, - "value": "1", - "raw": "'1'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 240, - "end": 278, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 244, - "end": 277, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 244, - "end": 255, - "ctxt": 0 - }, - "value": "selfClosed4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 258, - "end": 277, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 259, - "end": 262, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 258, - "end": 277, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 265, - "end": 268, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 269, - "end": 274, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 271, - "end": 274, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 279, - "end": 317, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 283, - "end": 316, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 283, - "end": 294, - "ctxt": 0 - }, - "value": "selfClosed5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 297, - "end": 316, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 297, - "end": 316, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 302, - "end": 307, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 308, - "end": 313, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 310, - "end": 313, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 358, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 322, - "end": 357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 322, - "end": 333, - "ctxt": 0 - }, - "value": "selfClosed6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 336, - "end": 357, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 337, - "end": 340, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 336, - "end": 357, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 341, - "end": 348, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 343, - "end": 348, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 344, - "end": 347, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 349, - "end": 354, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 349, - "end": 350, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 351, - "end": 354, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 359, - "end": 397, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 363, - "end": 396, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 363, - "end": 374, - "ctxt": 0 - }, - "value": "selfClosed7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 377, - "end": 396, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 378, - "end": 381, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 377, - "end": 396, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 382, - "end": 387, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 383, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 384, - "end": 387, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 385, - "end": 386, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 388, - "end": 389, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": "p", - "raw": "'p'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 399, - "end": 429, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 403, - "end": 428, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 403, - "end": 414, - "ctxt": 0 - }, - "value": "openClosed1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 417, - "end": 428, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 421, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 422, - "end": 428, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 424, - "end": 427, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 430, - "end": 469, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 434, - "end": 468, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 434, - "end": 445, - "ctxt": 0 - }, - "value": "openClosed2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 448, - "end": 468, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 449, - "end": 452, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 448, - "end": 459, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 453, - "end": 458, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 453, - "end": 454, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 455, - "end": 458, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 459, - "end": 462, - "ctxt": 0 - }, - "value": "foo", - "raw": "foo" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 462, - "end": 468, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 464, - "end": 467, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 470, - "end": 509, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 474, - "end": 508, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 474, - "end": 485, - "ctxt": 0 - }, - "value": "openClosed3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 488, - "end": 508, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 489, - "end": 492, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 488, - "end": 499, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 493, - "end": 498, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 493, - "end": 494, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 495, - "end": 498, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 499, - "end": 502, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 502, - "end": 508, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 504, - "end": 507, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 510, - "end": 553, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 514, - "end": 552, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 514, - "end": 525, - "ctxt": 0 - }, - "value": "openClosed4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 528, - "end": 552, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 529, - "end": 532, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 528, - "end": 539, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 533, - "end": 538, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 533, - "end": 534, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 535, - "end": 538, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 539, - "end": 546, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 540, - "end": 545, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 540, - "end": 541, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 544, - "end": 545, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 546, - "end": 552, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 548, - "end": 551, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 554, - "end": 597, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 558, - "end": 596, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 558, - "end": 569, - "ctxt": 0 - }, - "value": "openClosed5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 572, - "end": 596, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 573, - "end": 576, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 572, - "end": 583, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 577, - "end": 582, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 577, - "end": 578, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 579, - "end": 582, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 583, - "end": 590, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 584, - "end": 589, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 584, - "end": 585, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 588, - "end": 589, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 590, - "end": 596, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 592, - "end": 595, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 605, - "end": 614, - "ctxt": 0 - }, - "value": "SomeClass", - "optional": false - }, - "declare": false, - "span": { - "start": 599, - "end": 886, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 618, - "end": 884, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 618, - "end": 619, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 618, - "end": 884, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 622, - "end": 884, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 626, - "end": 666, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 630, - "end": 665, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "value": "rewrites1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 642, - "end": 665, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 643, - "end": 646, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 642, - "end": 647, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 647, - "end": 659, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 648, - "end": 658, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 654, - "end": 658, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 659, - "end": 665, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 661, - "end": 664, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 669, - "end": 711, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 673, - "end": 710, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 673, - "end": 682, - "ctxt": 0 - }, - "value": "rewrites2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 685, - "end": 710, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 686, - "end": 689, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 685, - "end": 690, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 690, - "end": 704, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 691, - "end": 703, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 692, - "end": 693, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": { - "start": 695, - "end": 698, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 698, - "end": 699, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 701, - "end": 702, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ] - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 704, - "end": 710, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 706, - "end": 709, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 714, - "end": 747, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 718, - "end": 746, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 718, - "end": 727, - "ctxt": 0 - }, - "value": "rewrites3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 730, - "end": 746, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 731, - "end": 734, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 730, - "end": 735, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 735, - "end": 740, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 736, - "end": 739, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 737, - "end": 738, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - ] - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 740, - "end": 746, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 742, - "end": 745, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 751, - "end": 794, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 755, - "end": 793, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 755, - "end": 764, - "ctxt": 0 - }, - "value": "rewrites4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 767, - "end": 793, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 768, - "end": 771, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 767, - "end": 787, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 772, - "end": 786, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 772, - "end": 773, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 774, - "end": 786, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 775, - "end": 785, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 781, - "end": 785, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 787, - "end": 793, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 789, - "end": 792, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 797, - "end": 842, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 801, - "end": 841, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 801, - "end": 810, - "ctxt": 0 - }, - "value": "rewrites5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 813, - "end": 841, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 814, - "end": 817, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 813, - "end": 835, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 818, - "end": 834, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 818, - "end": 819, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 820, - "end": 834, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 821, - "end": 833, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 822, - "end": 823, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": { - "start": 825, - "end": 828, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 828, - "end": 829, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 831, - "end": 832, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 835, - "end": 841, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 837, - "end": 840, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 845, - "end": 881, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 849, - "end": 880, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 849, - "end": 858, - "ctxt": 0 - }, - "value": "rewrites6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 861, - "end": 880, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 862, - "end": 865, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 861, - "end": 874, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 866, - "end": 873, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 866, - "end": 867, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 868, - "end": 873, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 869, - "end": 872, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 870, - "end": 871, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 874, - "end": 880, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 876, - "end": 879, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 888, - "end": 924, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 892, - "end": 923, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 892, - "end": 903, - "ctxt": 0 - }, - "value": "whitespace1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 906, - "end": 923, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 907, - "end": 910, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 906, - "end": 911, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 911, - "end": 917, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 917, - "end": 923, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 919, - "end": 922, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 925, - "end": 964, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 929, - "end": 963, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 929, - "end": 940, - "ctxt": 0 - }, - "value": "whitespace2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 943, - "end": 963, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 944, - "end": 947, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 943, - "end": 948, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 948, - "end": 950, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 950, - "end": 953, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 951, - "end": 952, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 953, - "end": 957, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 957, - "end": 963, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 959, - "end": 962, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 965, - "end": 1018, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 969, - "end": 1017, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 969, - "end": 980, - "ctxt": 0 - }, - "value": "whitespace3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 983, - "end": 1017, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 983, - "end": 988, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 988, - "end": 997, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 997, - "end": 1000, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 998, - "end": 999, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 1000, - "end": 1011, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1011, - "end": 1017, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1013, - "end": 1016, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxEmit2.json b/crates/swc_ecma_parser/tests/tsc/tsxEmit2.json deleted file mode 100644 index 37ae0d54fc4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxEmit2.json +++ /dev/null @@ -1,1015 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 399, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 138, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 138, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 136, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 136, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 117, - "end": 126, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 118, - "end": 126, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 120, - "end": 126, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 132, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 116, - "end": 133, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 140, - "end": 170, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 144, - "end": 151, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 144, - "end": 146, - "ctxt": 0 - }, - "value": "p1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 146, - "end": 151, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 148, - "end": 151, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 153, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 153, - "end": 155, - "ctxt": 0 - }, - "value": "p2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 155, - "end": 160, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 157, - "end": 160, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 162, - "end": 169, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 162, - "end": 164, - "ctxt": 0 - }, - "value": "p3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 169, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 166, - "end": 169, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 171, - "end": 210, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 175, - "end": 209, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 175, - "end": 183, - "ctxt": 0 - }, - "value": "spreads1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 186, - "end": 209, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 186, - "end": 199, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 195, - "end": 197, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 199, - "end": 203, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 200, - "end": 202, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 203, - "end": 209, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 205, - "end": 208, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 211, - "end": 250, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 215, - "end": 249, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 215, - "end": 223, - "ctxt": 0 - }, - "value": "spreads2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 226, - "end": 249, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 227, - "end": 230, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 226, - "end": 239, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 232, - "end": 235, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 239, - "end": 243, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 240, - "end": 242, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 243, - "end": 249, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 251, - "end": 297, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 255, - "end": 296, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 255, - "end": 263, - "ctxt": 0 - }, - "value": "spreads3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 266, - "end": 296, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 266, - "end": 286, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 271, - "end": 277, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 273, - "end": 277, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 274, - "end": 276, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 282, - "end": 284, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 286, - "end": 290, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 287, - "end": 289, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 290, - "end": 296, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 298, - "end": 345, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 302, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 302, - "end": 310, - "ctxt": 0 - }, - "value": "spreads4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 313, - "end": 344, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 313, - "end": 334, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 322, - "end": 324, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 326, - "end": 332, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 328, - "end": 332, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 329, - "end": 331, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 334, - "end": 338, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 335, - "end": 337, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 338, - "end": 344, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 346, - "end": 399, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 350, - "end": 398, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 350, - "end": 358, - "ctxt": 0 - }, - "value": "spreads5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 361, - "end": 398, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 362, - "end": 365, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 361, - "end": 388, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 366, - "end": 372, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 367, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 368, - "end": 372, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 369, - "end": 371, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 377, - "end": 379, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 381, - "end": 382, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 383, - "end": 387, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 384, - "end": 386, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 388, - "end": 392, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 389, - "end": 391, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 392, - "end": 398, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxEmit3.json b/crates/swc_ecma_parser/tests/tsc/tsxEmit3.json deleted file mode 100644 index 87038a5ea34..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxEmit3.json +++ /dev/null @@ -1,763 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 59, - "end": 513, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 59, - "end": 137, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 78, - "end": 137, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 102, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 98, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 99, - "end": 102, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 104, - "end": 135, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 114, - "end": 131, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 139, - "end": 270, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 148, - "end": 270, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 151, - "end": 189, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 164, - "end": 167, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "declare": false, - "span": { - "start": 158, - "end": 189, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 170, - "end": 187, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 181, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 191, - "end": 268, - "ctxt": 0 - }, - "declaration": { - "type": "TsModuleDeclaration", - "span": { - "start": 198, - "end": 268, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 207, - "end": 268, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 211, - "end": 231, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 224, - "end": 227, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "declare": false, - "span": { - "start": 218, - "end": 231, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - } - ] - } - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 272, - "end": 403, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 279, - "end": 280, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 281, - "end": 403, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 299, - "end": 312, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 299, - "end": 311, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 299, - "end": 302, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - { - "type": "JSXElement", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 315, - "end": 400, - "ctxt": 0 - }, - "declaration": { - "type": "TsModuleDeclaration", - "span": { - "start": 322, - "end": 400, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 331, - "end": 400, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 351, - "end": 364, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 351, - "end": 363, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 351, - "end": 354, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - { - "type": "JSXElement", - "span": { - "start": 356, - "end": 363, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 356, - "end": 363, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 384, - "end": 397, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 384, - "end": 396, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 384, - "end": 387, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - { - "type": "JSXElement", - "span": { - "start": 389, - "end": 396, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "span": { - "start": 389, - "end": 396, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ] - } - } - ] - } - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 405, - "end": 453, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 412, - "end": 413, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 414, - "end": 453, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 434, - "end": 451, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 434, - "end": 450, - "ctxt": 0 - }, - "expressions": [ - { - "type": "MemberExpression", - "span": { - "start": 434, - "end": 439, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 434, - "end": 435, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 436, - "end": 439, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - }, - { - "type": "JSXElement", - "span": { - "start": 441, - "end": 450, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 442, - "end": 443, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - }, - "span": { - "start": 441, - "end": 450, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 455, - "end": 513, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 464, - "end": 513, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 467, - "end": 479, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 471, - "end": 478, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 471, - "end": 472, - "ctxt": 0 - }, - "value": "M", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "value": 100.0 - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 498, - "end": 511, - "ctxt": 0 - }, - "expression": { - "type": "SequenceExpression", - "span": { - "start": 498, - "end": 510, - "ctxt": 0 - }, - "expressions": [ - { - "type": "Identifier", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - { - "type": "JSXElement", - "span": { - "start": 503, - "end": 510, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 504, - "end": 507, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 503, - "end": 510, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ] - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.json b/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.json deleted file mode 100644 index 31f6443119c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.json +++ /dev/null @@ -1,1832 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 73, - "end": 763, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 73, - "end": 98, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 87, - "end": 97, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 87, - "end": 92, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 92, - "end": 97, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 94, - "end": 97, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 100, - "end": 182, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 116, - "end": 118, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 119, - "end": 125, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 120, - "end": 125, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 122, - "end": 125, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 107, - "end": 182, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 127, - "end": 182, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 133, - "end": 180, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 140, - "end": 179, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 141, - "end": 144, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 140, - "end": 171, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 145, - "end": 161, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 145, - "end": 154, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 155, - "end": 161, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 156, - "end": 160, - "ctxt": 0 - }, - "value": "T1", - "raw": "\"T1\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 164, - "end": 167, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 171, - "end": 173, - "ctxt": 0 - }, - "value": "T1", - "raw": "T1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 184, - "end": 283, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 200, - "end": 202, - "ctxt": 0 - }, - "value": "T2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 203, - "end": 209, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 203, - "end": 209, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 209, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 211, - "end": 217, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 211, - "end": 217, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 217, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 191, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 219, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 225, - "end": 281, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 232, - "end": 280, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 233, - "end": 236, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 232, - "end": 272, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 237, - "end": 253, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 237, - "end": 246, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 247, - "end": 253, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 248, - "end": 252, - "ctxt": 0 - }, - "value": "T2", - "raw": "\"T2\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 256, - "end": 259, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 259, - "end": 260, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 265, - "end": 268, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 268, - "end": 269, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 272, - "end": 274, - "ctxt": 0 - }, - "value": "T2", - "raw": "T2" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 274, - "end": 280, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 276, - "end": 279, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 285, - "end": 384, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 301, - "end": 303, - "ctxt": 0 - }, - "value": "T3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 305, - "end": 310, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 312, - "end": 318, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 312, - "end": 318, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 318, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 315, - "end": 318, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 292, - "end": 384, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 320, - "end": 384, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 326, - "end": 382, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 333, - "end": 381, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 334, - "end": 337, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 333, - "end": 373, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 347, - "end": 363, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 347, - "end": 356, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 357, - "end": 363, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 358, - "end": 362, - "ctxt": 0 - }, - "value": "T3", - "raw": "\"T3\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 366, - "end": 369, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 369, - "end": 370, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 373, - "end": 375, - "ctxt": 0 - }, - "value": "T3", - "raw": "T3" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 375, - "end": 381, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 386, - "end": 489, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 402, - "end": 404, - "ctxt": 0 - }, - "value": "T4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 405, - "end": 411, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 405, - "end": 411, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 406, - "end": 411, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 408, - "end": 411, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 414, - "end": 419, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 416, - "end": 419, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 393, - "end": 489, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 421, - "end": 489, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 427, - "end": 487, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 434, - "end": 486, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 435, - "end": 438, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 434, - "end": 478, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 439, - "end": 455, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 439, - "end": 448, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 449, - "end": 455, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 450, - "end": 454, - "ctxt": 0 - }, - "value": "T4", - "raw": "\"T4\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 458, - "end": 461, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 461, - "end": 475, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 463, - "end": 466, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 466, - "end": 467, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 469, - "end": 472, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 478, - "end": 480, - "ctxt": 0 - }, - "value": "T4", - "raw": "T4" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 480, - "end": 486, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 491, - "end": 623, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 507, - "end": 509, - "ctxt": 0 - }, - "value": "T5", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 510, - "end": 516, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 510, - "end": 516, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 511, - "end": 516, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 513, - "end": 516, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 518, - "end": 524, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 518, - "end": 524, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 519, - "end": 524, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 521, - "end": 524, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 526, - "end": 532, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 526, - "end": 532, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 527, - "end": 532, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 529, - "end": 532, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 534, - "end": 540, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 534, - "end": 540, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 535, - "end": 540, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 537, - "end": 540, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 498, - "end": 623, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 542, - "end": 623, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 548, - "end": 621, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 555, - "end": 620, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 556, - "end": 559, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 555, - "end": 612, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 560, - "end": 576, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 560, - "end": 569, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 570, - "end": 576, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 571, - "end": 575, - "ctxt": 0 - }, - "value": "T5", - "raw": "\"T5\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 579, - "end": 582, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 582, - "end": 609, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 584, - "end": 587, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 587, - "end": 588, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 590, - "end": 593, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 593, - "end": 594, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 596, - "end": 599, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 599, - "end": 607, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 601, - "end": 602, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - ] - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 612, - "end": 614, - "ctxt": 0 - }, - "value": "T5", - "raw": "T5" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 614, - "end": 620, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 616, - "end": 619, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 625, - "end": 763, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 641, - "end": 643, - "ctxt": 0 - }, - "value": "T6", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 644, - "end": 650, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 644, - "end": 650, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 645, - "end": 650, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 647, - "end": 650, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 652, - "end": 658, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 652, - "end": 658, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 653, - "end": 658, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 655, - "end": 658, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 660, - "end": 666, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 660, - "end": 666, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 661, - "end": 666, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 663, - "end": 666, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 668, - "end": 674, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 668, - "end": 674, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 669, - "end": 674, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 671, - "end": 674, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 632, - "end": 763, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 676, - "end": 763, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 682, - "end": 761, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 689, - "end": 760, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 690, - "end": 693, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 689, - "end": 752, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 694, - "end": 710, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 694, - "end": 703, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 704, - "end": 710, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 705, - "end": 709, - "ctxt": 0 - }, - "value": "T6", - "raw": "\"T6\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 713, - "end": 716, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 716, - "end": 749, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 718, - "end": 721, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 721, - "end": 722, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 724, - "end": 727, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 727, - "end": 728, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 730, - "end": 733, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 733, - "end": 747, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 735, - "end": 738, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 738, - "end": 739, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 741, - "end": 744, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 744, - "end": 745, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - } - ] - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 752, - "end": 754, - "ctxt": 0 - }, - "value": "T6", - "raw": "T6" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 754, - "end": 760, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 756, - "end": 759, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.ts b/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.ts deleted file mode 100644 index 4ddebfcb121..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxEmitSpreadAttribute.ts +++ /dev/null @@ -1,29 +0,0 @@ -// @jsx: react -// @target: es2015,es2018,esnext -// @filename: test.tsx - -declare const React: any; - -export function T1(a: any) { - return

; -} - -export function T2(a: any, b: any) { - return
T2
; -} - -export function T3(a: any, b: any) { - return
T3
; -} - -export function T4(a: any, b: any) { - return
T4
; -} - -export function T5(a: any, b: any, c: any, d: any) { - return
T5
; -} - -export function T6(a: any, b: any, c: any, d: any) { - return
T6
; -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxErrorRecovery1.tsx b/crates/swc_ecma_parser/tests/tsc/tsxErrorRecovery1.tsx deleted file mode 100644 index 2b66b8f3712..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxErrorRecovery1.tsx +++ /dev/null @@ -1,10 +0,0 @@ -//@filename: file.tsx -//@jsx: preserve - -declare namespace JSX { interface Element { } } - -function foo() { - var x =
{
-} -// Shouldn't see any errors down here -var y = { a: 1 }; diff --git a/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit1.json b/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit1.json deleted file mode 100644 index 76e468ef968..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit1.json +++ /dev/null @@ -1,620 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 62, - "end": 549, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 62, - "end": 115, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 77, - "end": 84, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 85, - "end": 115, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 94, - "end": 103, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 88, - "end": 113, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 103, - "end": 109, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 104, - "end": 105, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 104, - "end": 105, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 107, - "end": 108, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 138, - "end": 169, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 145, - "end": 155, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 150, - "end": 155, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 161, - "end": 168, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ImportDeclaration", - "span": { - "start": 225, - "end": 259, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 248, - "end": 258, - "ctxt": 0 - }, - "value": "./button", - "raw": "'./button'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 261, - "end": 365, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 274, - "end": 277, - "ctxt": 0 - }, - "value": "App", - "optional": false - }, - "declare": false, - "span": { - "start": 268, - "end": 365, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 319, - "end": 362, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 319, - "end": 325, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 319, - "end": 362, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 328, - "end": 362, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 338, - "end": 356, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 345, - "end": 355, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 346, - "end": 352, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "span": { - "start": 345, - "end": 355, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 286, - "end": 301, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 301, - "end": 311, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 302, - "end": 305, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 391, - "end": 422, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "span": { - "start": 398, - "end": 408, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 403, - "end": 408, - "ctxt": 0 - }, - "value": "React", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 414, - "end": 421, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "ExportDeclaration", - "span": { - "start": 424, - "end": 549, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 437, - "end": 443, - "ctxt": 0 - }, - "value": "Button", - "optional": false - }, - "declare": false, - "span": { - "start": 431, - "end": 549, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 485, - "end": 546, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 485, - "end": 491, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 485, - "end": 546, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 494, - "end": 546, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 504, - "end": 540, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 511, - "end": 539, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 512, - "end": 518, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 511, - "end": 519, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 519, - "end": 530, - "ctxt": 0 - }, - "value": "Some button", - "raw": "Some button" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 530, - "end": 539, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 532, - "end": 538, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 452, - "end": 467, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 452, - "end": 457, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 458, - "end": 467, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 467, - "end": 477, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 468, - "end": 471, - "ctxt": 0 - }, - "kind": "any" - }, - { - "type": "TsKeywordType", - "span": { - "start": 473, - "end": 476, - "ctxt": 0 - }, - "kind": "any" - } - ] - }, - "implements": [] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit2.json b/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit2.json deleted file mode 100644 index 68b3de37041..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxExternalModuleEmit2.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 61, - "end": 328, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 61, - "end": 119, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 76, - "end": 81, - "ctxt": 0 - }, - "value": "mod", - "raw": "'mod'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 82, - "end": 119, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 86, - "end": 97, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 90, - "end": 96, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 90, - "end": 91, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 91, - "end": 96, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 93, - "end": 96, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDefaultExpression", - "span": { - "start": 100, - "end": 117, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "y", - "optional": false - } - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 142, - "end": 165, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - }, - "value": "Main", - "optional": false - } - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 159, - "end": 164, - "ctxt": 0 - }, - "value": "mod", - "raw": "'mod'" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 166, - "end": 189, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 234, - "end": 261, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 234, - "end": 260, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 234, - "end": 254, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 239, - "end": 253, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 239, - "end": 246, - "ctxt": 0 - }, - "value": "handler", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 247, - "end": 253, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 248, - "end": 252, - "ctxt": 0 - }, - "value": "Main", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 254, - "end": 260, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 256, - "end": 259, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 306, - "end": 328, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 306, - "end": 327, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 306, - "end": 321, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 315, - "end": 319, - "ctxt": 0 - }, - "value": "Main", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 321, - "end": 327, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxFragmentErrors.tsx b/crates/swc_ecma_parser/tests/tsc/tsxFragmentErrors.tsx deleted file mode 100644 index b35cd7f530d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxFragmentErrors.tsx +++ /dev/null @@ -1,14 +0,0 @@ -//@filename: file.tsx -//@jsx: react - -declare module JSX { - interface Element { } - interface IntrinsicElements { - [s: string]: any; - } -} -declare var React: any; - -<>hi
// Error - -<>eof // Error \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/tsxFragmentPreserveEmit.json b/crates/swc_ecma_parser/tests/tsc/tsxFragmentPreserveEmit.json deleted file mode 100644 index 42a55ab07d0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxFragmentPreserveEmit.json +++ /dev/null @@ -1,842 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 40, - "end": 462, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 40, - "end": 139, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 55, - "end": 58, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 59, - "end": 139, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 62, - "end": 83, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 79, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 80, - "end": 83, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 85, - "end": 137, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 95, - "end": 112, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 113, - "end": 137, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 118, - "end": 127, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 119, - "end": 127, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 121, - "end": 127, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 128, - "end": 133, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 130, - "end": 133, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 117, - "end": 134, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 140, - "end": 163, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 152, - "end": 162, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 152, - "end": 157, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 157, - "end": 162, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 159, - "end": 162, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 165, - "end": 171, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 165, - "end": 167, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 189, - "end": 202, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 189, - "end": 201, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 189, - "end": 195, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 195, - "end": 201, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 225, - "end": 266, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 225, - "end": 265, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 225, - "end": 246, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 246, - "end": 265, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 291, - "end": 299, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 291, - "end": 298, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 291, - "end": 293, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 293, - "end": 295, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 295, - "end": 298, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 315, - "end": 350, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 315, - "end": 349, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 315, - "end": 317, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 317, - "end": 332, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 322, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 317, - "end": 323, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 323, - "end": 325, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 325, - "end": 332, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 327, - "end": 331, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 332, - "end": 346, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 333, - "end": 336, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 332, - "end": 337, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 337, - "end": 340, - "ctxt": 0 - }, - "value": "bye", - "raw": "bye" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 342, - "end": 345, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 363, - "end": 434, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 363, - "end": 433, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 363, - "end": 365, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 365, - "end": 379, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 365, - "end": 371, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 371, - "end": 372, - "ctxt": 0 - }, - "value": "1", - "raw": "1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 372, - "end": 379, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 374, - "end": 378, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXFragment", - "span": { - "start": 379, - "end": 416, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 379, - "end": 381, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 381, - "end": 397, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 387, - "end": 390, - "ctxt": 0 - }, - "value": "2.1", - "raw": "2.1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 390, - "end": 397, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 392, - "end": 396, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 397, - "end": 413, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 402, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 397, - "end": 403, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 403, - "end": 406, - "ctxt": 0 - }, - "value": "2.2", - "raw": "2.2" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 406, - "end": 413, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 408, - "end": 412, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 413, - "end": 416, - "ctxt": 0 - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 416, - "end": 430, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 421, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 416, - "end": 422, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 422, - "end": 423, - "ctxt": 0 - }, - "value": "3", - "raw": "3" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 423, - "end": 430, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 425, - "end": 429, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 430, - "end": 433, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 455, - "end": 462, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 455, - "end": 461, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 455, - "end": 457, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 457, - "end": 458, - "ctxt": 0 - }, - "value": "#", - "raw": "#" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 458, - "end": 461, - "ctxt": 0 - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxFragmentReactEmit.json b/crates/swc_ecma_parser/tests/tsc/tsxFragmentReactEmit.json deleted file mode 100644 index 04f6aecaaeb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxFragmentReactEmit.json +++ /dev/null @@ -1,842 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 37, - "end": 459, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 37, - "end": 136, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 56, - "end": 136, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 59, - "end": 80, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 69, - "end": 76, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 77, - "end": 80, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 82, - "end": 134, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 92, - "end": 109, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 110, - "end": 134, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 115, - "end": 124, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 116, - "end": 124, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 118, - "end": 124, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 125, - "end": 130, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 127, - "end": 130, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 114, - "end": 131, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 137, - "end": 160, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 149, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 149, - "end": 154, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 154, - "end": 159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 156, - "end": 159, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 162, - "end": 168, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 162, - "end": 164, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 164, - "end": 167, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 186, - "end": 199, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 186, - "end": 198, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 186, - "end": 192, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 192, - "end": 198, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 222, - "end": 263, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 222, - "end": 262, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 222, - "end": 243, - "ctxt": 0 - } - }, - "children": [], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 243, - "end": 262, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 288, - "end": 296, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 288, - "end": 295, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 288, - "end": 290, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 290, - "end": 292, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 312, - "end": 347, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 312, - "end": 346, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 312, - "end": 314, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 314, - "end": 329, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 315, - "end": 319, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 314, - "end": 320, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 320, - "end": 322, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 322, - "end": 329, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 328, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 329, - "end": 343, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 330, - "end": 333, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 329, - "end": 334, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 334, - "end": 337, - "ctxt": 0 - }, - "value": "bye", - "raw": "bye" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 337, - "end": 343, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 343, - "end": 346, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 360, - "end": 431, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 360, - "end": 430, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 360, - "end": 362, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 362, - "end": 376, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 363, - "end": 367, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 362, - "end": 368, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 368, - "end": 369, - "ctxt": 0 - }, - "value": "1", - "raw": "1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 369, - "end": 376, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 371, - "end": 375, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXFragment", - "span": { - "start": 376, - "end": 413, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 376, - "end": 378, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 378, - "end": 394, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 378, - "end": 384, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 384, - "end": 387, - "ctxt": 0 - }, - "value": "2.1", - "raw": "2.1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 387, - "end": 394, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 389, - "end": 393, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 394, - "end": 410, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 399, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 394, - "end": 400, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "value": "2.2", - "raw": "2.2" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 403, - "end": 410, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 405, - "end": 409, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 410, - "end": 413, - "ctxt": 0 - } - } - }, - { - "type": "JSXElement", - "span": { - "start": 413, - "end": 427, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 414, - "end": 418, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "3", - "raw": "3" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 420, - "end": 427, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 426, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 452, - "end": 459, - "ctxt": 0 - }, - "expression": { - "type": "JSXFragment", - "span": { - "start": 452, - "end": 458, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningFragment", - "span": { - "start": 452, - "end": 454, - "ctxt": 0 - } - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 454, - "end": 455, - "ctxt": 0 - }, - "value": "#", - "raw": "#" - } - ], - "closing": { - "type": "JSXClosingFragment", - "span": { - "start": 455, - "end": 458, - "ctxt": 0 - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericArrowFunctionParsing.tsx b/crates/swc_ecma_parser/tests/tsc/tsxGenericArrowFunctionParsing.tsx deleted file mode 100644 index 473d37bef69..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericArrowFunctionParsing.tsx +++ /dev/null @@ -1,31 +0,0 @@ -//@filename: file.tsx -//@jsx: preserve -declare module JSX { - interface Element { isElement; } -} - -var T: any, T1: any, T2: any; - -// This is an element -var x1 = () => {}; -x1.isElement; - -// This is a generic function -var x2 = () => {}; -x2(); - -// This is a generic function -var x3 = () => {}; -x3(); - -// This is an element -var x4 = () => {}; -x4.isElement; - -// This is an element -var x5 = () => {}; -x5.isElement; - -// This is a generic function -var x6 = () => {}; -x6(); diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType1.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType1.json deleted file mode 100644 index 52947990f5b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType1.json +++ /dev/null @@ -1,1321 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 722, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 310, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 309, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 164, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 180, - "end": 218, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 180, - "end": 218, - "ctxt": 0 - }, - "value": "Component", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 218, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 218, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 191, - "end": 196, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 197, - "end": 215, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 215, - "end": 218, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 167, - "end": 309, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 249, - "end": 309, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 255, - "end": 307, - "ctxt": 0 - }, - "argument": { - "type": "ArrowFunctionExpression", - "span": { - "start": 262, - "end": 307, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 273, - "end": 307, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 274, - "end": 283, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 273, - "end": 295, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 288, - "end": 293, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 295, - "end": 307, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 306, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 176, - "end": 179, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 177, - "end": 178, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 219, - "end": 248, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 221, - "end": 248, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 221, - "end": 226, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 227, - "end": 245, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 245, - "end": 248, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 246, - "end": 247, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 312, - "end": 503, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 318, - "end": 502, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 318, - "end": 328, - "ctxt": 0 - }, - "value": "decorator2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 366, - "end": 404, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 366, - "end": 404, - "ctxt": 0 - }, - "value": "Component", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 375, - "end": 404, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 377, - "end": 404, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 383, - "end": 401, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 401, - "end": 404, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 402, - "end": 403, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 402, - "end": 403, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 331, - "end": 502, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 435, - "end": 502, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 441, - "end": 500, - "ctxt": 0 - }, - "argument": { - "type": "ArrowFunctionExpression", - "span": { - "start": 448, - "end": 500, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 449, - "end": 454, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 459, - "end": 500, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 460, - "end": 469, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 459, - "end": 488, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 471, - "end": 474, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 474, - "end": 479, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 481, - "end": 486, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 481, - "end": 482, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 483, - "end": 486, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 488, - "end": 500, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 490, - "end": 499, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 340, - "end": 365, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 341, - "end": 364, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 351, - "end": 364, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 353, - "end": 362, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 354, - "end": 362, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 356, - "end": 362, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 405, - "end": 434, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 407, - "end": 434, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 407, - "end": 412, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 413, - "end": 431, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 431, - "end": 434, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 432, - "end": 433, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 432, - "end": 433, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 505, - "end": 722, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 511, - "end": 721, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 511, - "end": 521, - "ctxt": 0 - }, - "value": "decorator3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 585, - "end": 623, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 585, - "end": 623, - "ctxt": 0 - }, - "value": "Component", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 594, - "end": 623, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 596, - "end": 623, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 596, - "end": 601, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 602, - "end": 620, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 620, - "end": 623, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 621, - "end": 622, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 621, - "end": 622, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 524, - "end": 721, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 654, - "end": 721, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 660, - "end": 719, - "ctxt": 0 - }, - "argument": { - "type": "ArrowFunctionExpression", - "span": { - "start": 667, - "end": 719, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 668, - "end": 673, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 678, - "end": 719, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 679, - "end": 688, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 678, - "end": 707, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 689, - "end": 694, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 689, - "end": 690, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 691, - "end": 694, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 692, - "end": 693, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 696, - "end": 699, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 699, - "end": 704, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 707, - "end": 719, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 709, - "end": 718, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 533, - "end": 584, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 534, - "end": 557, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 534, - "end": 535, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 544, - "end": 557, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 546, - "end": 555, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 546, - "end": 547, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 547, - "end": 555, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 549, - "end": 555, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 559, - "end": 582, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 559, - "end": 560, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 569, - "end": 582, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 571, - "end": 580, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 571, - "end": 572, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 572, - "end": 580, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 574, - "end": 580, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 624, - "end": 653, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 626, - "end": 653, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 626, - "end": 631, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 632, - "end": 650, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 650, - "end": 653, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType2.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType2.json deleted file mode 100644 index 48a751b5e06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType2.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 345, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 345, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 165, - "ctxt": 0 - }, - "value": "decorator4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 203, - "end": 241, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 203, - "end": 241, - "ctxt": 0 - }, - "value": "Component", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 241, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 214, - "end": 241, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 214, - "end": 219, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 220, - "end": 238, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 168, - "end": 344, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 272, - "end": 344, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 278, - "end": 342, - "ctxt": 0 - }, - "argument": { - "type": "ArrowFunctionExpression", - "span": { - "start": 285, - "end": 342, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 296, - "end": 342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 306, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 296, - "end": 330, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 311, - "end": 316, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 318, - "end": 328, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 319, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 320, - "end": 328, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 321, - "end": 327, - "ctxt": 0 - }, - "value": "blah", - "raw": "\"blah\"" - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 330, - "end": 342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 332, - "end": 341, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 177, - "end": 202, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 178, - "end": 201, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 188, - "end": 201, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 190, - "end": 199, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 190, - "end": 191, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 191, - "end": 199, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 242, - "end": 271, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 244, - "end": 271, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 244, - "end": 249, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 250, - "end": 268, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType3.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType3.json deleted file mode 100644 index 6260cb603ba..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType3.json +++ /dev/null @@ -1,657 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 398, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 157, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 285, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 236, - "end": 283, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 236, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 255, - "end": 276, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 262, - "end": 275, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 262, - "end": 267, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 271, - "end": 274, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 207, - "end": 222, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 207, - "end": 212, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 157, - "end": 198, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 158, - "end": 196, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 168, - "end": 181, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": { - "type": "TsTypeLiteral", - "span": { - "start": 184, - "end": 196, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 226, - "end": 228, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 286, - "end": 398, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 334, - "end": 396, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 334, - "end": 340, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 334, - "end": 396, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 343, - "end": 396, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 353, - "end": 390, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 360, - "end": 389, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 361, - "end": 363, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "span": { - "start": 360, - "end": 389, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 368, - "end": 378, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 368, - "end": 372, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 373, - "end": 378, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 380, - "end": 386, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 380, - "end": 381, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 305, - "end": 320, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 305, - "end": 310, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 311, - "end": 320, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 293, - "end": 296, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 320, - "end": 327, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 324, - "end": 326, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType4.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType4.json deleted file mode 100644 index 3ad17458dce..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType4.json +++ /dev/null @@ -1,607 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 382, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 157, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 269, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 220, - "end": 267, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 220, - "end": 226, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 220, - "end": 267, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 229, - "end": 267, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 239, - "end": 260, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 246, - "end": 259, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 246, - "end": 251, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 251, - "end": 253, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 253, - "end": 259, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 255, - "end": 258, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 191, - "end": 206, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 191, - "end": 196, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 197, - "end": 206, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 157, - "end": 182, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 158, - "end": 181, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 168, - "end": 181, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 206, - "end": 213, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 210, - "end": 212, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 270, - "end": 382, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 318, - "end": 380, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 318, - "end": 324, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 318, - "end": 380, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 327, - "end": 380, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 337, - "end": 374, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 344, - "end": 373, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 345, - "end": 347, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "span": { - "start": 344, - "end": 373, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 349, - "end": 352, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 352, - "end": 362, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 352, - "end": 356, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 357, - "end": 362, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 364, - "end": 365, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 289, - "end": 304, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 289, - "end": 294, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 295, - "end": 304, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 308, - "end": 310, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType5.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType5.json deleted file mode 100644 index f32ab764c87..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType5.json +++ /dev/null @@ -1,662 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 396, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 157, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 269, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 220, - "end": 267, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 220, - "end": 226, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 220, - "end": 267, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 229, - "end": 267, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 239, - "end": 260, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 246, - "end": 259, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 246, - "end": 251, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 251, - "end": 253, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 253, - "end": 259, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 255, - "end": 258, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 191, - "end": 206, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 191, - "end": 196, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 197, - "end": 206, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 157, - "end": 182, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 158, - "end": 181, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 168, - "end": 181, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 206, - "end": 213, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 210, - "end": 212, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 270, - "end": 396, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 318, - "end": 327, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 318, - "end": 323, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 323, - "end": 326, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 325, - "end": 326, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 325, - "end": 326, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 332, - "end": 394, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 332, - "end": 338, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 332, - "end": 394, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 341, - "end": 394, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 351, - "end": 388, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 358, - "end": 387, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 359, - "end": 361, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "span": { - "start": 358, - "end": 387, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 366, - "end": 376, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 366, - "end": 370, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 371, - "end": 376, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 378, - "end": 384, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 380, - "end": 384, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 289, - "end": 304, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 289, - "end": 294, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 295, - "end": 304, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 305, - "end": 306, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 308, - "end": 310, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType6.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType6.json deleted file mode 100644 index cbcfa6017b2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType6.json +++ /dev/null @@ -1,712 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 412, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 157, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 285, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 236, - "end": 283, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 236, - "end": 242, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 236, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 255, - "end": 276, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 262, - "end": 275, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 262, - "end": 267, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "value": "hi", - "raw": "hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 271, - "end": 274, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 207, - "end": 222, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 207, - "end": 212, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 213, - "end": 222, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 157, - "end": 198, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 158, - "end": 196, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 168, - "end": 181, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": { - "type": "TsTypeLiteral", - "span": { - "start": 184, - "end": 196, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 187, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 222, - "end": 229, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 226, - "end": 228, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "declare": false, - "span": { - "start": 286, - "end": 412, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 334, - "end": 343, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 334, - "end": 339, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 348, - "end": 410, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 348, - "end": 354, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 348, - "end": 410, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 357, - "end": 410, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 367, - "end": 404, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 374, - "end": 403, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 375, - "end": 377, - "ctxt": 0 - }, - "value": "B1", - "optional": false - }, - "span": { - "start": 374, - "end": 403, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 382, - "end": 392, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 382, - "end": 386, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 387, - "end": 392, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 394, - "end": 400, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 396, - "end": 400, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 305, - "end": 320, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 305, - "end": 310, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 311, - "end": 320, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 293, - "end": 296, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 320, - "end": 327, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 321, - "end": 322, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 324, - "end": 326, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType7.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType7.json deleted file mode 100644 index 460a07e9c83..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType7.json +++ /dev/null @@ -1,657 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 395, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 149, - "end": 203, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 202, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 191, - "end": 194, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 195, - "end": 202, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 204, - "end": 285, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 210, - "end": 285, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 240, - "end": 243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 242, - "end": 243, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 242, - "end": 243, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 222, - "end": 285, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 285, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 251, - "end": 283, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 258, - "end": 282, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 259, - "end": 268, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 258, - "end": 282, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 270, - "end": 273, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 273, - "end": 278, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 231, - "end": 234, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 287, - "end": 395, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 293, - "end": 395, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 303, - "ctxt": 0 - }, - "value": "decorator1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 339, - "end": 347, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 339, - "end": 347, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 344, - "end": 347, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 306, - "end": 395, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 349, - "end": 395, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 355, - "end": 393, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 362, - "end": 392, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 363, - "end": 372, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 362, - "end": 392, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 384, - "end": 390, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 384, - "end": 385, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 386, - "end": 390, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 315, - "end": 338, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 316, - "end": 337, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 326, - "end": 337, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 328, - "end": 336, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 330, - "end": 336, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType8.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType8.json deleted file mode 100644 index a2ad96d8cf2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType8.json +++ /dev/null @@ -1,629 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 389, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 184, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 149, - "end": 203, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 175, - "end": 178, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 202, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 191, - "end": 194, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 195, - "end": 202, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 204, - "end": 285, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 210, - "end": 285, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "value": "decorator", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 240, - "end": 243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 242, - "end": 243, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 242, - "end": 243, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 222, - "end": 285, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 245, - "end": 285, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 251, - "end": 283, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 258, - "end": 282, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 259, - "end": 268, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 258, - "end": 282, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 270, - "end": 273, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 273, - "end": 278, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 231, - "end": 234, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 287, - "end": 389, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 293, - "end": 389, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 303, - "ctxt": 0 - }, - "value": "decorator1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "FunctionExpression", - "identifier": null, - "params": [ - { - "type": "Parameter", - "span": { - "start": 339, - "end": 347, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 339, - "end": 347, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 344, - "end": 347, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 346, - "end": 347, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 306, - "end": 389, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 349, - "end": 389, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 355, - "end": 387, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 362, - "end": 386, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 363, - "end": 372, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 362, - "end": 386, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 377, - "end": 382, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 315, - "end": 338, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 316, - "end": 337, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 317, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 326, - "end": 337, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 328, - "end": 336, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 330, - "end": 336, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType9.json b/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType9.json deleted file mode 100644 index 2975d2c421d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxGenericAttributesType9.json +++ /dev/null @@ -1,469 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 350, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 149, - "end": 350, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "value": "makeP", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 174, - "end": 203, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 174, - "end": 203, - "ctxt": 0 - }, - "value": "Ctor", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 180, - "end": 203, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 180, - "end": 185, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 186, - "end": 200, - "ctxt": 0 - }, - "value": "ComponentClass", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 200, - "end": 203, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 201, - "end": 202, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 156, - "end": 350, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 205, - "end": 350, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 208, - "end": 348, - "ctxt": 0 - }, - "argument": { - "type": "ClassExpression", - "identifier": null, - "span": { - "start": 215, - "end": 347, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 262, - "end": 344, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 262, - "end": 344, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 291, - "end": 344, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 296, - "end": 340, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 303, - "end": 339, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 309, - "end": 334, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 310, - "end": 314, - "ctxt": 0 - }, - "value": "Ctor", - "optional": false - }, - "span": { - "start": 309, - "end": 334, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "arguments": { - "type": "MemberExpression", - "span": { - "start": 319, - "end": 329, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 319, - "end": 323, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 324, - "end": 329, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 277, - "end": 290, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 279, - "end": 290, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 283, - "end": 290, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": "public", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 229, - "end": 248, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 229, - "end": 234, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 235, - "end": 248, - "ctxt": 0 - }, - "value": "PureComponent", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 248, - "end": 257, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - }, - "kind": "void" - } - ] - }, - "implements": [] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 170, - "end": 173, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 171, - "end": 172, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 171, - "end": 172, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxInArrowFunction.json b/crates/swc_ecma_parser/tests/tsc/tsxInArrowFunction.json deleted file mode 100644 index 7f5d12af7ad..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxInArrowFunction.json +++ /dev/null @@ -1,774 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 382, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 162, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 41, - "end": 162, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 47, - "end": 68, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 64, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 65, - "end": 68, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 73, - "end": 160, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 83, - "end": 100, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 101, - "end": 160, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 111, - "end": 154, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 111, - "end": 114, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 114, - "end": 154, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 116, - "end": 154, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 130, - "end": 144, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 130, - "end": 134, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 143, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 143, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 180, - "end": 218, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 180, - "end": 217, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 180, - "end": 185, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 185, - "end": 211, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 186, - "end": 210, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "JSXElement", - "span": { - "start": 192, - "end": 210, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 193, - "end": 196, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 192, - "end": 210, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 197, - "end": 207, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 197, - "end": 201, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 202, - "end": 207, - "ctxt": 0 - }, - "value": "wat", - "raw": "\"wat\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 211, - "end": 217, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 235, - "end": 272, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 235, - "end": 271, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 235, - "end": 240, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 240, - "end": 265, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 241, - "end": 264, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 241, - "end": 242, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 251, - "end": 261, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 256, - "end": 261, - "ctxt": 0 - }, - "value": "wat", - "raw": "\"wat\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 284, - "end": 324, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 284, - "end": 323, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 285, - "end": 288, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 289, - "end": 317, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 290, - "end": 316, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 296, - "end": 316, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 297, - "end": 315, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 297, - "end": 315, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 302, - "end": 312, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 306, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 307, - "end": 312, - "ctxt": 0 - }, - "value": "wat", - "raw": "\"wat\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 317, - "end": 323, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 340, - "end": 382, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 340, - "end": 381, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 341, - "end": 344, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 340, - "end": 345, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 345, - "end": 375, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 346, - "end": 374, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "JSXElement", - "span": { - "start": 352, - "end": 374, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 353, - "end": 356, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 352, - "end": 368, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 357, - "end": 367, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 362, - "end": 367, - "ctxt": 0 - }, - "value": "wat", - "raw": "\"wat\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 368, - "end": 374, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 370, - "end": 373, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 375, - "end": 381, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 377, - "end": 380, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxIntrinsicAttributeErrors.json b/crates/swc_ecma_parser/tests/tsc/tsxIntrinsicAttributeErrors.json deleted file mode 100644 index def1b60a444..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxIntrinsicAttributeErrors.json +++ /dev/null @@ -1,845 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 511, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 19, - "end": 402, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 37, - "end": 40, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 41, - "end": 402, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 47, - "end": 68, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 57, - "end": 64, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 65, - "end": 68, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 73, - "end": 124, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 83, - "end": 95, - "ctxt": 0 - }, - "value": "ElementClass", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 96, - "end": 124, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 106, - "end": 118, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 106, - "end": 112, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 112, - "end": 117, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 129, - "end": 195, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 139, - "end": 158, - "ctxt": 0 - }, - "value": "IntrinsicAttributes", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 159, - "end": 195, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 169, - "end": 189, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 172, - "end": 189, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 174, - "end": 189, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 174, - "end": 180, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 183, - "end": 189, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 200, - "end": 260, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 234, - "ctxt": 0 - }, - "value": "IntrinsicClassAttributes", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 234, - "end": 237, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 238, - "end": 260, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 248, - "end": 254, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 248, - "end": 251, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 265, - "end": 400, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 275, - "end": 292, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 293, - "end": 400, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 303, - "end": 374, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 306, - "end": 374, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 308, - "end": 374, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 322, - "end": 336, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 322, - "end": 326, - "ctxt": 0 - }, - "value": "text", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 327, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 329, - "end": 335, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 349, - "end": 364, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 349, - "end": 354, - "ctxt": 0 - }, - "value": "width", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 355, - "end": 363, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 357, - "end": 363, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 384, - "end": 394, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 384, - "end": 388, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 390, - "end": 393, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 404, - "end": 488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 414, - "end": 415, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 416, - "end": 488, - "ctxt": 0 - }, - "body": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 422, - "end": 486, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 426, - "end": 435, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 427, - "end": 435, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 429, - "end": 435, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 436, - "end": 486, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 438, - "end": 486, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 448, - "end": 457, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 448, - "end": 449, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 449, - "end": 457, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 451, - "end": 457, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsMethodSignature", - "span": { - "start": 466, - "end": 480, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 466, - "end": 472, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 474, - "end": 480, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 476, - "end": 480, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 489, - "end": 498, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 493, - "end": 497, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 493, - "end": 494, - "ctxt": 0 - }, - "value": "E", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 496, - "end": 497, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 496, - "end": 497, - "ctxt": 0 - }, - "value": "I", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 499, - "end": 511, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 499, - "end": 511, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "span": { - "start": 499, - "end": 511, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 502, - "end": 508, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 502, - "end": 503, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 504, - "end": 508, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 505, - "end": 507, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxLibraryManagedAttributes.json b/crates/swc_ecma_parser/tests/tsc/tsxLibraryManagedAttributes.json deleted file mode 100644 index 99a2b41604e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxLibraryManagedAttributes.json +++ /dev/null @@ -1,7705 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 4937, - "ctxt": 0 - }, - "body": [ - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 36, - "end": 229, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 41, - "end": 51, - "ctxt": 0 - }, - "value": "Defaultize", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 51, - "end": 70, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 52, - "end": 58, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 52, - "end": 58, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 60, - "end": 69, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 60, - "end": 69, - "ctxt": 0 - }, - "value": "TDefaults", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsIntersectionType", - "span": { - "start": 77, - "end": 228, - "ctxt": 0 - }, - "types": [ - { - "type": "TsMappedType", - "span": { - "start": 79, - "end": 138, - "ctxt": 0 - }, - "readonly": null, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 81, - "end": 124, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 81, - "end": 82, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 86, - "end": 124, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 86, - "end": 93, - "ctxt": 0 - }, - "value": "Extract", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 93, - "end": 124, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeOperator", - "span": { - "start": 94, - "end": 106, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 100, - "end": 106, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 100, - "end": 106, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTypeOperator", - "span": { - "start": 108, - "end": 123, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "TDefaults", - "optional": false - }, - "typeParams": null - } - } - ] - } - }, - "default": null - }, - "nameType": null, - "optional": true, - "typeAnnotation": { - "type": "TsIndexedAccessType", - "span": { - "start": 128, - "end": 137, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsTypeReference", - "span": { - "start": 128, - "end": 134, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 128, - "end": 134, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - }, - "indexType": { - "type": "TsTypeReference", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "TsMappedType", - "span": { - "start": 145, - "end": 203, - "ctxt": 0 - }, - "readonly": null, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 147, - "end": 190, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 147, - "end": 148, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 152, - "end": 190, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 152, - "end": 159, - "ctxt": 0 - }, - "value": "Exclude", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 159, - "end": 190, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeOperator", - "span": { - "start": 160, - "end": 172, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 166, - "end": 172, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 166, - "end": 172, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTypeOperator", - "span": { - "start": 174, - "end": 189, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "TDefaults", - "optional": false - }, - "typeParams": null - } - } - ] - } - }, - "default": null - }, - "nameType": null, - "optional": null, - "typeAnnotation": { - "type": "TsIndexedAccessType", - "span": { - "start": 193, - "end": 202, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsTypeReference", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - }, - "indexType": { - "type": "TsTypeReference", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "TsTypeReference", - "span": { - "start": 210, - "end": 228, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 210, - "end": 217, - "ctxt": 0 - }, - "value": "Partial", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 217, - "end": 228, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 218, - "end": 227, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 218, - "end": 227, - "ctxt": 0 - }, - "value": "TDefaults", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 231, - "end": 373, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 236, - "end": 253, - "ctxt": 0 - }, - "value": "InferredPropTypes", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 254, - "end": 255, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 254, - "end": 255, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsMappedType", - "span": { - "start": 259, - "end": 372, - "ctxt": 0 - }, - "readonly": null, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 261, - "end": 273, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeOperator", - "span": { - "start": 266, - "end": 273, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "default": null - }, - "nameType": null, - "optional": null, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 276, - "end": 371, - "ctxt": 0 - }, - "checkType": { - "type": "TsIndexedAccessType", - "span": { - "start": 276, - "end": 280, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsTypeReference", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - "indexType": { - "type": "TsTypeReference", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "typeParams": null - } - }, - "extendsType": { - "type": "TsTypeReference", - "span": { - "start": 289, - "end": 322, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 289, - "end": 304, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 304, - "end": 322, - "ctxt": 0 - }, - "params": [ - { - "type": "TsInferType", - "span": { - "start": 305, - "end": 312, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 311, - "end": 312, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - }, - { - "type": "TsInferType", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 320, - "end": 321, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - } - ] - } - }, - "trueType": { - "type": "TsIndexedAccessType", - "span": { - "start": 325, - "end": 366, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsTypeReference", - "span": { - "start": 325, - "end": 346, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 325, - "end": 340, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 340, - "end": 346, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "indexType": { - "type": "TsTypeQuery", - "span": { - "start": 347, - "end": 365, - "ctxt": 0 - }, - "exprName": { - "type": "Identifier", - "span": { - "start": 354, - "end": 365, - "ctxt": 0 - }, - "value": "checkedType", - "optional": false - }, - "typeArguments": null - } - }, - "falseType": { - "type": "TsTypeLiteral", - "span": { - "start": 369, - "end": 371, - "ctxt": 0 - }, - "members": [] - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 375, - "end": 416, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 389, - "end": 415, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 389, - "end": 400, - "ctxt": 0 - }, - "value": "checkedType", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 400, - "end": 415, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeOperator", - "span": { - "start": 402, - "end": 415, - "ctxt": 0 - }, - "op": "unique", - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 409, - "end": 415, - "ctxt": 0 - }, - "kind": "symbol" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 417, - "end": 685, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 427, - "end": 442, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 442, - "end": 464, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 443, - "end": 444, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 443, - "end": 444, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 446, - "end": 463, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 446, - "end": 455, - "ctxt": 0 - }, - "value": "TRequired", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsLiteralType", - "span": { - "start": 458, - "end": 463, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 458, - "end": 463, - "ctxt": 0 - }, - "value": false - } - } - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 465, - "end": 685, - "ctxt": 0 - }, - "body": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 471, - "end": 571, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 472, - "end": 482, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 477, - "end": 482, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 479, - "end": 482, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 484, - "end": 500, - "ctxt": 0 - }, - "value": "propName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 492, - "end": 500, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 494, - "end": 500, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 502, - "end": 523, - "ctxt": 0 - }, - "value": "componentName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 515, - "end": 523, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 517, - "end": 523, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 525, - "end": 538, - "ctxt": 0 - }, - "value": "location", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 533, - "end": 538, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 535, - "end": 538, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 540, - "end": 560, - "ctxt": 0 - }, - "value": "propFullName", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 552, - "end": 560, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 554, - "end": 560, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 561, - "end": 570, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 563, - "end": 570, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 576, - "end": 613, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 576, - "end": 586, - "ctxt": 0 - }, - "value": "isRequired", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 586, - "end": 612, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 588, - "end": 612, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 588, - "end": 603, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 603, - "end": 612, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsLiteralType", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 607, - "end": 611, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 618, - "end": 683, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 619, - "end": 630, - "ctxt": 0 - }, - "value": "checkedType", - "optional": false - }, - "computed": true, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 631, - "end": 682, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 633, - "end": 682, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 633, - "end": 642, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 633, - "end": 642, - "ctxt": 0 - }, - "value": "TRequired", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsLiteralType", - "span": { - "start": 651, - "end": 655, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 651, - "end": 655, - "ctxt": 0 - }, - "value": true - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 658, - "end": 659, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 658, - "end": 659, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - "falseType": { - "type": "TsUnionType", - "span": { - "start": 662, - "end": 682, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 662, - "end": 663, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 662, - "end": 663, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 666, - "end": 670, - "ctxt": 0 - }, - "kind": "null" - }, - { - "type": "TsKeywordType", - "span": { - "start": 673, - "end": 682, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 687, - "end": 869, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 705, - "end": 714, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 715, - "end": 869, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 721, - "end": 766, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 728, - "end": 766, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 734, - "end": 765, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 734, - "end": 740, - "ctxt": 0 - }, - "value": "number", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 740, - "end": 765, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 742, - "end": 765, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 742, - "end": 757, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 757, - "end": 765, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 758, - "end": 764, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 771, - "end": 816, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 778, - "end": 816, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 784, - "end": 815, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 784, - "end": 790, - "ctxt": 0 - }, - "value": "string", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 790, - "end": 815, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 792, - "end": 815, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 792, - "end": 807, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 807, - "end": 815, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 808, - "end": 814, - "ctxt": 0 - }, - "kind": "string" - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 821, - "end": 867, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 828, - "end": 867, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 834, - "end": 866, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 834, - "end": 838, - "ctxt": 0 - }, - "value": "node", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 838, - "end": 866, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 840, - "end": 866, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 840, - "end": 855, - "ctxt": 0 - }, - "value": "PropTypeChecker", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 855, - "end": 866, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 856, - "end": 865, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 856, - "end": 865, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 871, - "end": 929, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 876, - "end": 885, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 888, - "end": 928, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 888, - "end": 894, - "ctxt": 0 - }, - "kind": "string" - }, - { - "type": "TsKeywordType", - "span": { - "start": 897, - "end": 903, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsTypeReference", - "span": { - "start": 906, - "end": 928, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 906, - "end": 920, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 920, - "end": 928, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 921, - "end": 923, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 925, - "end": 927, - "ctxt": 0 - }, - "members": [] - } - ] - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 945, - "end": 959, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "declare": true, - "span": { - "start": 931, - "end": 1109, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 978, - "end": 1000, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 978, - "end": 989, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 990, - "end": 998, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 990, - "end": 998, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 995, - "end": 998, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 997, - "end": 998, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 997, - "end": 998, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "body": null, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1005, - "end": 1050, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1010, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1010, - "end": 1049, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsIntersectionType", - "span": { - "start": 1012, - "end": 1049, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1012, - "end": 1013, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1012, - "end": 1013, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1016, - "end": 1049, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1016, - "end": 1024, - "ctxt": 0 - }, - "value": "Readonly", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1024, - "end": 1049, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 1025, - "end": 1048, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1026, - "end": 1047, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1026, - "end": 1034, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1034, - "end": 1047, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 1036, - "end": 1047, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 1036, - "end": 1045, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1036, - "end": 1045, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - ] - } - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1055, - "end": 1082, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1063, - "ctxt": 0 - }, - "value": "setState", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 1064, - "end": 1077, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1064, - "end": 1077, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1065, - "end": 1077, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1067, - "end": 1077, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1067, - "end": 1074, - "ctxt": 0 - }, - "value": "Partial", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1074, - "end": 1077, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1075, - "end": 1076, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1075, - "end": 1076, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1055, - "end": 1082, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1078, - "end": 1081, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1080, - "end": 1081, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1080, - "end": 1081, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 1087, - "end": 1107, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1087, - "end": 1093, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 1087, - "end": 1107, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1095, - "end": 1106, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1097, - "end": 1106, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1106, - "ctxt": 0 - }, - "value": "ReactNode", - "optional": false - }, - "typeParams": null - } - } - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 959, - "end": 971, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 960, - "end": 964, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 960, - "end": 961, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeLiteral", - "span": { - "start": 962, - "end": 964, - "ctxt": 0 - }, - "members": [] - } - }, - { - "type": "TsTypeParameter", - "span": { - "start": 966, - "end": 970, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 966, - "end": 967, - "ctxt": 0 - }, - "value": "S", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeLiteral", - "span": { - "start": 968, - "end": 970, - "ctxt": 0 - }, - "members": [] - } - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 1111, - "end": 1649, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 1129, - "end": 1132, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 1133, - "end": 1649, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1139, - "end": 1182, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1149, - "end": 1156, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1165, - "end": 1179, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1165, - "end": 1179, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1180, - "end": 1182, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1187, - "end": 1217, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1197, - "end": 1214, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1215, - "end": 1217, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1222, - "end": 1647, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1227, - "end": 1251, - "ctxt": 0 - }, - "value": "LibraryManagedAttributes", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1251, - "end": 1271, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1252, - "end": 1262, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1252, - "end": 1262, - "ctxt": 0 - }, - "value": "TComponent", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 1264, - "end": 1270, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1264, - "end": 1270, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 1282, - "end": 1646, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1282, - "end": 1292, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1282, - "end": 1292, - "ctxt": 0 - }, - "value": "TComponent", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsTypeLiteral", - "span": { - "start": 1301, - "end": 1347, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1303, - "end": 1325, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1303, - "end": 1315, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1315, - "end": 1324, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsInferType", - "span": { - "start": 1317, - "end": 1324, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1323, - "end": 1324, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1323, - "end": 1324, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1326, - "end": 1345, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1326, - "end": 1335, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1335, - "end": 1344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsInferType", - "span": { - "start": 1337, - "end": 1344, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1343, - "end": 1344, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1343, - "end": 1344, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - } - }, - "typeParams": null - } - ] - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 1362, - "end": 1406, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1362, - "end": 1372, - "ctxt": 0 - }, - "value": "Defaultize", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1372, - "end": 1406, - "ctxt": 0 - }, - "params": [ - { - "type": "TsIntersectionType", - "span": { - "start": 1373, - "end": 1402, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1373, - "end": 1379, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1373, - "end": 1379, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1382, - "end": 1402, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1382, - "end": 1399, - "ctxt": 0 - }, - "value": "InferredPropTypes", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1399, - "end": 1402, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1400, - "end": 1401, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1400, - "end": 1401, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - }, - { - "type": "TsTypeReference", - "span": { - "start": 1404, - "end": 1405, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1404, - "end": 1405, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "falseType": { - "type": "TsConditionalType", - "span": { - "start": 1421, - "end": 1646, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1421, - "end": 1431, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1421, - "end": 1431, - "ctxt": 0 - }, - "value": "TComponent", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsTypeLiteral", - "span": { - "start": 1440, - "end": 1465, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1442, - "end": 1463, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1442, - "end": 1454, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1454, - "end": 1463, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsInferType", - "span": { - "start": 1456, - "end": 1463, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1462, - "end": 1463, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1462, - "end": 1463, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - } - }, - "typeParams": null - } - ] - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 1484, - "end": 1505, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1484, - "end": 1494, - "ctxt": 0 - }, - "value": "Defaultize", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1494, - "end": 1505, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1495, - "end": 1501, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1495, - "end": 1501, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1503, - "end": 1504, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1503, - "end": 1504, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "falseType": { - "type": "TsConditionalType", - "span": { - "start": 1524, - "end": 1646, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1524, - "end": 1534, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1524, - "end": 1534, - "ctxt": 0 - }, - "value": "TComponent", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsTypeLiteral", - "span": { - "start": 1543, - "end": 1565, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1545, - "end": 1563, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1545, - "end": 1554, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1554, - "end": 1563, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsInferType", - "span": { - "start": 1556, - "end": 1563, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1562, - "end": 1563, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1562, - "end": 1563, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - } - }, - "typeParams": null - } - ] - }, - "trueType": { - "type": "TsIntersectionType", - "span": { - "start": 1588, - "end": 1617, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 1588, - "end": 1594, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1588, - "end": 1594, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1597, - "end": 1617, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1597, - "end": 1614, - "ctxt": 0 - }, - "value": "InferredPropTypes", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1614, - "end": 1617, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1615, - "end": 1616, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1615, - "end": 1616, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - ] - }, - "falseType": { - "type": "TsTypeReference", - "span": { - "start": 1640, - "end": 1646, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1640, - "end": 1646, - "ctxt": 0 - }, - "value": "TProps", - "optional": false - }, - "typeParams": null - } - } - } - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1657, - "end": 1666, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": false, - "span": { - "start": 1651, - "end": 1878, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 1696, - "end": 1825, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1703, - "end": 1712, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 1715, - "end": 1824, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1725, - "end": 1728, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 1730, - "end": 1746, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1730, - "end": 1739, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1740, - "end": 1746, - "ctxt": 0 - }, - "value": "number", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1756, - "end": 1759, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 1761, - "end": 1775, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1761, - "end": 1770, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1771, - "end": 1775, - "ctxt": 0 - }, - "value": "node", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1785, - "end": 1788, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 1790, - "end": 1817, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1790, - "end": 1806, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1790, - "end": 1799, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1800, - "end": 1806, - "ctxt": 0 - }, - "value": "string", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1807, - "end": 1817, - "ctxt": 0 - }, - "value": "isRequired", - "optional": false - } - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 1830, - "end": 1876, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 1837, - "end": 1849, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 1852, - "end": 1876, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1862, - "end": 1865, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1867, - "end": 1869, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 1675, - "end": 1689, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1880, - "end": 1934, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1886, - "end": 1933, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1886, - "end": 1887, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1890, - "end": 1933, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1891, - "end": 1900, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1890, - "end": 1933, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1901, - "end": 1909, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1901, - "end": 1904, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1905, - "end": 1909, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1906, - "end": 1908, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1910, - "end": 1919, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1910, - "end": 1913, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1914, - "end": 1919, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1920, - "end": 1930, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1920, - "end": 1923, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1924, - "end": 1930, - "ctxt": 0 - }, - "value": "yeah", - "raw": "\"yeah\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1935, - "end": 1968, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1941, - "end": 1967, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1941, - "end": 1942, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1945, - "end": 1967, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1946, - "end": 1955, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 1945, - "end": 1967, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1956, - "end": 1964, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1956, - "end": 1959, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1960, - "end": 1964, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1961, - "end": 1963, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2005, - "end": 2050, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2011, - "end": 2049, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2011, - "end": 2012, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2015, - "end": 2049, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2016, - "end": 2025, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 2015, - "end": 2049, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2026, - "end": 2035, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2026, - "end": 2029, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2030, - "end": 2035, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2036, - "end": 2046, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2036, - "end": 2039, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2040, - "end": 2046, - "ctxt": 0 - }, - "value": "yeah", - "raw": "\"yeah\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2051, - "end": 2105, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2057, - "end": 2104, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2057, - "end": 2058, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2061, - "end": 2104, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2062, - "end": 2071, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 2061, - "end": 2104, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2072, - "end": 2081, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2072, - "end": 2075, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2076, - "end": 2081, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2082, - "end": 2090, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2082, - "end": 2085, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2086, - "end": 2090, - "ctxt": 0 - }, - "value": "yo", - "raw": "\"yo\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2091, - "end": 2101, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2091, - "end": 2094, - "ctxt": 0 - }, - "value": "bat", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2095, - "end": 2101, - "ctxt": 0 - }, - "value": "ohno", - "raw": "\"ohno\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2137, - "end": 2192, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2143, - "end": 2191, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2143, - "end": 2144, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2147, - "end": 2191, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2148, - "end": 2157, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 2147, - "end": 2191, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2158, - "end": 2166, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2158, - "end": 2161, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2162, - "end": 2166, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2163, - "end": 2165, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2167, - "end": 2177, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2167, - "end": 2170, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2171, - "end": 2177, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 2172, - "end": 2176, - "ctxt": 0 - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2178, - "end": 2188, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2178, - "end": 2181, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2182, - "end": 2188, - "ctxt": 0 - }, - "value": "cool", - "raw": "\"cool\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2259, - "end": 2314, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2265, - "end": 2313, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2265, - "end": 2266, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2269, - "end": 2313, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2270, - "end": 2279, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 2269, - "end": 2313, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2280, - "end": 2288, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2280, - "end": 2283, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2284, - "end": 2288, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2285, - "end": 2287, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2289, - "end": 2299, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2289, - "end": 2292, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2293, - "end": 2299, - "ctxt": 0 - }, - "value": "yeah", - "raw": "\"yeah\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2300, - "end": 2310, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2300, - "end": 2303, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2304, - "end": 2310, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 2305, - "end": 2309, - "ctxt": 0 - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2397, - "end": 2410, - "ctxt": 0 - }, - "value": "JustPropTypes", - "optional": false - }, - "declare": false, - "span": { - "start": 2391, - "end": 2540, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2440, - "end": 2538, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2447, - "end": 2456, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 2459, - "end": 2537, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2469, - "end": 2472, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 2474, - "end": 2490, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2474, - "end": 2483, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2484, - "end": 2490, - "ctxt": 0 - }, - "value": "number", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2500, - "end": 2503, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 2505, - "end": 2530, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 2505, - "end": 2519, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 2505, - "end": 2514, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 2515, - "end": 2519, - "ctxt": 0 - }, - "value": "node", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 2520, - "end": 2530, - "ctxt": 0 - }, - "value": "isRequired", - "optional": false - } - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2419, - "end": 2433, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2542, - "end": 2588, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2548, - "end": 2587, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2548, - "end": 2549, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2552, - "end": 2587, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2553, - "end": 2566, - "ctxt": 0 - }, - "value": "JustPropTypes", - "optional": false - }, - "span": { - "start": 2552, - "end": 2587, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2567, - "end": 2575, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2567, - "end": 2570, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2571, - "end": 2575, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2572, - "end": 2574, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2576, - "end": 2584, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2576, - "end": 2579, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2580, - "end": 2584, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2589, - "end": 2626, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2595, - "end": 2625, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2595, - "end": 2596, - "ctxt": 0 - }, - "value": "h", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2599, - "end": 2625, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2600, - "end": 2613, - "ctxt": 0 - }, - "value": "JustPropTypes", - "optional": false - }, - "span": { - "start": 2599, - "end": 2625, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2614, - "end": 2622, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2614, - "end": 2617, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2618, - "end": 2622, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2648, - "end": 2696, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2654, - "end": 2695, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2654, - "end": 2655, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2658, - "end": 2695, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2659, - "end": 2672, - "ctxt": 0 - }, - "value": "JustPropTypes", - "optional": false - }, - "span": { - "start": 2658, - "end": 2695, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2673, - "end": 2683, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2673, - "end": 2676, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2677, - "end": 2683, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 2678, - "end": 2682, - "ctxt": 0 - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2684, - "end": 2692, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2684, - "end": 2687, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2688, - "end": 2692, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2697, - "end": 2745, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2703, - "end": 2744, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2703, - "end": 2704, - "ctxt": 0 - }, - "value": "j", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2707, - "end": 2744, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2708, - "end": 2721, - "ctxt": 0 - }, - "value": "JustPropTypes", - "optional": false - }, - "span": { - "start": 2707, - "end": 2744, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2722, - "end": 2730, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2722, - "end": 2725, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2726, - "end": 2730, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2727, - "end": 2729, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2731, - "end": 2741, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2731, - "end": 2734, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2735, - "end": 2741, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 2736, - "end": 2740, - "ctxt": 0 - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 2779, - "end": 2795, - "ctxt": 0 - }, - "value": "JustDefaultProps", - "optional": false - }, - "declare": false, - "span": { - "start": 2773, - "end": 2874, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 2825, - "end": 2872, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 2832, - "end": 2844, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 2847, - "end": 2871, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 2857, - "end": 2860, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 2862, - "end": 2864, - "ctxt": 0 - }, - "value": 42.0 - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 2804, - "end": 2818, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2876, - "end": 2916, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2882, - "end": 2915, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2882, - "end": 2883, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2886, - "end": 2915, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2887, - "end": 2903, - "ctxt": 0 - }, - "value": "JustDefaultProps", - "optional": false - }, - "span": { - "start": 2886, - "end": 2915, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2904, - "end": 2912, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2904, - "end": 2907, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2908, - "end": 2912, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2909, - "end": 2911, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2917, - "end": 2966, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 2923, - "end": 2965, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 2923, - "end": 2924, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 2927, - "end": 2965, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 2928, - "end": 2944, - "ctxt": 0 - }, - "value": "JustDefaultProps", - "optional": false - }, - "span": { - "start": 2927, - "end": 2965, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 2945, - "end": 2953, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2945, - "end": 2948, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 2949, - "end": 2953, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 2950, - "end": 2952, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 2954, - "end": 2962, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 2954, - "end": 2957, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 2958, - "end": 2962, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 2995, - "end": 3035, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3001, - "end": 3034, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3001, - "end": 3002, - "ctxt": 0 - }, - "value": "m", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3005, - "end": 3034, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3006, - "end": 3022, - "ctxt": 0 - }, - "value": "JustDefaultProps", - "optional": false - }, - "span": { - "start": 3005, - "end": 3034, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3023, - "end": 3031, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3023, - "end": 3026, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3027, - "end": 3031, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 3058, - "end": 3097, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3068, - "end": 3076, - "ctxt": 0 - }, - "value": "FooProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 3077, - "end": 3097, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 3083, - "end": 3095, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 3083, - "end": 3086, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 3086, - "end": 3094, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 3088, - "end": 3094, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3105, - "end": 3129, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "declare": false, - "span": { - "start": 3099, - "end": 3354, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 3169, - "end": 3298, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3176, - "end": 3185, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 3188, - "end": 3297, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 3198, - "end": 3201, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 3203, - "end": 3219, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 3203, - "end": 3212, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 3213, - "end": 3219, - "ctxt": 0 - }, - "value": "string", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 3229, - "end": 3232, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 3234, - "end": 3248, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 3234, - "end": 3243, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 3244, - "end": 3248, - "ctxt": 0 - }, - "value": "node", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 3258, - "end": 3261, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 3263, - "end": 3290, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 3263, - "end": 3279, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 3263, - "end": 3272, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 3273, - "end": 3279, - "ctxt": 0 - }, - "value": "number", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 3280, - "end": 3290, - "ctxt": 0 - }, - "value": "isRequired", - "optional": false - } - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 3303, - "end": 3352, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 3310, - "end": 3322, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 3325, - "end": 3351, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 3335, - "end": 3338, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3340, - "end": 3344, - "ctxt": 0 - }, - "value": "yo", - "raw": "\"yo\"" - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 3138, - "end": 3152, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 3152, - "end": 3162, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 3153, - "end": 3161, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 3153, - "end": 3161, - "ctxt": 0 - }, - "value": "FooProps", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3355, - "end": 3424, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3361, - "end": 3423, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3361, - "end": 3362, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3365, - "end": 3423, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3366, - "end": 3390, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3365, - "end": 3423, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3391, - "end": 3401, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3391, - "end": 3394, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3395, - "end": 3401, - "ctxt": 0 - }, - "value": "fine", - "raw": "\"fine\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3402, - "end": 3411, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3402, - "end": 3405, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3406, - "end": 3411, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3412, - "end": 3420, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3412, - "end": 3415, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3416, - "end": 3420, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 3417, - "end": 3419, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3425, - "end": 3473, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3431, - "end": 3472, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3431, - "end": 3432, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3435, - "end": 3472, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3436, - "end": 3460, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3435, - "end": 3472, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3461, - "end": 3469, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3461, - "end": 3464, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3465, - "end": 3469, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3510, - "end": 3568, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3516, - "end": 3567, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3516, - "end": 3517, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3520, - "end": 3567, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3521, - "end": 3545, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3520, - "end": 3567, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3546, - "end": 3555, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3546, - "end": 3549, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3550, - "end": 3555, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3556, - "end": 3564, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3556, - "end": 3559, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3560, - "end": 3564, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 3561, - "end": 3563, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3569, - "end": 3638, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3575, - "end": 3637, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3575, - "end": 3576, - "ctxt": 0 - }, - "value": "q", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3579, - "end": 3637, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3580, - "end": 3604, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3579, - "end": 3637, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3605, - "end": 3614, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3605, - "end": 3608, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3609, - "end": 3614, - "ctxt": 0 - }, - "value": "yes", - "raw": "\"yes\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3615, - "end": 3623, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3615, - "end": 3618, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3619, - "end": 3623, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 3620, - "end": 3622, - "ctxt": 0 - }, - "value": 12.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3624, - "end": 3634, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3624, - "end": 3627, - "ctxt": 0 - }, - "value": "bat", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3628, - "end": 3634, - "ctxt": 0 - }, - "value": "ohno", - "raw": "\"ohno\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3670, - "end": 3737, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3676, - "end": 3736, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3676, - "end": 3677, - "ctxt": 0 - }, - "value": "r", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3680, - "end": 3736, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3681, - "end": 3705, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3680, - "end": 3736, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3706, - "end": 3714, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3706, - "end": 3709, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3710, - "end": 3714, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3715, - "end": 3725, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3715, - "end": 3718, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3719, - "end": 3725, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 3720, - "end": 3724, - "ctxt": 0 - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3726, - "end": 3733, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3726, - "end": 3729, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3730, - "end": 3733, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 3731, - "end": 3732, - "ctxt": 0 - }, - "value": 0.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 3804, - "end": 3874, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 3810, - "end": 3873, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 3810, - "end": 3811, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 3814, - "end": 3873, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 3815, - "end": 3839, - "ctxt": 0 - }, - "value": "BothWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 3814, - "end": 3873, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 3840, - "end": 3848, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3840, - "end": 3843, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3844, - "end": 3848, - "ctxt": 0 - }, - "value": "eh", - "raw": "\"eh\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3849, - "end": 3859, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3849, - "end": 3852, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 3853, - "end": 3859, - "ctxt": 0 - }, - "value": "yeah", - "raw": "\"yeah\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 3860, - "end": 3870, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 3860, - "end": 3863, - "ctxt": 0 - }, - "value": "baz", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 3864, - "end": 3870, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 3865, - "end": 3869, - "ctxt": 0 - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 3957, - "end": 3990, - "ctxt": 0 - }, - "value": "JustPropTypesWithSpecifiedGeneric", - "optional": false - }, - "declare": false, - "span": { - "start": 3951, - "end": 4130, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 4030, - "end": 4128, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4037, - "end": 4046, - "ctxt": 0 - }, - "value": "propTypes", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 4049, - "end": 4127, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 4059, - "end": 4062, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 4064, - "end": 4080, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4064, - "end": 4073, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4074, - "end": 4080, - "ctxt": 0 - }, - "value": "string", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 4090, - "end": 4093, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 4095, - "end": 4120, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 4095, - "end": 4109, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 4095, - "end": 4104, - "ctxt": 0 - }, - "value": "PropTypes", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 4105, - "end": 4109, - "ctxt": 0 - }, - "value": "node", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 4110, - "end": 4120, - "ctxt": 0 - }, - "value": "isRequired", - "optional": false - } - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 3999, - "end": 4013, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 4013, - "end": 4023, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 4014, - "end": 4022, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4014, - "end": 4022, - "ctxt": 0 - }, - "value": "FooProps", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4131, - "end": 4199, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4137, - "end": 4198, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4137, - "end": 4138, - "ctxt": 0 - }, - "value": "t", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4141, - "end": 4198, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4142, - "end": 4175, - "ctxt": 0 - }, - "value": "JustPropTypesWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4141, - "end": 4198, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4176, - "end": 4186, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4176, - "end": 4179, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4180, - "end": 4186, - "ctxt": 0 - }, - "value": "nice", - "raw": "\"nice\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 4187, - "end": 4195, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4187, - "end": 4190, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4191, - "end": 4195, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4200, - "end": 4257, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4206, - "end": 4256, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4206, - "end": 4207, - "ctxt": 0 - }, - "value": "u", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4210, - "end": 4256, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4211, - "end": 4244, - "ctxt": 0 - }, - "value": "JustPropTypesWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4210, - "end": 4256, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4245, - "end": 4253, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4245, - "end": 4248, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 4249, - "end": 4253, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 4250, - "end": 4252, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4279, - "end": 4347, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4285, - "end": 4346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4285, - "end": 4286, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4289, - "end": 4346, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4290, - "end": 4323, - "ctxt": 0 - }, - "value": "JustPropTypesWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4289, - "end": 4346, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4324, - "end": 4334, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4324, - "end": 4327, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 4328, - "end": 4334, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 4329, - "end": 4333, - "ctxt": 0 - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 4335, - "end": 4343, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4335, - "end": 4338, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4339, - "end": 4343, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4411, - "end": 4481, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4417, - "end": 4480, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4417, - "end": 4418, - "ctxt": 0 - }, - "value": "w", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4421, - "end": 4480, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4422, - "end": 4455, - "ctxt": 0 - }, - "value": "JustPropTypesWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4421, - "end": 4480, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4456, - "end": 4466, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4456, - "end": 4459, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4460, - "end": 4466, - "ctxt": 0 - }, - "value": "cool", - "raw": "\"cool\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 4467, - "end": 4477, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4467, - "end": 4470, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 4471, - "end": 4477, - "ctxt": 0 - }, - "expression": { - "type": "NullLiteral", - "span": { - "start": 4472, - "end": 4476, - "ctxt": 0 - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 4515, - "end": 4551, - "ctxt": 0 - }, - "value": "JustDefaultPropsWithSpecifiedGeneric", - "optional": false - }, - "declare": false, - "span": { - "start": 4509, - "end": 4642, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 4591, - "end": 4640, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 4598, - "end": 4610, - "ctxt": 0 - }, - "value": "defaultProps", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 4613, - "end": 4639, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 4623, - "end": 4626, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4628, - "end": 4632, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - } - ] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 4560, - "end": 4574, - "ctxt": 0 - }, - "value": "ReactComponent", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 4574, - "end": 4584, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 4575, - "end": 4583, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 4575, - "end": 4583, - "ctxt": 0 - }, - "value": "FooProps", - "optional": false - }, - "typeParams": null - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4644, - "end": 4704, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4650, - "end": 4703, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4650, - "end": 4651, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4654, - "end": 4703, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4655, - "end": 4691, - "ctxt": 0 - }, - "value": "JustDefaultPropsWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4654, - "end": 4703, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4692, - "end": 4700, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4692, - "end": 4695, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4696, - "end": 4700, - "ctxt": 0 - }, - "value": "eh", - "raw": "\"eh\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4705, - "end": 4774, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4711, - "end": 4773, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4711, - "end": 4712, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4715, - "end": 4773, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4716, - "end": 4752, - "ctxt": 0 - }, - "value": "JustDefaultPropsWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4715, - "end": 4773, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4753, - "end": 4761, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4753, - "end": 4756, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4757, - "end": 4761, - "ctxt": 0 - }, - "value": "no", - "raw": "\"no\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 4762, - "end": 4770, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4762, - "end": 4765, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 4766, - "end": 4770, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4803, - "end": 4863, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4809, - "end": 4862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4809, - "end": 4810, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4813, - "end": 4862, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4814, - "end": 4850, - "ctxt": 0 - }, - "value": "JustDefaultPropsWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4813, - "end": 4862, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 4851, - "end": 4859, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 4851, - "end": 4854, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 4855, - "end": 4859, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 4856, - "end": 4858, - "ctxt": 0 - }, - "value": 12.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 4885, - "end": 4937, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 4891, - "end": 4936, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 4891, - "end": 4893, - "ctxt": 0 - }, - "value": "aa", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 4896, - "end": 4936, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 4897, - "end": 4933, - "ctxt": 0 - }, - "value": "JustDefaultPropsWithSpecifiedGeneric", - "optional": false - }, - "span": { - "start": 4896, - "end": 4936, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxNoJsx.json b/crates/swc_ecma_parser/tests/tsc/tsxNoJsx.json deleted file mode 100644 index 3d58b7723e7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxNoJsx.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 27, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 18, - "end": 27, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 18, - "end": 26, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 19, - "end": 23, - "ctxt": 0 - }, - "value": "nope", - "optional": false - }, - "span": { - "start": 18, - "end": 26, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxOpeningClosingNames.json b/crates/swc_ecma_parser/tests/tsc/tsxOpeningClosingNames.json deleted file mode 100644 index 1261c2feb85..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxOpeningClosingNames.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 84, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 84, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 86, - "end": 124, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "body": { - "type": "TsNamespaceDeclaration", - "span": { - "start": 103, - "end": 124, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 103, - "end": 104, - "ctxt": 0 - }, - "value": "B", - "optional": false - }, - "body": { - "type": "TsNamespaceDeclaration", - "span": { - "start": 105, - "end": 124, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 105, - "end": 106, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 107, - "end": 124, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 111, - "end": 122, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 115, - "end": 121, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": "D", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 116, - "end": 121, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 118, - "end": 121, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - ] - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 126, - "end": 152, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 126, - "end": 152, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 127, - "end": 128, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "value": "B", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 131, - "end": 132, - "ctxt": 0 - }, - "value": "C", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 133, - "end": 134, - "ctxt": 0 - }, - "value": "D", - "optional": false - } - }, - "span": { - "start": 126, - "end": 135, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "foo", - "raw": "foo" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 138, - "end": 152, - "ctxt": 0 - }, - "name": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "JSXMemberExpression", - "object": { - "type": "Identifier", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 144, - "end": 145, - "ctxt": 0 - }, - "value": "B", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 148, - "end": 149, - "ctxt": 0 - }, - "value": "C", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 150, - "end": 151, - "ctxt": 0 - }, - "value": "D", - "optional": false - } - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxParseTests1.json b/crates/swc_ecma_parser/tests/tsc/tsxParseTests1.json deleted file mode 100644 index 5d372509bea..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxParseTests1.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 185, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 128, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 128, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 126, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 114, - "end": 118, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 119, - "end": 123, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 130, - "end": 185, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 134, - "end": 184, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 138, - "end": 184, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 139, - "end": 142, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 143, - "end": 178, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 144, - "end": 147, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 143, - "end": 148, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 148, - "end": 172, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 149, - "end": 153, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 148, - "end": 154, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 154, - "end": 165, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 154, - "end": 159, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 159, - "end": 165, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 161, - "end": 164, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 167, - "end": 171, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 172, - "end": 178, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 178, - "end": 184, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxParseTests2.json b/crates/swc_ecma_parser/tests/tsc/tsxParseTests2.json deleted file mode 100644 index 24d1abbd216..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxParseTests2.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 39, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 39, - "end": 128, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 54, - "end": 57, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 58, - "end": 128, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 61, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 84, - "end": 126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 111, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 112, - "end": 126, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 114, - "end": 118, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 114, - "end": 117, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 119, - "end": 123, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 130, - "end": 154, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 134, - "end": 153, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 134, - "end": 135, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 138, - "end": 153, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 138, - "end": 147, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 147, - "end": 153, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 149, - "end": 152, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit1.json b/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit1.json deleted file mode 100644 index 9961f73762d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit1.json +++ /dev/null @@ -1,647 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 72, - "end": 591, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 72, - "end": 124, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 87, - "end": 94, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 95, - "end": 124, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 98, - "end": 109, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 102, - "end": 108, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 102, - "end": 103, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 103, - "end": 108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 105, - "end": 108, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsExportAssignment", - "span": { - "start": 111, - "end": 122, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 120, - "end": 121, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 126, - "end": 194, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 141, - "end": 152, - "ctxt": 0 - }, - "value": "ReactRouter", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 153, - "end": 194, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 156, - "end": 171, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 165, - "ctxt": 0 - }, - "value": "Route", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 173, - "end": 192, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "value": "Thing", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 189, - "end": 192, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 195, - "end": 251, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "StringLiteral", - "span": { - "start": 210, - "end": 224, - "ctxt": 0 - }, - "value": "react-router", - "raw": "'react-router'" - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 225, - "end": 251, - "ctxt": 0 - }, - "body": [ - { - "type": "TsExportAssignment", - "span": { - "start": 228, - "end": 249, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 237, - "end": 248, - "ctxt": 0 - }, - "value": "ReactRouter", - "optional": false - } - } - ] - } - }, - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 332, - "end": 364, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 339, - "end": 344, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 347, - "end": 363, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 355, - "end": 362, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 365, - "end": 410, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 372, - "end": 383, - "ctxt": 0 - }, - "value": "ReactRouter", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 386, - "end": 409, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 394, - "end": 408, - "ctxt": 0 - }, - "value": "react-router", - "raw": "'react-router'" - } - } - }, - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 412, - "end": 445, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 419, - "end": 424, - "ctxt": 0 - }, - "value": "Route", - "optional": false - }, - "moduleRef": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 427, - "end": 438, - "ctxt": 0 - }, - "value": "ReactRouter", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 439, - "end": 444, - "ctxt": 0 - }, - "value": "Route", - "optional": false - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 447, - "end": 471, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 451, - "end": 470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 451, - "end": 458, - "ctxt": 0 - }, - "value": "routes1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 461, - "end": 470, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 462, - "end": 467, - "ctxt": 0 - }, - "value": "Route", - "optional": false - }, - "span": { - "start": 461, - "end": 470, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 473, - "end": 505, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 480, - "end": 481, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 482, - "end": 505, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 485, - "end": 503, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 492, - "end": 503, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 496, - "end": 502, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 496, - "end": 497, - "ctxt": 0 - }, - "value": "X", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 497, - "end": 502, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 499, - "end": 502, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 506, - "end": 591, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 513, - "end": 514, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 515, - "end": 591, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 573, - "end": 589, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 577, - "end": 588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 577, - "end": 578, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 581, - "end": 588, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 582, - "end": 583, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "span": { - "start": 581, - "end": 584, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 584, - "end": 588, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 586, - "end": 587, - "ctxt": 0 - }, - "value": "X", - "optional": false - } - } - }, - "definite": false - } - ] - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit2.json b/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit2.json deleted file mode 100644 index 5ba5ee40707..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit2.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 71, - "end": 111, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 71, - "end": 86, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 75, - "end": 85, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 75, - "end": 80, - "ctxt": 0 - }, - "value": "Route", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 80, - "end": 85, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 82, - "end": 85, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 87, - "end": 111, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 91, - "end": 110, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 98, - "ctxt": 0 - }, - "value": "routes1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 101, - "end": 110, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 102, - "end": 107, - "ctxt": 0 - }, - "value": "Route", - "optional": false - }, - "span": { - "start": 101, - "end": 110, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit3.json b/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit3.json deleted file mode 100644 index b3ce03c5fc3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxPreserveEmit3.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 55, - "end": 291, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 55, - "end": 154, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 70, - "end": 73, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 74, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 77, - "end": 98, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 87, - "end": 94, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 95, - "end": 98, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 100, - "end": 152, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 110, - "end": 127, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 128, - "end": 152, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 133, - "end": 142, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 134, - "end": 142, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 136, - "end": 142, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 143, - "end": 148, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 145, - "end": 148, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 132, - "end": 149, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 179, - "end": 196, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 186, - "end": 196, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 190, - "end": 195, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 190, - "end": 195, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 262, - "end": 291, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 282, - "end": 290, - "ctxt": 0 - }, - "value": "./test", - "raw": "\"./test\"" - }, - "typeOnly": false, - "asserts": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter1.json b/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter1.json deleted file mode 100644 index a9b3cb062fb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter1.json +++ /dev/null @@ -1,485 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 318, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 196, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 194, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "declare": true, - "span": { - "start": 198, - "end": 284, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 266, - "end": 282, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 266, - "end": 278, - "ctxt": 0 - }, - "value": "internalProp", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 278, - "end": 281, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 280, - "end": 281, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 280, - "end": 281, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 237, - "end": 252, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 218, - "end": 228, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 219, - "end": 227, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 252, - "end": 259, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 256, - "end": 258, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 286, - "end": 318, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 290, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 294, - "end": 318, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 294, - "end": 318, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 302, - "end": 308, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 304, - "end": 308, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 305, - "end": 307, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 309, - "end": 315, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 311, - "end": 315, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter2.json b/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter2.json deleted file mode 100644 index 3eed478413f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter2.json +++ /dev/null @@ -1,513 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 330, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 196, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 194, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "declare": true, - "span": { - "start": 198, - "end": 284, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 266, - "end": 282, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 266, - "end": 278, - "ctxt": 0 - }, - "value": "internalProp", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 278, - "end": 281, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 280, - "end": 281, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 280, - "end": 281, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 237, - "end": 252, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 237, - "end": 242, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 218, - "end": 228, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 219, - "end": 227, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 227, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - } - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 252, - "end": 259, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 256, - "end": 258, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 286, - "end": 304, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 290, - "end": 304, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 294, - "end": 304, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 294, - "end": 304, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 305, - "end": 330, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 309, - "end": 330, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 309, - "end": 311, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 314, - "end": 330, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 315, - "end": 321, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 314, - "end": 330, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 322, - "end": 328, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 324, - "end": 328, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter3.json b/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter3.json deleted file mode 100644 index 0bf3a847e0c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactComponentWithDefaultTypeParameter3.json +++ /dev/null @@ -1,640 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 396, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 163, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 164, - "end": 196, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 170, - "end": 180, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 170, - "end": 171, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 171, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 185, - "end": 194, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 186, - "end": 194, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 188, - "end": 194, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "declare": true, - "span": { - "start": 198, - "end": 290, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 272, - "end": 288, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 272, - "end": 284, - "ctxt": 0 - }, - "value": "internalProp", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 243, - "end": 258, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 243, - "end": 248, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 218, - "end": 234, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 219, - "end": 233, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 229, - "end": 233, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 229, - "end": 233, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - "default": null - } - ] - }, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 258, - "end": 265, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 259, - "end": 260, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 259, - "end": 260, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 262, - "end": 264, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 301, - "end": 320, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 305, - "end": 320, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 305, - "end": 307, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 310, - "end": 320, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 311, - "end": 317, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 310, - "end": 320, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 328, - "end": 360, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 332, - "end": 360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 336, - "end": 360, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 337, - "end": 343, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 336, - "end": 360, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 344, - "end": 350, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 346, - "end": 350, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 347, - "end": 349, - "ctxt": 0 - }, - "value": 10.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 351, - "end": 357, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 351, - "end": 352, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 353, - "end": 357, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 371, - "end": 396, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 375, - "end": 396, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 375, - "end": 377, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 380, - "end": 396, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "value": "MyComp", - "optional": false - }, - "span": { - "start": 380, - "end": 396, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 388, - "end": 394, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 388, - "end": 389, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit1.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit1.json deleted file mode 100644 index 9506978d247..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit1.json +++ /dev/null @@ -1,2829 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 1043, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 161, - "end": 167, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 168, - "end": 194, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 172, - "end": 193, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 172, - "end": 183, - "ctxt": 0 - }, - "value": "selfClosed1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 186, - "end": 193, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 186, - "end": 193, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 195, - "end": 227, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 199, - "end": 226, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 199, - "end": 210, - "ctxt": 0 - }, - "value": "selfClosed2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 213, - "end": 226, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 214, - "end": 217, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 213, - "end": 226, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 218, - "end": 223, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 218, - "end": 219, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 220, - "end": 223, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 228, - "end": 260, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 232, - "end": 259, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 232, - "end": 243, - "ctxt": 0 - }, - "value": "selfClosed3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 246, - "end": 259, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 246, - "end": 259, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 251, - "end": 256, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 251, - "end": 252, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "value": "1", - "raw": "'1'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 261, - "end": 299, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 265, - "end": 298, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 276, - "ctxt": 0 - }, - "value": "selfClosed4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 279, - "end": 298, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 279, - "end": 298, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 284, - "end": 289, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 284, - "end": 285, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 290, - "end": 295, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 300, - "end": 338, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 304, - "end": 337, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 304, - "end": 315, - "ctxt": 0 - }, - "value": "selfClosed5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 318, - "end": 337, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 318, - "end": 337, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 323, - "end": 328, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 323, - "end": 324, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 325, - "end": 328, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 329, - "end": 334, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 329, - "end": 330, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 331, - "end": 334, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 339, - "end": 379, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 343, - "end": 378, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 343, - "end": 354, - "ctxt": 0 - }, - "value": "selfClosed6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 357, - "end": 378, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 361, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 357, - "end": 378, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 362, - "end": 369, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 362, - "end": 363, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 364, - "end": 369, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": "1", - "raw": "\"1\"" - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 370, - "end": 375, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 372, - "end": 375, - "ctxt": 0 - }, - "value": "0", - "raw": "'0'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 380, - "end": 420, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 384, - "end": 419, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 384, - "end": 395, - "ctxt": 0 - }, - "value": "selfClosed7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 398, - "end": 419, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 399, - "end": 402, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 398, - "end": 419, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 403, - "end": 408, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 403, - "end": 404, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 405, - "end": 408, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 406, - "end": 407, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 409, - "end": 414, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 409, - "end": 410, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "p", - "raw": "'p'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 415, - "end": 416, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 415, - "end": 416, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 422, - "end": 452, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 426, - "end": 451, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 426, - "end": 437, - "ctxt": 0 - }, - "value": "openClosed1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 440, - "end": 451, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 441, - "end": 444, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 440, - "end": 445, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 445, - "end": 451, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 447, - "end": 450, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 453, - "end": 492, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 457, - "end": 491, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 457, - "end": 468, - "ctxt": 0 - }, - "value": "openClosed2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 471, - "end": 491, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 472, - "end": 475, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 471, - "end": 482, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 476, - "end": 481, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 476, - "end": 477, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "value": "foo", - "raw": "foo" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 485, - "end": 491, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 493, - "end": 532, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 497, - "end": 531, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 497, - "end": 508, - "ctxt": 0 - }, - "value": "openClosed3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 511, - "end": 531, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 512, - "end": 515, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 511, - "end": 522, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 516, - "end": 521, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 516, - "end": 517, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 518, - "end": 521, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 522, - "end": 525, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 523, - "end": 524, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 525, - "end": 531, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 527, - "end": 530, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 533, - "end": 576, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 537, - "end": 575, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 537, - "end": 548, - "ctxt": 0 - }, - "value": "openClosed4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 551, - "end": 575, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 552, - "end": 555, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 551, - "end": 562, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 556, - "end": 561, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 556, - "end": 557, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 558, - "end": 561, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 562, - "end": 569, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 563, - "end": 568, - "ctxt": 0 - }, - "operator": "<", - "left": { - "type": "Identifier", - "span": { - "start": 563, - "end": 564, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 567, - "end": 568, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 569, - "end": 575, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 574, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 577, - "end": 622, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 581, - "end": 621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 581, - "end": 592, - "ctxt": 0 - }, - "value": "openClosed5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 595, - "end": 621, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 596, - "end": 599, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 595, - "end": 608, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 600, - "end": 605, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 600, - "end": 601, - "ctxt": 0 - }, - "value": "n", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 602, - "end": 605, - "ctxt": 0 - }, - "value": "m", - "raw": "'m'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 606, - "end": 607, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": null - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 608, - "end": 615, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 609, - "end": 614, - "ctxt": 0 - }, - "operator": ">", - "left": { - "type": "Identifier", - "span": { - "start": 609, - "end": 610, - "ctxt": 0 - }, - "value": "p", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 613, - "end": 614, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 615, - "end": 621, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 630, - "end": 639, - "ctxt": 0 - }, - "value": "SomeClass", - "optional": false - }, - "declare": false, - "span": { - "start": 624, - "end": 911, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 643, - "end": 909, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 643, - "end": 644, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 643, - "end": 909, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 647, - "end": 909, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 651, - "end": 691, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 655, - "end": 690, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 655, - "end": 664, - "ctxt": 0 - }, - "value": "rewrites1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 667, - "end": 690, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 668, - "end": 671, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 667, - "end": 672, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 672, - "end": 684, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 673, - "end": 683, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 679, - "end": 683, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 684, - "end": 690, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 686, - "end": 689, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 694, - "end": 736, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 698, - "end": 735, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 698, - "end": 707, - "ctxt": 0 - }, - "value": "rewrites2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 710, - "end": 735, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 711, - "end": 714, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 710, - "end": 715, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 715, - "end": 729, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 716, - "end": 728, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 717, - "end": 718, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": { - "start": 720, - "end": 723, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 723, - "end": 724, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 726, - "end": 727, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ] - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 729, - "end": 735, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 731, - "end": 734, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 739, - "end": 772, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 743, - "end": 771, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 743, - "end": 752, - "ctxt": 0 - }, - "value": "rewrites3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 755, - "end": 771, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 756, - "end": 759, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 755, - "end": 760, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 760, - "end": 765, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 761, - "end": 764, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 762, - "end": 763, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - ] - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 765, - "end": 771, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 767, - "end": 770, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 776, - "end": 819, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 780, - "end": 818, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 780, - "end": 789, - "ctxt": 0 - }, - "value": "rewrites4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 792, - "end": 818, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 793, - "end": 796, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 792, - "end": 812, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 797, - "end": 811, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 797, - "end": 798, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 799, - "end": 811, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 800, - "end": 810, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "ThisExpression", - "span": { - "start": 806, - "end": 810, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 812, - "end": 818, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 814, - "end": 817, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 822, - "end": 867, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 826, - "end": 866, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 826, - "end": 835, - "ctxt": 0 - }, - "value": "rewrites5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 838, - "end": 866, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 839, - "end": 842, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 838, - "end": 860, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 843, - "end": 859, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 843, - "end": 844, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 845, - "end": 859, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 846, - "end": 858, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 847, - "end": 848, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": { - "start": 850, - "end": 853, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 853, - "end": 854, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 856, - "end": 857, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 860, - "end": 866, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 862, - "end": 865, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 870, - "end": 906, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 874, - "end": 905, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 874, - "end": 883, - "ctxt": 0 - }, - "value": "rewrites6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 886, - "end": 905, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 887, - "end": 890, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 886, - "end": 899, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 891, - "end": 898, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 891, - "end": 892, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 893, - "end": 898, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 894, - "end": 897, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 895, - "end": 896, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 899, - "end": 905, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 901, - "end": 904, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 913, - "end": 949, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 917, - "end": 948, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 917, - "end": 928, - "ctxt": 0 - }, - "value": "whitespace1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 931, - "end": 948, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 932, - "end": 935, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 931, - "end": 936, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 936, - "end": 942, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 942, - "end": 948, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 944, - "end": 947, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 950, - "end": 989, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 954, - "end": 988, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 954, - "end": 965, - "ctxt": 0 - }, - "value": "whitespace2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 968, - "end": 988, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 969, - "end": 972, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 968, - "end": 973, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 973, - "end": 975, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 975, - "end": 978, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 976, - "end": 977, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 978, - "end": 982, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 982, - "end": 988, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 990, - "end": 1043, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 994, - "end": 1042, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 994, - "end": 1005, - "ctxt": 0 - }, - "value": "whitespace3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1008, - "end": 1042, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1009, - "end": 1012, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1008, - "end": 1013, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1013, - "end": 1022, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 1022, - "end": 1025, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1023, - "end": 1024, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 1025, - "end": 1036, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1036, - "end": 1042, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1038, - "end": 1041, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit2.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit2.json deleted file mode 100644 index e226d47af1b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit2.json +++ /dev/null @@ -1,1064 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 420, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 161, - "end": 191, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 165, - "end": 172, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 167, - "ctxt": 0 - }, - "value": "p1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 167, - "end": 172, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 174, - "end": 181, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 174, - "end": 176, - "ctxt": 0 - }, - "value": "p2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 183, - "end": 190, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 185, - "ctxt": 0 - }, - "value": "p3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 185, - "end": 190, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 187, - "end": 190, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 231, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 196, - "end": 230, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 196, - "end": 204, - "ctxt": 0 - }, - "value": "spreads1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 207, - "end": 230, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 208, - "end": 211, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 207, - "end": 220, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 216, - "end": 218, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 221, - "end": 223, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 224, - "end": 230, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 226, - "end": 229, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 232, - "end": 271, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 236, - "end": 270, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 236, - "end": 244, - "ctxt": 0 - }, - "value": "spreads2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 247, - "end": 270, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 248, - "end": 251, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 247, - "end": 260, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 253, - "end": 256, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 256, - "end": 258, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 261, - "end": 263, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 264, - "end": 270, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 269, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 272, - "end": 318, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 276, - "end": 317, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 276, - "end": 284, - "ctxt": 0 - }, - "value": "spreads3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 287, - "end": 317, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 288, - "end": 291, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 287, - "end": 307, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 292, - "end": 298, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 295, - "end": 297, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 300, - "end": 303, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 303, - "end": 305, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 307, - "end": 311, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 308, - "end": 310, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 311, - "end": 317, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 313, - "end": 316, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 319, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 323, - "end": 365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 323, - "end": 331, - "ctxt": 0 - }, - "value": "spreads4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 334, - "end": 365, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 335, - "end": 338, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 334, - "end": 355, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 343, - "end": 345, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 347, - "end": 353, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 347, - "end": 348, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 349, - "end": 353, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 350, - "end": 352, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 355, - "end": 359, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 356, - "end": 358, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 359, - "end": 365, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 361, - "end": 364, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 367, - "end": 420, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 371, - "end": 419, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 371, - "end": 379, - "ctxt": 0 - }, - "value": "spreads5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 382, - "end": 419, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 382, - "end": 409, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 387, - "end": 393, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 387, - "end": 388, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 389, - "end": 393, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 390, - "end": 392, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 395, - "end": 398, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 398, - "end": 400, - "ctxt": 0 - }, - "value": "p1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 402, - "end": 408, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 402, - "end": 403, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 404, - "end": 408, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 405, - "end": 407, - "ctxt": 0 - }, - "value": "p3", - "optional": false - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 409, - "end": 413, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 410, - "end": 412, - "ctxt": 0 - }, - "value": "p2", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 415, - "end": 418, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit3.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit3.json deleted file mode 100644 index bcaabb4762b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit3.json +++ /dev/null @@ -1,434 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 37, - "end": 186, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 37, - "end": 81, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 56, - "end": 81, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 82, - "end": 105, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 94, - "end": 104, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 94, - "end": 99, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 99, - "end": 104, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 101, - "end": 104, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 107, - "end": 133, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 122, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 124, - "end": 127, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 124, - "end": 127, - "ctxt": 0 - }, - "value": "Bar", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - }, - { - "type": "VariableDeclarator", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 129, - "end": 132, - "ctxt": 0 - }, - "value": "baz", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 135, - "end": 186, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 135, - "end": 185, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 136, - "end": 139, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 135, - "end": 140, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 140, - "end": 141, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 141, - "end": 155, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 142, - "end": 145, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "span": { - "start": 141, - "end": 146, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 146, - "end": 149, - "ctxt": 0 - }, - "value": " q ", - "raw": " q " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 149, - "end": 155, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 151, - "end": 154, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 155, - "end": 156, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXElement", - "span": { - "start": 156, - "end": 162, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 157, - "end": 160, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "span": { - "start": 156, - "end": 162, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "value": " s ", - "raw": " s " - }, - { - "type": "JSXElement", - "span": { - "start": 167, - "end": 173, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "span": { - "start": 167, - "end": 173, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXElement", - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 174, - "end": 177, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "span": { - "start": 173, - "end": 179, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit4.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit4.json deleted file mode 100644 index 9206a79dfd6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit4.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 298, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 161, - "end": 172, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 165, - "end": 171, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 166, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 166, - "end": 171, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 168, - "end": 171, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 173, - "end": 216, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 177, - "end": 215, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 177, - "end": 188, - "ctxt": 0 - }, - "value": "openClosed1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 191, - "end": 215, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 191, - "end": 196, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "value": "\n\n\n\n ", - "raw": "\n\n\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 201, - "end": 207, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 202, - "end": 206, - "ctxt": 0 - }, - "value": "blah", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 207, - "end": 209, - "ctxt": 0 - }, - "value": "\n\n\n\n", - "raw": "\n\n\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 209, - "end": 215, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 263, - "end": 298, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 267, - "end": 297, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 274, - "ctxt": 0 - }, - "value": "spread1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 277, - "end": 297, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 281, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 277, - "end": 297, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 283, - "end": 286, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 289, - "end": 294, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 291, - "end": 294, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": 0.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit5.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit5.json deleted file mode 100644 index 1ff5c48a8a8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit5.json +++ /dev/null @@ -1,428 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 57, - "end": 382, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 156, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 135, - "end": 144, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 134, - "end": 151, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 181, - "end": 198, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 188, - "end": 198, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 192, - "end": 197, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 192, - "end": 197, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": null - }, - "init": null, - "definite": false - } - ] - } - }, - { - "type": "ImportDeclaration", - "span": { - "start": 232, - "end": 261, - "ctxt": 0 - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "span": { - "start": 240, - "end": 245, - "ctxt": 0 - }, - "local": { - "type": "Identifier", - "span": { - "start": 240, - "end": 245, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "imported": null, - "isTypeOnly": false - } - ], - "source": { - "type": "StringLiteral", - "span": { - "start": 252, - "end": 260, - "ctxt": 0 - }, - "value": "./test", - "raw": "\"./test\"" - }, - "typeOnly": false, - "asserts": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 327, - "end": 340, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 331, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 331, - "end": 334, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 334, - "end": 339, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 336, - "end": 339, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 341, - "end": 382, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 345, - "end": 381, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 345, - "end": 352, - "ctxt": 0 - }, - "value": "spread1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 355, - "end": 381, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 355, - "end": 381, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 360, - "end": 364, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 360, - "end": 361, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 362, - "end": 364, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 366, - "end": 369, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 374, - "end": 378, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 374, - "end": 375, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 376, - "end": 378, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit6.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit6.json deleted file mode 100644 index 6795dc180eb..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit6.json +++ /dev/null @@ -1,553 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 57, - "end": 420, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 156, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 135, - "end": 144, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 134, - "end": 151, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 190, - "end": 229, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 202, - "end": 229, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 205, - "end": 227, - "ctxt": 0 - }, - "declaration": { - "type": "VariableDeclaration", - "span": { - "start": 212, - "end": 227, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 216, - "end": 226, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 221, - "end": 226, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - } - } - ] - } - }, - { - "type": "TsModuleDeclaration", - "span": { - "start": 231, - "end": 420, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 241, - "end": 242, - "ctxt": 0 - }, - "value": "M", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 243, - "end": 420, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 310, - "end": 323, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 314, - "end": 322, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 317, - "end": 322, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 319, - "end": 322, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 325, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 329, - "end": 365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 329, - "end": 336, - "ctxt": 0 - }, - "value": "spread1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 339, - "end": 365, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 339, - "end": 365, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 344, - "end": 348, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 350, - "end": 353, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 353, - "end": 356, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 358, - "end": 362, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 360, - "end": 362, - "ctxt": 0 - }, - "value": "", - "raw": "''" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 380, - "end": 418, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 384, - "end": 417, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 384, - "end": 385, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 388, - "end": 417, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 389, - "end": 392, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 393, - "end": 411, - "ctxt": 0 - }, - "value": "This \"quote\" thing", - "raw": "This \"quote\" thing" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 411, - "end": 417, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 413, - "end": 416, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit7.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit7.json deleted file mode 100644 index 348ff9b92d3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit7.json +++ /dev/null @@ -1,1139 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 57, - "end": 458, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 57, - "end": 156, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 75, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 76, - "end": 156, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 79, - "end": 100, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 102, - "end": 154, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 112, - "end": 129, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 130, - "end": 154, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 135, - "end": 144, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 144, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 144, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 147, - "end": 150, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 134, - "end": 151, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 158, - "end": 188, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 162, - "end": 187, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": "m", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 166, - "end": 187, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 166, - "end": 181, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 171, - "end": 180, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 171, - "end": 174, - "ctxt": 0 - }, - "value": "x-y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 175, - "end": 180, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 183, - "end": 186, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 189, - "end": 220, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 193, - "end": 219, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 197, - "end": 219, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 197, - "end": 213, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 202, - "end": 212, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 202, - "end": 206, - "ctxt": 0 - }, - "value": "xx-y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 207, - "end": 212, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 215, - "end": 218, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 221, - "end": 252, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 225, - "end": 251, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 225, - "end": 226, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 229, - "end": 251, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 229, - "end": 245, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 234, - "end": 244, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "value": "x-yy", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 239, - "end": 244, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 245, - "end": 251, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 253, - "end": 285, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 257, - "end": 284, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 261, - "end": 284, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 261, - "end": 278, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 266, - "end": 277, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 271, - "ctxt": 0 - }, - "value": "xx-yy", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 272, - "end": 277, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 278, - "end": 284, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 304, - "end": 332, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 308, - "end": 331, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 312, - "end": 331, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 313, - "end": 316, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 312, - "end": 325, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 317, - "end": 324, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 317, - "end": 318, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 319, - "end": 324, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 325, - "end": 331, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 327, - "end": 330, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 333, - "end": 362, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 337, - "end": 361, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 337, - "end": 338, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 341, - "end": 361, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 342, - "end": 345, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 341, - "end": 355, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 346, - "end": 354, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": "xx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 349, - "end": 354, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 355, - "end": 361, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 357, - "end": 360, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 363, - "end": 393, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 367, - "end": 392, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 367, - "end": 368, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 371, - "end": 392, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 372, - "end": 375, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 371, - "end": 386, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 376, - "end": 385, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "value": "xxx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 380, - "end": 385, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 386, - "end": 392, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 388, - "end": 391, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 394, - "end": 425, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 398, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 402, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 403, - "end": 406, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 402, - "end": 418, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 407, - "end": 417, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - }, - "value": "xxxx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 412, - "end": 417, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 418, - "end": 424, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 420, - "end": 423, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 426, - "end": 458, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 457, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 431, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 434, - "end": 457, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 435, - "end": 438, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 434, - "end": 451, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 439, - "end": 450, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 439, - "end": 444, - "ctxt": 0 - }, - "value": "xxxxx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 445, - "end": 450, - "ctxt": 0 - }, - "value": "val", - "raw": "\"val\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 451, - "end": 457, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 453, - "end": 456, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit8.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmit8.json deleted file mode 100644 index b8a7c40800b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmit8.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 96, - "end": 140, - "ctxt": 0 - }, - "body": [ - { - "type": "ExpressionStatement", - "span": { - "start": 96, - "end": 109, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 96, - "end": 108, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 97, - "end": 100, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 96, - "end": 101, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 101, - "end": 102, - "ctxt": 0 - }, - "value": "1", - "raw": "1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 102, - "end": 108, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 104, - "end": 107, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 110, - "end": 140, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 110, - "end": 139, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 111, - "end": 114, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 110, - "end": 132, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 115, - "end": 131, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 115, - "end": 118, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 119, - "end": 131, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 120, - "end": 130, - "ctxt": 0 - }, - "value": "key-attr", - "raw": "\"key-attr\"" - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "2", - "raw": "2" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 133, - "end": 139, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 135, - "end": 138, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitEntities.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitEntities.json deleted file mode 100644 index 8d8cba1cfd2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitEntities.json +++ /dev/null @@ -1,805 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 727, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 161, - "end": 211, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 161, - "end": 210, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 161, - "end": 166, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 166, - "end": 204, - "ctxt": 0 - }, - "value": "Dot goes here: · ¬AnEntity; ", - "raw": "Dot goes here: · ¬AnEntity; " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 212, - "end": 256, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 212, - "end": 255, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 213, - "end": 216, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 212, - "end": 217, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 217, - "end": 249, - "ctxt": 0 - }, - "value": "Be careful of \"-ed strings!", - "raw": "Be careful of \"-ed strings!" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 249, - "end": 255, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 257, - "end": 300, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 257, - "end": 299, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 258, - "end": 261, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 257, - "end": 262, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 262, - "end": 293, - "ctxt": 0 - }, - "value": "{{braces}}", - "raw": "{{braces}}" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 293, - "end": 299, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 298, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 323, - "end": 337, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 323, - "end": 336, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 323, - "end": 328, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 328, - "end": 330, - "ctxt": 0 - }, - "value": "\\n", - "raw": "\\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 330, - "end": 336, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 332, - "end": 335, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 382, - "end": 424, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 382, - "end": 423, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 382, - "end": 417, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 387, - "end": 416, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 387, - "end": 391, - "ctxt": 0 - }, - "value": "attr", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 392, - "end": 416, - "ctxt": 0 - }, - "value": "{…}\\", - "raw": "\"{…}\\\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 417, - "end": 423, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 419, - "end": 422, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 528, - "end": 573, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 528, - "end": 572, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 529, - "end": 532, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 528, - "end": 566, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 533, - "end": 565, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 533, - "end": 537, - "ctxt": 0 - }, - "value": "attr", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 538, - "end": 565, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 539, - "end": 564, - "ctxt": 0 - }, - "value": "{…}\"", - "raw": "\"{…}\\\"\"" - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 566, - "end": 572, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 568, - "end": 571, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 601, - "end": 622, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 601, - "end": 621, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 602, - "end": 605, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 601, - "end": 615, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 606, - "end": 614, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 606, - "end": 610, - "ctxt": 0 - }, - "value": "attr", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 611, - "end": 614, - "ctxt": 0 - }, - "value": "\"", - "raw": "'\"'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 615, - "end": 621, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 679, - "end": 727, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 679, - "end": 726, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 680, - "end": 683, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 679, - "end": 684, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 684, - "end": 720, - "ctxt": 0 - }, - "value": "🐈🐕🐇🐑", - "raw": "🐈🐕🐇🐑" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 720, - "end": 726, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 722, - "end": 725, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitNesting.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitNesting.json deleted file mode 100644 index 787294072c0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitNesting.json +++ /dev/null @@ -1,2520 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 61, - "end": 1610, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 61, - "end": 83, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 73, - "end": 82, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 73, - "end": 77, - "ctxt": 0 - }, - "value": "vdom", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 77, - "end": 82, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 79, - "end": 82, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 84, - "end": 106, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 96, - "end": 105, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 96, - "end": 100, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 100, - "end": 105, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 107, - "end": 130, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 119, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "model", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 196, - "end": 1610, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 200, - "end": 1610, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 200, - "end": 206, - "ctxt": 0 - }, - "value": "render", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 209, - "end": 1610, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 210, - "end": 214, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false, - "typeAnnotation": null - }, - { - "type": "Identifier", - "span": { - "start": 216, - "end": 221, - "ctxt": 0 - }, - "value": "model", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 230, - "end": 1610, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 231, - "end": 238, - "ctxt": 0 - }, - "value": "section", - "optional": false - }, - "span": { - "start": 230, - "end": 255, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 239, - "end": 254, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 239, - "end": 244, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 245, - "end": 254, - "ctxt": 0 - }, - "value": "todoapp", - "raw": "\"todoapp\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 255, - "end": 264, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 264, - "end": 510, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "value": "header", - "optional": false - }, - "span": { - "start": 264, - "end": 287, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 272, - "end": 286, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 272, - "end": 277, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 278, - "end": 286, - "ctxt": 0 - }, - "value": "header", - "raw": "\"header\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 287, - "end": 300, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 300, - "end": 324, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 301, - "end": 303, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 300, - "end": 304, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 304, - "end": 319, - "ctxt": 0 - }, - "value": "todos ", - "raw": "todos " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 319, - "end": 324, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 321, - "end": 323, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 324, - "end": 337, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 337, - "end": 492, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 343, - "ctxt": 0 - }, - "value": "input", - "optional": false - }, - "span": { - "start": 337, - "end": 492, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 344, - "end": 360, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 349, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 350, - "end": 360, - "ctxt": 0 - }, - "value": "new-todo", - "raw": "\"new-todo\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 361, - "end": 370, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 361, - "end": 370, - "ctxt": 0 - }, - "value": "autofocus", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 371, - "end": 389, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 371, - "end": 383, - "ctxt": 0 - }, - "value": "autocomplete", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 384, - "end": 389, - "ctxt": 0 - }, - "value": "off", - "raw": "\"off\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 390, - "end": 426, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 390, - "end": 401, - "ctxt": 0 - }, - "value": "placeholder", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 402, - "end": 426, - "ctxt": 0 - }, - "value": "What needs to be done?", - "raw": "\"What needs to be done?\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 427, - "end": 448, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 427, - "end": 432, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 433, - "end": 448, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 434, - "end": 447, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 434, - "end": 439, - "ctxt": 0 - }, - "value": "model", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 440, - "end": 447, - "ctxt": 0 - }, - "value": "newTodo", - "optional": false - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 449, - "end": 489, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 449, - "end": 456, - "ctxt": 0 - }, - "value": "onKeyup", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 457, - "end": 489, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 458, - "end": 488, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 458, - "end": 475, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 458, - "end": 470, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 458, - "end": 462, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 463, - "end": 470, - "ctxt": 0 - }, - "value": "addTodo", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 471, - "end": 475, - "ctxt": 0 - }, - "value": "bind", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 476, - "end": 480, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 482, - "end": 487, - "ctxt": 0 - }, - "value": "model", - "optional": false - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 492, - "end": 501, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 501, - "end": 510, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 509, - "ctxt": 0 - }, - "value": "header", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 510, - "end": 519, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 519, - "end": 1595, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 520, - "end": 527, - "ctxt": 0 - }, - "value": "section", - "optional": false - }, - "span": { - "start": 519, - "end": 614, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 528, - "end": 540, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 528, - "end": 533, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 534, - "end": 540, - "ctxt": 0 - }, - "value": "main", - "raw": "\"main\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 541, - "end": 613, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 541, - "end": 546, - "ctxt": 0 - }, - "value": "style", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 547, - "end": 613, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 548, - "end": 612, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 549, - "end": 556, - "ctxt": 0 - }, - "value": "display", - "optional": false - }, - "value": { - "type": "ConditionalExpression", - "span": { - "start": 557, - "end": 611, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 557, - "end": 592, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 558, - "end": 591, - "ctxt": 0 - }, - "operator": "&&", - "left": { - "type": "MemberExpression", - "span": { - "start": 558, - "end": 569, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 558, - "end": 563, - "ctxt": 0 - }, - "value": "model", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 564, - "end": 569, - "ctxt": 0 - }, - "value": "todos", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 573, - "end": 591, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 573, - "end": 584, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 573, - "end": 578, - "ctxt": 0 - }, - "value": "model", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 579, - "end": 584, - "ctxt": 0 - }, - "value": "todos", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 585, - "end": 591, - "ctxt": 0 - }, - "value": "length", - "optional": false - } - } - } - }, - "consequent": { - "type": "StringLiteral", - "span": { - "start": 595, - "end": 602, - "ctxt": 0 - }, - "value": "block", - "raw": "\"block\"" - }, - "alternate": { - "type": "StringLiteral", - "span": { - "start": 605, - "end": 611, - "ctxt": 0 - }, - "value": "none", - "raw": "\"none\"" - } - } - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 614, - "end": 627, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 627, - "end": 707, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 628, - "end": 633, - "ctxt": 0 - }, - "value": "input", - "optional": false - }, - "span": { - "start": 627, - "end": 707, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 634, - "end": 652, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 634, - "end": 639, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 640, - "end": 652, - "ctxt": 0 - }, - "value": "toggle-all", - "raw": "\"toggle-all\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 653, - "end": 668, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 653, - "end": 657, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 658, - "end": 668, - "ctxt": 0 - }, - "value": "checkbox", - "raw": "\"checkbox\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 669, - "end": 705, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 669, - "end": 677, - "ctxt": 0 - }, - "value": "onChange", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 678, - "end": 705, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 679, - "end": 704, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 679, - "end": 698, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 679, - "end": 693, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 679, - "end": 683, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 684, - "end": 693, - "ctxt": 0 - }, - "value": "toggleAll", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 694, - "end": 698, - "ctxt": 0 - }, - "value": "bind", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 699, - "end": 703, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 707, - "end": 720, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 720, - "end": 1576, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 721, - "end": 723, - "ctxt": 0 - }, - "value": "ul", - "optional": false - }, - "span": { - "start": 720, - "end": 742, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 724, - "end": 741, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 724, - "end": 729, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 730, - "end": 741, - "ctxt": 0 - }, - "value": "todo-list", - "raw": "\"todo-list\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 742, - "end": 759, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 759, - "end": 1558, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 760, - "end": 1557, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 760, - "end": 783, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 760, - "end": 779, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 760, - "end": 765, - "ctxt": 0 - }, - "value": "model", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 766, - "end": 779, - "ctxt": 0 - }, - "value": "filteredTodos", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 780, - "end": 783, - "ctxt": 0 - }, - "value": "map", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 784, - "end": 1539, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 785, - "end": 789, - "ctxt": 0 - }, - "value": "todo", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 814, - "end": 1539, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 815, - "end": 817, - "ctxt": 0 - }, - "value": "li", - "optional": false - }, - "span": { - "start": 814, - "end": 901, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 818, - "end": 900, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 818, - "end": 823, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 824, - "end": 900, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 825, - "end": 899, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 826, - "end": 830, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 832, - "end": 836, - "ctxt": 0 - }, - "value": true - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 838, - "end": 847, - "ctxt": 0 - }, - "value": "completed", - "optional": false - }, - "value": { - "type": "MemberExpression", - "span": { - "start": 849, - "end": 863, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 849, - "end": 853, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 854, - "end": 863, - "ctxt": 0 - }, - "value": "completed", - "optional": false - } - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 865, - "end": 872, - "ctxt": 0 - }, - "value": "editing", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 874, - "end": 898, - "ctxt": 0 - }, - "operator": "==", - "left": { - "type": "Identifier", - "span": { - "start": 874, - "end": 878, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 882, - "end": 898, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 882, - "end": 887, - "ctxt": 0 - }, - "value": "model", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 888, - "end": 898, - "ctxt": 0 - }, - "value": "editedTodo", - "optional": false - } - } - } - } - ] - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 901, - "end": 926, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 926, - "end": 1513, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 927, - "end": 930, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 926, - "end": 944, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 931, - "end": 943, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 931, - "end": 936, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 937, - "end": 943, - "ctxt": 0 - }, - "value": "view", - "raw": "\"view\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 944, - "end": 973, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 973, - "end": 1140, - "ctxt": 0 - }, - "expression": { - "type": "ConditionalExpression", - "span": { - "start": 974, - "end": 1110, - "ctxt": 0 - }, - "test": { - "type": "ParenthesisExpression", - "span": { - "start": 974, - "end": 990, - "ctxt": 0 - }, - "expression": { - "type": "UnaryExpression", - "span": { - "start": 975, - "end": 989, - "ctxt": 0 - }, - "operator": "!", - "argument": { - "type": "MemberExpression", - "span": { - "start": 976, - "end": 989, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 976, - "end": 980, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 981, - "end": 989, - "ctxt": 0 - }, - "value": "editable", - "optional": false - } - } - } - }, - "consequent": { - "type": "JSXElement", - "span": { - "start": 1025, - "end": 1071, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1026, - "end": 1031, - "ctxt": 0 - }, - "value": "input", - "optional": false - }, - "span": { - "start": 1025, - "end": 1063, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1032, - "end": 1046, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1032, - "end": 1037, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1038, - "end": 1046, - "ctxt": 0 - }, - "value": "toggle", - "raw": "\"toggle\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1047, - "end": 1062, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1047, - "end": 1051, - "ctxt": 0 - }, - "value": "type", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1052, - "end": 1062, - "ctxt": 0 - }, - "value": "checkbox", - "raw": "\"checkbox\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1063, - "end": 1071, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1065, - "end": 1070, - "ctxt": 0 - }, - "value": "input", - "optional": false - } - } - }, - "alternate": { - "type": "NullLiteral", - "span": { - "start": 1106, - "end": 1110, - "ctxt": 0 - } - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1140, - "end": 1169, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 1169, - "end": 1238, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1170, - "end": 1175, - "ctxt": 0 - }, - "value": "label", - "optional": false - }, - "span": { - "start": 1169, - "end": 1218, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1176, - "end": 1217, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1176, - "end": 1189, - "ctxt": 0 - }, - "value": "onDoubleClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1190, - "end": 1217, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1191, - "end": 1216, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1195, - "end": 1216, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1196, - "end": 1215, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1196, - "end": 1215, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1196, - "end": 1209, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1196, - "end": 1200, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1201, - "end": 1209, - "ctxt": 0 - }, - "value": "editTodo", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1210, - "end": 1214, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 1218, - "end": 1230, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1219, - "end": 1229, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1219, - "end": 1223, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1224, - "end": 1229, - "ctxt": 0 - }, - "value": "title", - "optional": false - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1230, - "end": 1238, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1232, - "end": 1237, - "ctxt": 0 - }, - "value": "label", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1238, - "end": 1267, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 1267, - "end": 1342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1268, - "end": 1274, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 1267, - "end": 1333, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1275, - "end": 1290, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1275, - "end": 1280, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1281, - "end": 1290, - "ctxt": 0 - }, - "value": "destroy", - "raw": "\"destroy\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1291, - "end": 1332, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1291, - "end": 1298, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1299, - "end": 1332, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1300, - "end": 1331, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1300, - "end": 1320, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 1300, - "end": 1315, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1300, - "end": 1304, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1305, - "end": 1315, - "ctxt": 0 - }, - "value": "removeTodo", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1316, - "end": 1320, - "ctxt": 0 - }, - "value": "bind", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1321, - "end": 1325, - "ctxt": 0 - }, - "value": "ctrl", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1326, - "end": 1330, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - ], - "typeArguments": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1333, - "end": 1342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1335, - "end": 1341, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1342, - "end": 1371, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 1371, - "end": 1482, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1372, - "end": 1375, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1371, - "end": 1395, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1376, - "end": 1394, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1376, - "end": 1381, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1382, - "end": 1394, - "ctxt": 0 - }, - "value": "iconBorder", - "raw": "\"iconBorder\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1395, - "end": 1428, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 1428, - "end": 1447, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1429, - "end": 1432, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1428, - "end": 1447, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1433, - "end": 1445, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1433, - "end": 1438, - "ctxt": 0 - }, - "value": "class", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1439, - "end": 1445, - "ctxt": 0 - }, - "value": "icon", - "raw": "\"icon\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 1447, - "end": 1476, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1476, - "end": 1482, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1478, - "end": 1481, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1482, - "end": 1507, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1507, - "end": 1513, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1509, - "end": 1512, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1513, - "end": 1534, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1534, - "end": 1539, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1536, - "end": 1538, - "ctxt": 0 - }, - "value": "li", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "JSXText", - "span": { - "start": 1558, - "end": 1571, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1571, - "end": 1576, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1573, - "end": 1575, - "ctxt": 0 - }, - "value": "ul", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1576, - "end": 1585, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1585, - "end": 1595, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1587, - "end": 1594, - "ctxt": 0 - }, - "value": "section", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 1595, - "end": 1600, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1600, - "end": 1610, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1602, - "end": 1609, - "ctxt": 0 - }, - "value": "section", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.json deleted file mode 100644 index 8a77ac5b3de..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.json +++ /dev/null @@ -1,2038 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 121, - "end": 866, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 121, - "end": 203, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 137, - "end": 139, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 140, - "end": 146, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 140, - "end": 146, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 141, - "end": 146, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 143, - "end": 146, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 128, - "end": 203, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 148, - "end": 203, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 154, - "end": 201, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 161, - "end": 200, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 161, - "end": 192, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 166, - "end": 182, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 166, - "end": 175, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 176, - "end": 182, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 177, - "end": 181, - "ctxt": 0 - }, - "value": "T1", - "raw": "\"T1\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 185, - "end": 188, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 192, - "end": 194, - "ctxt": 0 - }, - "value": "T1", - "raw": "T1" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 194, - "end": 200, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 196, - "end": 199, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 205, - "end": 304, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 221, - "end": 223, - "ctxt": 0 - }, - "value": "T2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 224, - "end": 230, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 224, - "end": 230, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 227, - "end": 230, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 232, - "end": 238, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 233, - "end": 238, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 235, - "end": 238, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 212, - "end": 304, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 240, - "end": 304, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 246, - "end": 302, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 253, - "end": 301, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 254, - "end": 257, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 253, - "end": 293, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 258, - "end": 274, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 258, - "end": 267, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 268, - "end": 274, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 269, - "end": 273, - "ctxt": 0 - }, - "value": "T2", - "raw": "\"T2\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 277, - "end": 280, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 280, - "end": 281, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 289, - "end": 290, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 293, - "end": 295, - "ctxt": 0 - }, - "value": "T2", - "raw": "T2" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 306, - "end": 405, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 322, - "end": 324, - "ctxt": 0 - }, - "value": "T3", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 325, - "end": 331, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 325, - "end": 331, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 326, - "end": 331, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 328, - "end": 331, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 333, - "end": 339, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 333, - "end": 339, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 334, - "end": 339, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 336, - "end": 339, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 313, - "end": 405, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 341, - "end": 405, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 347, - "end": 403, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 354, - "end": 402, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 355, - "end": 358, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 354, - "end": 394, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 361, - "end": 364, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 364, - "end": 365, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 368, - "end": 384, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 368, - "end": 377, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 378, - "end": 384, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 379, - "end": 383, - "ctxt": 0 - }, - "value": "T3", - "raw": "\"T3\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 387, - "end": 390, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 394, - "end": 396, - "ctxt": 0 - }, - "value": "T3", - "raw": "T3" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 396, - "end": 402, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 401, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 407, - "end": 510, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 423, - "end": 425, - "ctxt": 0 - }, - "value": "T4", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 426, - "end": 432, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 426, - "end": 432, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 427, - "end": 432, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 429, - "end": 432, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 434, - "end": 440, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 434, - "end": 440, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 435, - "end": 440, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 437, - "end": 440, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 414, - "end": 510, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 442, - "end": 510, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 448, - "end": 508, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 455, - "end": 507, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 456, - "end": 459, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 455, - "end": 499, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 460, - "end": 476, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 460, - "end": 469, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 470, - "end": 476, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 471, - "end": 475, - "ctxt": 0 - }, - "value": "T4", - "raw": "\"T4\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 479, - "end": 482, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 482, - "end": 496, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 484, - "end": 487, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 490, - "end": 493, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 493, - "end": 494, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 499, - "end": 501, - "ctxt": 0 - }, - "value": "T4", - "raw": "T4" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 501, - "end": 507, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 506, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 512, - "end": 644, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 528, - "end": 530, - "ctxt": 0 - }, - "value": "T5", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 531, - "end": 537, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 531, - "end": 537, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 532, - "end": 537, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 534, - "end": 537, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 539, - "end": 545, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 539, - "end": 545, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 540, - "end": 545, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 542, - "end": 545, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 547, - "end": 553, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 547, - "end": 553, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 548, - "end": 553, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 550, - "end": 553, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 555, - "end": 561, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 555, - "end": 561, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 556, - "end": 561, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 558, - "end": 561, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 519, - "end": 644, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 563, - "end": 644, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 569, - "end": 642, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 576, - "end": 641, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 577, - "end": 580, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 576, - "end": 633, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 581, - "end": 597, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 581, - "end": 590, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 591, - "end": 597, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 592, - "end": 596, - "ctxt": 0 - }, - "value": "T5", - "raw": "\"T5\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 600, - "end": 603, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 603, - "end": 630, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 605, - "end": 608, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 608, - "end": 609, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 611, - "end": 614, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 614, - "end": 615, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 620, - "end": 628, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 622, - "end": 623, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - { - "type": "Identifier", - "span": { - "start": 625, - "end": 626, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - ] - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 633, - "end": 635, - "ctxt": 0 - }, - "value": "T5", - "raw": "T5" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 635, - "end": 641, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 637, - "end": 640, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 646, - "end": 784, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 662, - "end": 664, - "ctxt": 0 - }, - "value": "T6", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 666, - "end": 671, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 668, - "end": 671, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 673, - "end": 679, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 673, - "end": 679, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 674, - "end": 679, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 676, - "end": 679, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 681, - "end": 687, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 681, - "end": 687, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 682, - "end": 687, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 684, - "end": 687, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 689, - "end": 695, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 689, - "end": 695, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 690, - "end": 695, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 692, - "end": 695, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 653, - "end": 784, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 697, - "end": 784, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 703, - "end": 782, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 710, - "end": 781, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 711, - "end": 714, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 710, - "end": 773, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 715, - "end": 731, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 715, - "end": 724, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 725, - "end": 731, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 726, - "end": 730, - "ctxt": 0 - }, - "value": "T6", - "raw": "\"T6\"" - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 734, - "end": 737, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 737, - "end": 770, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 739, - "end": 742, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 742, - "end": 743, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 745, - "end": 748, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 751, - "end": 754, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 754, - "end": 768, - "ctxt": 0 - }, - "properties": [ - { - "type": "SpreadElement", - "spread": { - "start": 756, - "end": 759, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 759, - "end": 760, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 762, - "end": 765, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 765, - "end": 766, - "ctxt": 0 - }, - "value": "d", - "optional": false - } - } - ] - } - } - ] - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 773, - "end": 775, - "ctxt": 0 - }, - "value": "T6", - "raw": "T6" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 775, - "end": 781, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 777, - "end": 780, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 786, - "end": 866, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 802, - "end": 804, - "ctxt": 0 - }, - "value": "T7", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 805, - "end": 811, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 805, - "end": 811, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 806, - "end": 811, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 808, - "end": 811, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 813, - "end": 819, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 813, - "end": 819, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 814, - "end": 819, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 816, - "end": 819, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 821, - "end": 827, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 821, - "end": 827, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 822, - "end": 827, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 824, - "end": 827, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 829, - "end": 835, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 829, - "end": 835, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 830, - "end": 835, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 832, - "end": 835, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 793, - "end": 866, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 837, - "end": 866, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 843, - "end": 864, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 850, - "end": 863, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 851, - "end": 854, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 850, - "end": 855, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 855, - "end": 857, - "ctxt": 0 - }, - "value": "T7", - "raw": "T7" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 857, - "end": 863, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 859, - "end": 862, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.ts b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.ts deleted file mode 100644 index 2ddc20ae39f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitSpreadAttribute.ts +++ /dev/null @@ -1,32 +0,0 @@ -// @jsx: react-jsx -// @target: es2015,es2018,esnext -// @filename: test.tsx -/// - -export function T1(a: any) { - return
T1
; -} - -export function T2(a: any, b: any) { - return
T2
; -} - -export function T3(a: any, b: any) { - return
T3
; -} - -export function T4(a: any, b: any) { - return
T4
; -} - -export function T5(a: any, b: any, c: any, d: any) { - return
T5
; -} - -export function T6(a: any, b: any, c: any, d: any) { - return
T6
; -} - -export function T7(a: any, b: any, c: any, d: any) { - return
T7
; -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace.json deleted file mode 100644 index cf5bc219638..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace.json +++ /dev/null @@ -1,1069 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 759, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 263, - "end": 273, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 267, - "end": 272, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 267, - "end": 268, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "value": 0.0 - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 288, - "end": 303, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 288, - "end": 302, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 289, - "end": 292, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 288, - "end": 293, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 293, - "end": 296, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 296, - "end": 302, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 327, - "end": 348, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 327, - "end": 347, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 328, - "end": 331, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 327, - "end": 332, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 332, - "end": 334, - "ctxt": 0 - }, - "value": " ", - "raw": " " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 334, - "end": 337, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 335, - "end": 336, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 337, - "end": 341, - "ctxt": 0 - }, - "value": " ", - "raw": " " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 341, - "end": 347, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 343, - "end": 346, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 364, - "end": 399, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 364, - "end": 398, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 368, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 364, - "end": 369, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 369, - "end": 378, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 378, - "end": 381, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 379, - "end": 380, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 381, - "end": 392, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 392, - "end": 398, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 416, - "end": 439, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 416, - "end": 438, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 420, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 416, - "end": 421, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 424, - "end": 427, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 425, - "end": 426, - "ctxt": 0 - }, - "value": "p", - "optional": false - } - }, - { - "type": "JSXText", - "span": { - "start": 427, - "end": 432, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 432, - "end": 438, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 434, - "end": 437, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 455, - "end": 475, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 455, - "end": 474, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 456, - "end": 459, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 455, - "end": 460, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 460, - "end": 468, - "ctxt": 0 - }, - "value": " 3 \n\n ", - "raw": " 3 \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 468, - "end": 474, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 470, - "end": 473, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 493, - "end": 510, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 493, - "end": 509, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 493, - "end": 498, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 498, - "end": 503, - "ctxt": 0 - }, - "value": " 3 ", - "raw": " 3 " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 503, - "end": 509, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 505, - "end": 508, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 524, - "end": 552, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 524, - "end": 551, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 525, - "end": 528, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 524, - "end": 529, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 529, - "end": 545, - "ctxt": 0 - }, - "value": " \n\n 3 \n\n ", - "raw": " \n\n 3 \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 545, - "end": 551, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 547, - "end": 550, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 570, - "end": 589, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 570, - "end": 588, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 571, - "end": 574, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 570, - "end": 575, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 575, - "end": 582, - "ctxt": 0 - }, - "value": " \n\n ", - "raw": " \n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 582, - "end": 588, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 584, - "end": 587, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 609, - "end": 644, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 609, - "end": 643, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 610, - "end": 613, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 609, - "end": 614, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 614, - "end": 637, - "ctxt": 0 - }, - "value": " \n\n\n\n foo\n\n\n\n bar \n\n\n\n ", - "raw": " \n\n\n\n foo\n\n\n\n bar \n\n\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 637, - "end": 643, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 639, - "end": 642, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 670, - "end": 702, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 670, - "end": 701, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 671, - "end": 674, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 670, - "end": 675, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 675, - "end": 695, - "ctxt": 0 - }, - "value": "\n\n\n\n hello\\\n\n\n\nworld\n\n", - "raw": "\n\n\n\n hello\\\n\n\n\nworld\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 695, - "end": 701, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 697, - "end": 700, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 727, - "end": 759, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 727, - "end": 758, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 728, - "end": 731, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 727, - "end": 732, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 732, - "end": 752, - "ctxt": 0 - }, - "value": " a\n\n b c\n\n d ", - "raw": " a\n\n b c\n\n d " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 752, - "end": 758, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 754, - "end": 757, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace2.json b/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace2.json deleted file mode 100644 index b925692744c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxReactEmitWhitespace2.json +++ /dev/null @@ -1,567 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 36, - "end": 321, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 36, - "end": 135, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 51, - "end": 54, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 55, - "end": 135, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 58, - "end": 79, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 68, - "end": 75, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 76, - "end": 79, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 81, - "end": 133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 91, - "end": 108, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 109, - "end": 133, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 114, - "end": 123, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 115, - "end": 123, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 117, - "end": 123, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 113, - "end": 130, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 136, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 148, - "end": 158, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 148, - "end": 153, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 153, - "end": 158, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 196, - "end": 235, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 196, - "end": 234, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 197, - "end": 200, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 196, - "end": 201, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 201, - "end": 206, - "ctxt": 0 - }, - "value": "word ", - "raw": "word " - }, - { - "type": "JSXElement", - "span": { - "start": 206, - "end": 223, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "value": "code", - "optional": false - }, - "span": { - "start": 206, - "end": 212, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 212, - "end": 216, - "ctxt": 0 - }, - "value": "code", - "raw": "code" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 216, - "end": 223, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 218, - "end": 222, - "ctxt": 0 - }, - "value": "code", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "value": " word", - "raw": " word" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 228, - "end": 234, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 249, - "end": 283, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 249, - "end": 282, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 250, - "end": 253, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 249, - "end": 254, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 254, - "end": 271, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 255, - "end": 259, - "ctxt": 0 - }, - "value": "code", - "optional": false - }, - "span": { - "start": 254, - "end": 260, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "code", - "raw": "code" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 264, - "end": 271, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 270, - "ctxt": 0 - }, - "value": "code", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 271, - "end": 276, - "ctxt": 0 - }, - "value": " word", - "raw": " word" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 276, - "end": 282, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 278, - "end": 281, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 296, - "end": 321, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 296, - "end": 320, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXElement", - "span": { - "start": 301, - "end": 309, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 302, - "end": 306, - "ctxt": 0 - }, - "value": "code", - "optional": false - }, - "span": { - "start": 301, - "end": 309, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "value": " word", - "raw": " word" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 314, - "end": 320, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNull.json b/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNull.json deleted file mode 100644 index 201f431ae42..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNull.json +++ /dev/null @@ -1,387 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 295, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 163, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 198, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 171, - "end": 197, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 171, - "end": 174, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 177, - "end": 197, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 185, - "end": 188, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "NullLiteral", - "span": { - "start": 193, - "end": 197, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 209, - "end": 214, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 215, - "end": 233, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 215, - "end": 233, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 216, - "end": 233, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 218, - "end": 233, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 219, - "end": 232, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 219, - "end": 223, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 224, - "end": 232, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 226, - "end": 232, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 200, - "end": 252, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 235, - "end": 252, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 238, - "end": 250, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 245, - "end": 249, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 254, - "end": 274, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 260, - "end": 273, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 260, - "end": 263, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 266, - "end": 273, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 266, - "end": 273, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 275, - "end": 295, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 281, - "end": 294, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": "G", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 285, - "end": 294, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 285, - "end": 294, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNullStrictNullChecks.json b/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNullStrictNullChecks.json deleted file mode 100644 index b43a0d4899d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnNullStrictNullChecks.json +++ /dev/null @@ -1,387 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 158, - "end": 322, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 158, - "end": 190, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 173, - "end": 189, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 181, - "end": 188, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 225, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 198, - "end": 224, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 204, - "end": 224, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 205, - "end": 215, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 215, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "NullLiteral", - "span": { - "start": 220, - "end": 224, - "ctxt": 0 - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 236, - "end": 241, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 242, - "end": 260, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 242, - "end": 260, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 243, - "end": 260, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 245, - "end": 260, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 246, - "end": 259, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 246, - "end": 250, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 251, - "end": 259, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 253, - "end": 259, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 227, - "end": 279, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 262, - "end": 279, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 265, - "end": 277, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 272, - "end": 276, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 281, - "end": 301, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 287, - "end": 300, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 287, - "end": 290, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 293, - "end": 300, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 294, - "end": 297, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 293, - "end": 300, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 302, - "end": 322, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 308, - "end": 321, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 308, - "end": 309, - "ctxt": 0 - }, - "value": "G", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 313, - "end": 318, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 312, - "end": 321, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnUndefinedStrictNullChecks.json b/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnUndefinedStrictNullChecks.json deleted file mode 100644 index 85ae4e4f0aa..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSfcReturnUndefinedStrictNullChecks.json +++ /dev/null @@ -1,391 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 158, - "end": 340, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 158, - "end": 190, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 173, - "end": 189, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 181, - "end": 188, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 192, - "end": 230, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 198, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 204, - "end": 229, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 205, - "end": 215, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 210, - "end": 215, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 212, - "end": 215, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 220, - "end": 229, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 240, - "end": 245, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 246, - "end": 264, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 247, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 249, - "end": 264, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 250, - "end": 263, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 250, - "end": 254, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 255, - "end": 263, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 257, - "end": 263, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 231, - "end": 288, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 266, - "end": 288, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 269, - "end": 286, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 276, - "end": 285, - "ctxt": 0 - }, - "value": "undefined", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 299, - "end": 319, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 305, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 311, - "end": 318, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 312, - "end": 315, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 311, - "end": 318, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 340, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 326, - "end": 339, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 326, - "end": 327, - "ctxt": 0 - }, - "value": "G", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 330, - "end": 339, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 331, - "end": 336, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 330, - "end": 339, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution1.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution1.json deleted file mode 100644 index c7aa3f256ff..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution1.json +++ /dev/null @@ -1,431 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 330, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 253, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 202, - "end": 251, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 208, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 202, - "end": 251, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 211, - "end": 251, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 221, - "end": 245, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 228, - "end": 244, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 229, - "end": 232, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 228, - "end": 233, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 233, - "end": 238, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 238, - "end": 244, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 240, - "end": 243, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 172, - "end": 187, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 172, - "end": 177, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 178, - "end": 187, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 187, - "end": 195, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 188, - "end": 190, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 192, - "end": 194, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 255, - "end": 270, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 261, - "end": 269, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 278, - "end": 308, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 282, - "end": 307, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 282, - "end": 283, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 286, - "end": 307, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 287, - "end": 295, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 286, - "end": 307, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 300, - "end": 303, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 309, - "end": 330, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 313, - "end": 329, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 317, - "end": 329, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 318, - "end": 326, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 317, - "end": 329, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution10.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution10.json deleted file mode 100644 index 8e1e97af0e7..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution10.json +++ /dev/null @@ -1,919 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 487, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 183, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 169, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 170, - "end": 183, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 191, - "end": 194, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "declare": false, - "span": { - "start": 185, - "end": 292, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 241, - "end": 290, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 241, - "end": 247, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 241, - "end": 290, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 250, - "end": 290, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 260, - "end": 284, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 267, - "end": 283, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 267, - "end": 272, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 272, - "end": 277, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 277, - "end": 283, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 203, - "end": 218, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 203, - "end": 208, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 209, - "end": 218, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 218, - "end": 234, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 219, - "end": 229, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 219, - "end": 229, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 231, - "end": 233, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 294, - "end": 321, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 300, - "end": 320, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 300, - "end": 303, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 303, - "end": 315, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 305, - "end": 315, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 305, - "end": 315, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 318, - "end": 320, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 322, - "end": 359, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 328, - "end": 359, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 328, - "end": 332, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 332, - "end": 344, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 334, - "end": 344, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 334, - "end": 344, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 347, - "end": 359, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 356, - "end": 357, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 370, - "end": 400, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 374, - "end": 399, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 374, - "end": 375, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 378, - "end": 399, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 379, - "end": 382, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 378, - "end": 399, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 384, - "end": 387, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 387, - "end": 390, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 392, - "end": 397, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 392, - "end": 393, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "value": 3.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 401, - "end": 434, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 405, - "end": 433, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 405, - "end": 407, - "ctxt": 0 - }, - "value": "y1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 410, - "end": 433, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 410, - "end": 433, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 416, - "end": 419, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 419, - "end": 423, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 425, - "end": 431, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 425, - "end": 426, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 427, - "end": 431, - "ctxt": 0 - }, - "value": "Hi", - "raw": "\"Hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 435, - "end": 467, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 439, - "end": 466, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 439, - "end": 441, - "ctxt": 0 - }, - "value": "y2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 444, - "end": 466, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 445, - "end": 448, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 444, - "end": 466, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 450, - "end": 453, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 453, - "end": 457, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 459, - "end": 464, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 459, - "end": 460, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 461, - "end": 464, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": 3.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 468, - "end": 487, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 472, - "end": 486, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 472, - "end": 474, - "ctxt": 0 - }, - "value": "y3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 477, - "end": 486, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 477, - "end": 486, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution11.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution11.json deleted file mode 100644 index 4d60387875a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution11.json +++ /dev/null @@ -1,1768 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 880, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 164, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 200, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 171, - "end": 200, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 175, - "end": 185, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 177, - "end": 185, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 179, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 179, - "end": 180, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 180, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 182, - "end": 183, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 188, - "end": 200, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 194, - "end": 195, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 201, - "end": 281, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 207, - "end": 281, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "value": "obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 242, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 213, - "end": 242, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 214, - "end": 222, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 214, - "end": 215, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 215, - "end": 221, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 223, - "end": 240, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 223, - "end": 232, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 240, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 234, - "end": 240, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 245, - "end": 281, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 251, - "end": 252, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 254, - "end": 258, - "ctxt": 0 - }, - "value": true - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 264, - "end": 273, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 275, - "end": 279, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 283, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 293, - "end": 297, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 298, - "end": 344, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 304, - "end": 308, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 304, - "end": 305, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 307, - "end": 308, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 307, - "end": 308, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 313, - "end": 320, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 314, - "end": 320, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 325, - "end": 342, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 325, - "end": 334, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 334, - "end": 342, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 352, - "end": 365, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "declare": false, - "span": { - "start": 346, - "end": 457, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 406, - "end": 455, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 406, - "end": 412, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 406, - "end": 455, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 415, - "end": 455, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 425, - "end": 449, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 432, - "end": 448, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 433, - "end": 436, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 432, - "end": 437, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 437, - "end": 442, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 442, - "end": 448, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 374, - "end": 389, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 374, - "end": 379, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 380, - "end": 389, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 389, - "end": 399, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 396, - "end": 398, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 459, - "end": 475, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 474, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "value": "anyobj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 469, - "end": 474, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 471, - "end": 474, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 482, - "end": 543, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 486, - "end": 543, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 486, - "end": 487, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 490, - "end": 543, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 491, - "end": 504, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 490, - "end": 543, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 506, - "end": 509, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 509, - "end": 512, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 514, - "end": 515, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 514, - "end": 515, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 516, - "end": 530, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 516, - "end": 525, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 532, - "end": 535, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 535, - "end": 539, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 544, - "end": 590, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 548, - "end": 590, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 548, - "end": 550, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 553, - "end": 590, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 554, - "end": 567, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 553, - "end": 590, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 569, - "end": 572, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 572, - "end": 576, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 579, - "end": 582, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 582, - "end": 586, - "ctxt": 0 - }, - "value": "obj3", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 591, - "end": 663, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 595, - "end": 663, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 595, - "end": 597, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 600, - "end": 663, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 601, - "end": 614, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 600, - "end": 663, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 615, - "end": 620, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 615, - "end": 616, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 617, - "end": 620, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 618, - "end": 619, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 621, - "end": 635, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 621, - "end": 630, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 631, - "end": 635, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 637, - "end": 640, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 640, - "end": 644, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 647, - "end": 650, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 650, - "end": 659, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 651, - "end": 652, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 654, - "end": 658, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 664, - "end": 761, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 668, - "end": 761, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 668, - "end": 670, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 673, - "end": 761, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 674, - "end": 687, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 673, - "end": 761, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 688, - "end": 702, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 688, - "end": 697, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 698, - "end": 702, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 704, - "end": 707, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 707, - "end": 711, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 713, - "end": 718, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 713, - "end": 714, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 715, - "end": 718, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 716, - "end": 717, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 720, - "end": 723, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 723, - "end": 757, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 724, - "end": 725, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 727, - "end": 731, - "ctxt": 0 - }, - "value": true - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 733, - "end": 734, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 736, - "end": 737, - "ctxt": 0 - }, - "value": 2.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 739, - "end": 748, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 749, - "end": 756, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 762, - "end": 841, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 766, - "end": 841, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 766, - "end": 768, - "ctxt": 0 - }, - "value": "x4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 771, - "end": 841, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 772, - "end": 785, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 771, - "end": 841, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 787, - "end": 790, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 790, - "end": 796, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 791, - "end": 792, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 794, - "end": 795, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 799, - "end": 802, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 802, - "end": 822, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 803, - "end": 812, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 814, - "end": 821, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 825, - "end": 828, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 828, - "end": 837, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 829, - "end": 830, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 832, - "end": 836, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 842, - "end": 880, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 846, - "end": 880, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 846, - "end": 848, - "ctxt": 0 - }, - "value": "x5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 851, - "end": 880, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 852, - "end": 865, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 851, - "end": 880, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 867, - "end": 870, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 870, - "end": 876, - "ctxt": 0 - }, - "value": "anyobj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution12.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution12.json deleted file mode 100644 index 9c9ea6dd954..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution12.json +++ /dev/null @@ -1,1438 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 732, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 164, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 198, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 171, - "end": 198, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 175, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 177, - "end": 183, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 178, - "end": 182, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 182, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 186, - "end": 198, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 192, - "end": 193, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 195, - "end": 196, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 199, - "end": 280, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 205, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 209, - "ctxt": 0 - }, - "value": "obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 209, - "end": 240, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 211, - "end": 240, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 212, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 213, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 215, - "end": 220, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 215, - "end": 220, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 222, - "end": 239, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 222, - "end": 231, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 231, - "end": 239, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 233, - "end": 239, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 243, - "end": 280, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 252, - "end": 257, - "ctxt": 0 - }, - "value": false - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 272, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 274, - "end": 278, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 282, - "end": 344, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 292, - "end": 296, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 297, - "end": 344, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 303, - "end": 307, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 306, - "end": 307, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 312, - "end": 320, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 320, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 325, - "end": 342, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 325, - "end": 334, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 334, - "end": 342, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 336, - "end": 342, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 352, - "end": 365, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "declare": false, - "span": { - "start": 346, - "end": 457, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 406, - "end": 455, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 406, - "end": 412, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 406, - "end": 455, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 415, - "end": 455, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 425, - "end": 449, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 432, - "end": 448, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 433, - "end": 436, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 432, - "end": 437, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 437, - "end": 442, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 442, - "end": 448, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 374, - "end": 389, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 374, - "end": 379, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 380, - "end": 389, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 389, - "end": 399, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 396, - "end": 398, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 459, - "end": 475, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 474, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "value": "anyobj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 469, - "end": 474, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 471, - "end": 474, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 486, - "end": 547, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 490, - "end": 547, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 490, - "end": 491, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 494, - "end": 547, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 495, - "end": 508, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 494, - "end": 547, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 510, - "end": 513, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 513, - "end": 516, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 518, - "end": 519, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 518, - "end": 519, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 520, - "end": 534, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 530, - "end": 534, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 536, - "end": 539, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 539, - "end": 543, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 548, - "end": 620, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 552, - "end": 620, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 552, - "end": 554, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 557, - "end": 620, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 558, - "end": 571, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 557, - "end": 620, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 572, - "end": 586, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 572, - "end": 581, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 582, - "end": 586, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 588, - "end": 591, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 591, - "end": 595, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 597, - "end": 602, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 597, - "end": 598, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 599, - "end": 602, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 600, - "end": 601, - "ctxt": 0 - }, - "value": 3.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 604, - "end": 607, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 607, - "end": 616, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 608, - "end": 609, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 611, - "end": 615, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 621, - "end": 665, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 625, - "end": 665, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 625, - "end": 627, - "ctxt": 0 - }, - "value": "x2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 630, - "end": 665, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 631, - "end": 644, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 630, - "end": 665, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 646, - "end": 649, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 649, - "end": 655, - "ctxt": 0 - }, - "value": "anyobj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 657, - "end": 662, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 657, - "end": 658, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 659, - "end": 662, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 660, - "end": 661, - "ctxt": 0 - }, - "value": 3.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 666, - "end": 732, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 670, - "end": 732, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 670, - "end": 672, - "ctxt": 0 - }, - "value": "x3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 675, - "end": 732, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 676, - "end": 689, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 675, - "end": 732, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 690, - "end": 704, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 690, - "end": 699, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 700, - "end": 704, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 706, - "end": 709, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 709, - "end": 713, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 716, - "end": 719, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 719, - "end": 728, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 720, - "end": 721, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 723, - "end": 727, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution13.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution13.json deleted file mode 100644 index 176bf24157e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution13.json +++ /dev/null @@ -1,756 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 679, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 173, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 174, - "end": 223, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 220, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 225, - "end": 499, - "ctxt": 0 - }, - "decl": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 280, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 240, - "end": 499, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 282, - "end": 499, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 288, - "end": 312, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 292, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 292, - "end": 302, - "ctxt": 0 - }, - "value": "condition1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 302, - "end": 311, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 304, - "end": 311, - "ctxt": 0 - }, - "kind": "boolean" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 317, - "end": 497, - "ctxt": 0 - }, - "test": { - "type": "Identifier", - "span": { - "start": 321, - "end": 331, - "ctxt": 0 - }, - "value": "condition1", - "optional": false - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 333, - "end": 410, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 343, - "end": 404, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 350, - "end": 403, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 364, - "end": 393, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 379, - "ctxt": 0 - }, - "value": "ChildComponent", - "optional": false - }, - "span": { - "start": 364, - "end": 393, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 381, - "end": 384, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 384, - "end": 389, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "alternate": { - "type": "BlockStatement", - "span": { - "start": 420, - "end": 497, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 430, - "end": 491, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 437, - "end": 490, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 438, - "end": 489, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 439, - "end": 453, - "ctxt": 0 - }, - "value": "ChildComponent", - "optional": false - }, - "span": { - "start": 438, - "end": 489, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 455, - "end": 458, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 458, - "end": 463, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 465, - "end": 486, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 465, - "end": 474, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 475, - "end": 486, - "ctxt": 0 - }, - "value": "NewString", - "raw": "\"NewString\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 501, - "end": 559, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 511, - "end": 532, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 533, - "end": 559, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 539, - "end": 557, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 539, - "end": 548, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 548, - "end": 556, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 550, - "end": 556, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 570, - "end": 584, - "ctxt": 0 - }, - "value": "ChildComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 585, - "end": 621, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 585, - "end": 621, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 587, - "end": 596, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 587, - "end": 596, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 598, - "end": 621, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 600, - "end": 621, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 600, - "end": 621, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 561, - "end": 679, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 623, - "end": 679, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 629, - "end": 677, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 636, - "end": 676, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 646, - "end": 670, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 647, - "end": 651, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 646, - "end": 652, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 652, - "end": 663, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 653, - "end": 662, - "ctxt": 0 - }, - "value": "property1", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 663, - "end": 670, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 665, - "end": 669, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution14.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution14.json deleted file mode 100644 index 9bdce989fc6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution14.json +++ /dev/null @@ -1,594 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 568, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 173, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 174, - "end": 223, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 220, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 225, - "end": 386, - "ctxt": 0 - }, - "decl": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 280, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 240, - "end": 386, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 282, - "end": 386, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 288, - "end": 384, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 295, - "end": 383, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 337, - "end": 377, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 354, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "span": { - "start": 337, - "end": 377, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 359, - "end": 364, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 366, - "end": 375, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 366, - "end": 375, - "ctxt": 0 - }, - "value": "Property1", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 388, - "end": 446, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 398, - "end": 419, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 420, - "end": 446, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 426, - "end": 444, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 426, - "end": 435, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 435, - "end": 443, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 437, - "end": 443, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 457, - "end": 473, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 474, - "end": 510, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 474, - "end": 510, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 476, - "end": 485, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 476, - "end": 485, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 487, - "end": 510, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 489, - "end": 510, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 489, - "end": 510, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 448, - "end": 568, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 512, - "end": 568, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 518, - "end": 566, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 525, - "end": 565, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 535, - "end": 559, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 536, - "end": 540, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 535, - "end": 541, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 541, - "end": 552, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 542, - "end": 551, - "ctxt": 0 - }, - "value": "property1", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 552, - "end": 559, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 554, - "end": 558, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution15.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution15.json deleted file mode 100644 index 07b968cf211..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution15.json +++ /dev/null @@ -1,704 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 612, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 173, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 174, - "end": 223, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 220, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 225, - "end": 376, - "ctxt": 0 - }, - "decl": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 280, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 240, - "end": 376, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 282, - "end": 376, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 288, - "end": 374, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 295, - "end": 373, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 305, - "end": 367, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 306, - "end": 322, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "span": { - "start": 305, - "end": 367, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 327, - "end": 332, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 334, - "end": 343, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 334, - "end": 343, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 344, - "end": 365, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 360, - "ctxt": 0 - }, - "value": "AnotherProperty1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 361, - "end": 365, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 378, - "end": 490, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 388, - "end": 409, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 410, - "end": 490, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 416, - "end": 434, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 425, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 427, - "end": 433, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 439, - "end": 464, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 439, - "end": 455, - "ctxt": 0 - }, - "value": "AnotherProperty1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 455, - "end": 463, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 457, - "end": 463, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 469, - "end": 488, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 469, - "end": 478, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 478, - "end": 487, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 480, - "end": 487, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 501, - "end": 517, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 518, - "end": 554, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 518, - "end": 554, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 531, - "end": 554, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 533, - "end": 554, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 533, - "end": 554, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 492, - "end": 612, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 556, - "end": 612, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 562, - "end": 610, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 569, - "end": 609, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 579, - "end": 603, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 580, - "end": 584, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 579, - "end": 585, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 585, - "end": 596, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 586, - "end": 595, - "ctxt": 0 - }, - "value": "property1", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 596, - "end": 603, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 598, - "end": 602, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution16.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution16.json deleted file mode 100644 index a7e7a556cc3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution16.json +++ /dev/null @@ -1,657 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 616, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 223, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 173, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 174, - "end": 223, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 180, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 180, - "end": 189, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 191, - "end": 197, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 203, - "end": 221, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 203, - "end": 212, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 212, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 214, - "end": 220, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ExportDefaultDeclaration", - "span": { - "start": 225, - "end": 380, - "ctxt": 0 - }, - "decl": { - "type": "FunctionExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 259, - "end": 280, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 280, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 280, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 240, - "end": 380, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 282, - "end": 380, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 288, - "end": 378, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 295, - "end": 377, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 340, - "end": 371, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 341, - "end": 357, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "span": { - "start": 340, - "end": 371, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 359, - "end": 362, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 362, - "end": 367, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 382, - "end": 494, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 392, - "end": 413, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 414, - "end": 494, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 420, - "end": 438, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 420, - "end": 429, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 429, - "end": 437, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 431, - "end": 437, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 443, - "end": 468, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 443, - "end": 459, - "ctxt": 0 - }, - "value": "AnotherProperty1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 459, - "end": 467, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 461, - "end": 467, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 473, - "end": 492, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 473, - "end": 482, - "ctxt": 0 - }, - "value": "property2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 482, - "end": 491, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 484, - "end": 491, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 505, - "end": 521, - "ctxt": 0 - }, - "value": "AnotherComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 522, - "end": 558, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 522, - "end": 558, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 524, - "end": 533, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 524, - "end": 533, - "ctxt": 0 - }, - "value": "property1", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 535, - "end": 558, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 537, - "end": 558, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 537, - "end": 558, - "ctxt": 0 - }, - "value": "AnotherComponentProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 496, - "end": 616, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 560, - "end": 616, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 566, - "end": 614, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 573, - "end": 613, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 583, - "end": 607, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 584, - "end": 588, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 583, - "end": 589, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 589, - "end": 600, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 590, - "end": 599, - "ctxt": 0 - }, - "value": "property1", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 600, - "end": 607, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 602, - "end": 606, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution17.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution17.json deleted file mode 100644 index e308e834597..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution17.json +++ /dev/null @@ -1,636 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 502, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 131, - "end": 262, - "ctxt": 0 - }, - "declare": true, - "global": true, - "id": { - "type": "Identifier", - "span": { - "start": 139, - "end": 145, - "ctxt": 0 - }, - "value": "global", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 146, - "end": 262, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 152, - "end": 260, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 166, - "end": 260, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 176, - "end": 196, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 186, - "end": 193, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 205, - "end": 254, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 215, - "end": 240, - "ctxt": 0 - }, - "value": "ElementAttributesProperty", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 241, - "end": 254, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 243, - "end": 252, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 243, - "end": 248, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 248, - "end": 252, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 250, - "end": 252, - "ctxt": 0 - }, - "members": [] - } - }, - "typeParams": null - } - ] - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 263, - "end": 286, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 275, - "end": 285, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 280, - "end": 285, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 282, - "end": 285, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 288, - "end": 396, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 301, - "end": 306, - "ctxt": 0 - }, - "value": "Empty", - "optional": false - }, - "declare": false, - "span": { - "start": 295, - "end": 396, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 345, - "end": 394, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 345, - "end": 351, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 345, - "end": 394, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 354, - "end": 394, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 364, - "end": 388, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 371, - "end": 387, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 372, - "end": 375, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 371, - "end": 376, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 376, - "end": 381, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 381, - "end": 387, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 315, - "end": 330, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 321, - "end": 330, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 330, - "end": 338, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 331, - "end": 333, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 335, - "end": 337, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 398, - "end": 455, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 412, - "end": 454, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 412, - "end": 415, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 415, - "end": 454, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 417, - "end": 454, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 417, - "end": 442, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 419, - "end": 440, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 419, - "end": 420, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 420, - "end": 440, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 422, - "end": 440, - "ctxt": 0 - }, - "types": [ - { - "type": "TsKeywordType", - "span": { - "start": 422, - "end": 428, - "ctxt": 0 - }, - "kind": "number" - }, - { - "type": "TsKeywordType", - "span": { - "start": 431, - "end": 440, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsKeywordType", - "span": { - "start": 445, - "end": 454, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 463, - "end": 502, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 467, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 467, - "end": 480, - "ctxt": 0 - }, - "value": "unionedSpread", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 483, - "end": 501, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 484, - "end": 489, - "ctxt": 0 - }, - "value": "Empty", - "optional": false - }, - "span": { - "start": 483, - "end": 501, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 491, - "end": 494, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 494, - "end": 497, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution2.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution2.json deleted file mode 100644 index cb1ff26f5f6..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution2.json +++ /dev/null @@ -1,1051 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 558, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 202, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 171, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 202, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 193, - "end": 200, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 199, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 196, - "end": 199, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 196, - "end": 199, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 210, - "end": 218, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 204, - "end": 318, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 267, - "end": 316, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 267, - "end": 316, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 276, - "end": 316, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 286, - "end": 310, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 293, - "end": 309, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 294, - "end": 297, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 293, - "end": 298, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 298, - "end": 303, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 303, - "end": 309, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 227, - "end": 242, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 227, - "end": 232, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 233, - "end": 242, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 242, - "end": 260, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 243, - "end": 255, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 243, - "end": 255, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 257, - "end": 259, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 335, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 326, - "end": 334, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 326, - "end": 329, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 332, - "end": 334, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 343, - "end": 379, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 343, - "end": 378, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 352, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 343, - "end": 378, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 354, - "end": 357, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 357, - "end": 374, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 361, - "end": 365, - "ctxt": 0 - }, - "value": "ok", - "raw": "\"ok\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 367, - "end": 368, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 370, - "end": 373, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 390, - "end": 420, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 394, - "end": 419, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 398, - "end": 419, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 399, - "end": 407, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 398, - "end": 419, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 409, - "end": 412, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 412, - "end": 415, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 421, - "end": 442, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 425, - "end": 441, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 425, - "end": 426, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 429, - "end": 441, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 430, - "end": 438, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 429, - "end": 441, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 443, - "end": 467, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 447, - "end": 466, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 447, - "end": 448, - "ctxt": 0 - }, - "value": "z", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 451, - "end": 466, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 452, - "end": 460, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 451, - "end": 466, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 461, - "end": 462, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 461, - "end": 462, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 463, - "end": 464, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 463, - "end": 464, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 468, - "end": 508, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 472, - "end": 507, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 472, - "end": 473, - "ctxt": 0 - }, - "value": "w", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 476, - "end": 507, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 477, - "end": 485, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 476, - "end": 507, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 490, - "end": 504, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 491, - "end": 492, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": 5.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 500, - "end": 503, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 509, - "end": 558, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 513, - "end": 557, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 513, - "end": 515, - "ctxt": 0 - }, - "value": "w1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 518, - "end": 557, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 519, - "end": 527, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 518, - "end": 557, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 529, - "end": 532, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 532, - "end": 546, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 533, - "end": 534, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": 5.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 542, - "end": 545, - "ctxt": 0 - }, - "value": "2", - "raw": "\"2\"" - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 548, - "end": 554, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 548, - "end": 549, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 550, - "end": 554, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution3.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution3.json deleted file mode 100644 index 24490b8677b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution3.json +++ /dev/null @@ -1,664 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 443, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 205, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 171, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 205, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 193, - "end": 203, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 202, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 213, - "end": 221, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 207, - "end": 321, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 270, - "end": 319, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 270, - "end": 276, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 270, - "end": 319, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 279, - "end": 319, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 289, - "end": 313, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 296, - "end": 312, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 301, - "end": 306, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 306, - "end": 312, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 230, - "end": 245, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 230, - "end": 235, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 236, - "end": 245, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 245, - "end": 263, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 246, - "end": 258, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 246, - "end": 258, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 260, - "end": 262, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 323, - "end": 370, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 329, - "end": 369, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 329, - "end": 332, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 335, - "end": 369, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 344, - "end": 357, - "ctxt": 0 - }, - "value": "hello world", - "raw": "\"hello world\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 363, - "end": 364, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 366, - "end": 367, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 378, - "end": 408, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 382, - "end": 407, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 382, - "end": 383, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 386, - "end": 407, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 387, - "end": 395, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 386, - "end": 407, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 397, - "end": 400, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 409, - "end": 443, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 413, - "end": 442, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 413, - "end": 414, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 417, - "end": 442, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 418, - "end": 426, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 417, - "end": 442, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 427, - "end": 433, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 427, - "end": 428, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 429, - "end": 433, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 434, - "end": 439, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 434, - "end": 435, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 436, - "end": 439, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 437, - "end": 438, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution4.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution4.json deleted file mode 100644 index 9a30364648a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution4.json +++ /dev/null @@ -1,1348 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 768, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 200, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 171, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 200, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 193, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 208, - "end": 216, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 202, - "end": 316, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 265, - "end": 314, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 265, - "end": 314, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 274, - "end": 314, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 284, - "end": 308, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 291, - "end": 307, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 291, - "end": 296, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 301, - "end": 307, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 225, - "end": 240, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 231, - "end": 240, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 240, - "end": 258, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 241, - "end": 253, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 241, - "end": 253, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 255, - "end": 257, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 379, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 324, - "end": 378, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 324, - "end": 327, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 327, - "end": 341, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 329, - "end": 341, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 329, - "end": 341, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 344, - "end": 378, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 350, - "end": 351, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 353, - "end": 366, - "ctxt": 0 - }, - "value": "hello world", - "raw": "\"hello world\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 372, - "end": 373, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 375, - "end": 376, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 387, - "end": 417, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 391, - "end": 416, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 391, - "end": 392, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 395, - "end": 416, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 396, - "end": 404, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 395, - "end": 416, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 409, - "end": 412, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 425, - "end": 434, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "declare": false, - "span": { - "start": 419, - "end": 529, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 473, - "end": 527, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 473, - "end": 479, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 473, - "end": 527, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 482, - "end": 527, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 492, - "end": 521, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 499, - "end": 520, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 500, - "end": 503, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 499, - "end": 504, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 504, - "end": 514, - "ctxt": 0 - }, - "value": "Default hi", - "raw": "Default hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 514, - "end": 520, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 516, - "end": 519, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 443, - "end": 458, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 443, - "end": 448, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 449, - "end": 458, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 458, - "end": 466, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 459, - "end": 461, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 463, - "end": 465, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 537, - "end": 548, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 541, - "end": 547, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 541, - "end": 542, - "ctxt": 0 - }, - "value": "j", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 542, - "end": 547, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 544, - "end": 547, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 549, - "end": 580, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 553, - "end": 579, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 553, - "end": 555, - "ctxt": 0 - }, - "value": "e1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 558, - "end": 579, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 559, - "end": 568, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 558, - "end": 579, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 570, - "end": 573, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 573, - "end": 575, - "ctxt": 0 - }, - "properties": [] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 581, - "end": 610, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 585, - "end": 610, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 585, - "end": 587, - "ctxt": 0 - }, - "value": "e2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 590, - "end": 610, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 591, - "end": 600, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 590, - "end": 610, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 602, - "end": 605, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 605, - "end": 606, - "ctxt": 0 - }, - "value": "j", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 611, - "end": 686, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 615, - "end": 686, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 615, - "end": 617, - "ctxt": 0 - }, - "value": "e3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 620, - "end": 686, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 621, - "end": 630, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 620, - "end": 686, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 632, - "end": 635, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 635, - "end": 682, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 637, - "end": 640, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 642, - "end": 680, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 643, - "end": 648, - "ctxt": 0 - }, - "value": "input", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 653, - "end": 680, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 655, - "end": 678, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 655, - "end": 677, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 655, - "end": 669, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 655, - "end": 659, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 660, - "end": 669, - "ctxt": 0 - }, - "value": "textInput", - "optional": false - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 672, - "end": 677, - "ctxt": 0 - }, - "value": "input", - "optional": false - } - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 687, - "end": 719, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 691, - "end": 719, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 691, - "end": 693, - "ctxt": 0 - }, - "value": "e4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 696, - "end": 719, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 697, - "end": 706, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 696, - "end": 719, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 707, - "end": 716, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 707, - "end": 716, - "ctxt": 0 - }, - "value": "data-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 720, - "end": 768, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 724, - "end": 768, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 724, - "end": 726, - "ctxt": 0 - }, - "value": "e5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 729, - "end": 768, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 730, - "end": 739, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 729, - "end": 768, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 741, - "end": 744, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 744, - "end": 764, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 746, - "end": 757, - "ctxt": 0 - }, - "value": "data-prop", - "raw": "\"data-prop\"" - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 759, - "end": 763, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution5.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution5.json deleted file mode 100644 index 71261621d95..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution5.json +++ /dev/null @@ -1,931 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 647, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 200, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 171, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 172, - "end": 200, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 178, - "end": 179, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 179, - "end": 187, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 181, - "end": 187, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 193, - "end": 198, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 193, - "end": 194, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 196, - "end": 197, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 208, - "end": 216, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "declare": false, - "span": { - "start": 202, - "end": 316, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 265, - "end": 314, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 265, - "end": 271, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 265, - "end": 314, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 274, - "end": 314, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 284, - "end": 308, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 291, - "end": 307, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 292, - "end": 295, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 291, - "end": 296, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 296, - "end": 301, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 301, - "end": 307, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 225, - "end": 240, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 225, - "end": 230, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 231, - "end": 240, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 240, - "end": 258, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 241, - "end": 253, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 241, - "end": 253, - "ctxt": 0 - }, - "value": "PoisonedProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 255, - "end": 257, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 363, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 322, - "end": 362, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 322, - "end": 325, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 328, - "end": 362, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 334, - "end": 335, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 337, - "end": 350, - "ctxt": 0 - }, - "value": "hello world", - "raw": "\"hello world\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 356, - "end": 357, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 359, - "end": 360, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 417, - "end": 447, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 421, - "end": 446, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 425, - "end": 446, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 426, - "end": 434, - "ctxt": 0 - }, - "value": "Poisoned", - "optional": false - }, - "span": { - "start": 425, - "end": 446, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 436, - "end": 439, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 439, - "end": 442, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 455, - "end": 464, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "declare": false, - "span": { - "start": 449, - "end": 581, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 503, - "end": 557, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 503, - "end": 509, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 503, - "end": 557, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 512, - "end": 557, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 522, - "end": 551, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 529, - "end": 550, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 530, - "end": 533, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 529, - "end": 534, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 534, - "end": 544, - "ctxt": 0 - }, - "value": "Default hi", - "raw": "Default hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 544, - "end": 550, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 546, - "end": 549, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 562, - "end": 579, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 562, - "end": 570, - "ctxt": 0 - }, - "value": "greeting", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 570, - "end": 578, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 572, - "end": 578, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 473, - "end": 488, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 473, - "end": 478, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 479, - "end": 488, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 488, - "end": 496, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 489, - "end": 491, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 493, - "end": 495, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 583, - "end": 611, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 587, - "end": 611, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 587, - "end": 588, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 591, - "end": 611, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 597, - "end": 602, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 604, - "end": 609, - "ctxt": 0 - }, - "value": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 618, - "end": 647, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 622, - "end": 646, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 622, - "end": 623, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 626, - "end": 646, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 627, - "end": 636, - "ctxt": 0 - }, - "value": "EmptyProp", - "optional": false - }, - "span": { - "start": 626, - "end": 646, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 638, - "end": 641, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 641, - "end": 642, - "ctxt": 0 - }, - "value": "o", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution6.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution6.json deleted file mode 100644 index c8c43b5a729..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution6.json +++ /dev/null @@ -1,679 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 490, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 149, - "end": 257, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 154, - "end": 163, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 166, - "end": 256, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 166, - "end": 185, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 176, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 176, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 203, - "end": 256, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 205, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 205, - "end": 213, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 221, - "end": 254, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 221, - "end": 227, - "ctxt": 0 - }, - "value": "onEdit", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 227, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 229, - "end": 254, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 230, - "end": 245, - "ctxt": 0 - }, - "value": "newText", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 247, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 250, - "end": 254, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 265, - "end": 278, - "ctxt": 0 - }, - "value": "TextComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 259, - "end": 383, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 324, - "end": 381, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 324, - "end": 381, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 333, - "end": 381, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 343, - "end": 375, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 350, - "end": 374, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 351, - "end": 355, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 350, - "end": 356, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 356, - "end": 367, - "ctxt": 0 - }, - "value": "Some Text..", - "raw": "Some Text.." - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 367, - "end": 374, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 369, - "end": 373, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 287, - "end": 302, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 293, - "end": 302, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 302, - "end": 317, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 314, - "end": 316, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 394, - "end": 435, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 398, - "end": 435, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 398, - "end": 399, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 402, - "end": 435, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 403, - "end": 416, - "ctxt": 0 - }, - "value": "TextComponent", - "optional": false - }, - "span": { - "start": 402, - "end": 435, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 417, - "end": 432, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 425, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 426, - "end": 432, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 427, - "end": 431, - "ctxt": 0 - }, - "value": true - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 437, - "end": 490, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 443, - "end": 489, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 443, - "end": 452, - "ctxt": 0 - }, - "value": "textProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 452, - "end": 463, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 454, - "end": 463, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 454, - "end": 463, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 466, - "end": 489, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 472, - "end": 480, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 482, - "end": 487, - "ctxt": 0 - }, - "value": false - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution7.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution7.json deleted file mode 100644 index c9babea7006..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution7.json +++ /dev/null @@ -1,869 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 624, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 149, - "end": 257, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 154, - "end": 163, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 166, - "end": 256, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 166, - "end": 185, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 183, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 176, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 176, - "end": 183, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 178, - "end": 183, - "ctxt": 0 - }, - "value": false - } - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 203, - "end": 256, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 205, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 205, - "end": 213, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - }, - "literal": { - "type": "BooleanLiteral", - "span": { - "start": 215, - "end": 219, - "ctxt": 0 - }, - "value": true - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 221, - "end": 254, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 221, - "end": 227, - "ctxt": 0 - }, - "value": "onEdit", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 227, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 229, - "end": 254, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 230, - "end": 245, - "ctxt": 0 - }, - "value": "newText", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 247, - "end": 254, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 250, - "end": 254, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 265, - "end": 278, - "ctxt": 0 - }, - "value": "TextComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 259, - "end": 383, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 324, - "end": 381, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 324, - "end": 381, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 333, - "end": 381, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 343, - "end": 375, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 350, - "end": 374, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 351, - "end": 355, - "ctxt": 0 - }, - "value": "span", - "optional": false - }, - "span": { - "start": 350, - "end": 356, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 356, - "end": 367, - "ctxt": 0 - }, - "value": "Some Text..", - "raw": "Some Text.." - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 367, - "end": 374, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 369, - "end": 373, - "ctxt": 0 - }, - "value": "span", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 287, - "end": 302, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 287, - "end": 292, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 293, - "end": 302, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 302, - "end": 317, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 312, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 314, - "end": 316, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 391, - "end": 449, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 397, - "end": 448, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 397, - "end": 411, - "ctxt": 0 - }, - "value": "textPropsFalse", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 411, - "end": 422, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 413, - "end": 422, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 413, - "end": 422, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 425, - "end": 448, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 431, - "end": 439, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 441, - "end": 446, - "ctxt": 0 - }, - "value": false - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 451, - "end": 497, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 455, - "end": 497, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 455, - "end": 457, - "ctxt": 0 - }, - "value": "y1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 460, - "end": 497, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 461, - "end": 474, - "ctxt": 0 - }, - "value": "TextComponent", - "optional": false - }, - "span": { - "start": 460, - "end": 497, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 479, - "end": 493, - "ctxt": 0 - }, - "value": "textPropsFalse", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 499, - "end": 577, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 505, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 505, - "end": 518, - "ctxt": 0 - }, - "value": "textPropsTrue", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 518, - "end": 529, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 520, - "end": 529, - "ctxt": 0 - }, - "value": "TextProps", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 532, - "end": 576, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 538, - "end": 546, - "ctxt": 0 - }, - "value": "editable", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 548, - "end": 552, - "ctxt": 0 - }, - "value": true - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 558, - "end": 564, - "ctxt": 0 - }, - "value": "onEdit", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 566, - "end": 574, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 572, - "end": 574, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 579, - "end": 624, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 583, - "end": 624, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 583, - "end": 585, - "ctxt": 0 - }, - "value": "y2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 588, - "end": 624, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 589, - "end": 602, - "ctxt": 0 - }, - "value": "TextComponent", - "optional": false - }, - "span": { - "start": 588, - "end": 624, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 604, - "end": 607, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 607, - "end": 620, - "ctxt": 0 - }, - "value": "textPropsTrue", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution8.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution8.json deleted file mode 100644 index 7331bdeee7c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution8.json +++ /dev/null @@ -1,848 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 541, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 149, - "end": 164, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 155, - "end": 163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 155, - "end": 158, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 161, - "end": 163, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 190, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 171, - "end": 190, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 171, - "end": 175, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 178, - "end": 190, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 184, - "end": 185, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 187, - "end": 188, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 191, - "end": 240, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 197, - "end": 240, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 197, - "end": 201, - "ctxt": 0 - }, - "value": "obj3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 204, - "end": 240, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 213, - "end": 217, - "ctxt": 0 - }, - "value": true - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 223, - "end": 232, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 234, - "end": 238, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 242, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 257, - "end": 311, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 263, - "end": 272, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 272, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 266, - "end": 272, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 277, - "end": 287, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 277, - "end": 278, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 278, - "end": 287, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 280, - "end": 287, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 292, - "end": 309, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 301, - "end": 309, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 303, - "end": 309, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 319, - "end": 332, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "declare": false, - "span": { - "start": 313, - "end": 424, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 373, - "end": 422, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 373, - "end": 379, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 373, - "end": 422, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 382, - "end": 422, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 392, - "end": 416, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 399, - "end": 415, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 400, - "end": 403, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 399, - "end": 404, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 404, - "end": 409, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 409, - "end": 415, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 341, - "end": 356, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 341, - "end": 346, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 347, - "end": 356, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 356, - "end": 366, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 357, - "end": 361, - "ctxt": 0 - }, - "value": "Prop", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 363, - "end": 365, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 432, - "end": 493, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 436, - "end": 493, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 436, - "end": 437, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 440, - "end": 493, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 441, - "end": 454, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 440, - "end": 493, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 456, - "end": 459, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 459, - "end": 462, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 466, - "end": 480, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 466, - "end": 475, - "ctxt": 0 - }, - "value": "overwrite", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 476, - "end": 480, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 485, - "end": 489, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 494, - "end": 541, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 498, - "end": 541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 498, - "end": 500, - "ctxt": 0 - }, - "value": "x1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 503, - "end": 541, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 504, - "end": 517, - "ctxt": 0 - }, - "value": "OverWriteAttr", - "optional": false - }, - "span": { - "start": 503, - "end": 541, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 519, - "end": 522, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 522, - "end": 526, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 529, - "end": 532, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 532, - "end": 536, - "ctxt": 0 - }, - "value": "obj3", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution9.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution9.json deleted file mode 100644 index d579724edca..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution9.json +++ /dev/null @@ -1,960 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 506, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 149, - "end": 199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 159, - "end": 169, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 170, - "end": 199, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 176, - "end": 181, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "literal": { - "type": "NumericLiteral", - "span": { - "start": 180, - "end": 181, - "ctxt": 0 - }, - "value": 2.0 - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 186, - "end": 197, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 186, - "end": 187, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 188, - "end": 197, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 190, - "end": 197, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 207, - "end": 210, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "declare": false, - "span": { - "start": 201, - "end": 308, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 257, - "end": 306, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 257, - "end": 263, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 257, - "end": 306, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 266, - "end": 306, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 276, - "end": 300, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 283, - "end": 299, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 283, - "end": 288, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 288, - "end": 293, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 293, - "end": 299, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 295, - "end": 298, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 219, - "end": 234, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 219, - "end": 224, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 234, - "end": 250, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 235, - "end": 245, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 235, - "end": 245, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 247, - "end": 249, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 310, - "end": 337, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 316, - "end": 336, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 319, - "end": 331, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 321, - "end": 331, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 321, - "end": 331, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 334, - "end": 336, - "ctxt": 0 - }, - "properties": [] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 338, - "end": 375, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 344, - "end": 375, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 344, - "end": 348, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 348, - "end": 360, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 350, - "end": 360, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 350, - "end": 360, - "ctxt": 0 - }, - "value": "OptionProp", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 363, - "end": 375, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 369, - "end": 370, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 372, - "end": 373, - "ctxt": 0 - }, - "value": 2.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 383, - "end": 399, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 387, - "end": 398, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 387, - "end": 388, - "ctxt": 0 - }, - "value": "p", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 391, - "end": 398, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 392, - "end": 395, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 391, - "end": 398, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 400, - "end": 425, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 404, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 404, - "end": 405, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 408, - "end": 424, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 409, - "end": 412, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 408, - "end": 424, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 414, - "end": 417, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 417, - "end": 420, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 426, - "end": 453, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 430, - "end": 452, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 430, - "end": 432, - "ctxt": 0 - }, - "value": "y1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 435, - "end": 452, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 436, - "end": 439, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 435, - "end": 452, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 441, - "end": 444, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 444, - "end": 448, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 454, - "end": 482, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 458, - "end": 481, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 458, - "end": 460, - "ctxt": 0 - }, - "value": "y2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 463, - "end": 481, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 464, - "end": 467, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 463, - "end": 481, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 469, - "end": 472, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 472, - "end": 476, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 483, - "end": 506, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 487, - "end": 505, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 487, - "end": 489, - "ctxt": 0 - }, - "value": "y3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 492, - "end": 505, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 493, - "end": 496, - "ctxt": 0 - }, - "value": "Opt", - "optional": false - }, - "span": { - "start": 492, - "end": 505, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 497, - "end": 502, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 499, - "end": 502, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 500, - "end": 501, - "ctxt": 0 - }, - "value": 2.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildren.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildren.json deleted file mode 100644 index 46d6f00602f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildren.json +++ /dev/null @@ -1,1234 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 18, - "end": 555, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 18, - "end": 117, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 33, - "end": 36, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 37, - "end": 117, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 40, - "end": 61, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 50, - "end": 57, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 58, - "end": 61, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 63, - "end": 115, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 73, - "end": 90, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 91, - "end": 115, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 96, - "end": 105, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 97, - "end": 105, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 99, - "end": 105, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 106, - "end": 111, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 108, - "end": 111, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 95, - "end": 112, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 118, - "end": 141, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 130, - "end": 140, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 130, - "end": 135, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 135, - "end": 140, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 137, - "end": 140, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 143, - "end": 199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 153, - "end": 161, - "ctxt": 0 - }, - "value": "TodoProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 162, - "end": 199, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 179, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 170, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 170, - "end": 178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 172, - "end": 178, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 184, - "end": 197, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 184, - "end": 188, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 188, - "end": 196, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 190, - "end": 196, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 200, - "end": 250, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 210, - "end": 223, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 224, - "end": 250, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 230, - "end": 248, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 230, - "end": 235, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 247, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 237, - "end": 247, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "value": "TodoProp", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "Todo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 265, - "end": 300, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 265, - "end": 300, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 269, - "end": 300, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 271, - "end": 300, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 273, - "end": 285, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 273, - "end": 276, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 276, - "end": 284, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 278, - "end": 284, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 286, - "end": 298, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 286, - "end": 290, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 290, - "end": 298, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 292, - "end": 298, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 251, - "end": 362, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 302, - "end": 362, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 308, - "end": 360, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 315, - "end": 359, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 319, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 320, - "end": 353, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 321, - "end": 352, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "CallExpression", - "span": { - "start": 321, - "end": 340, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 321, - "end": 338, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 321, - "end": 329, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 321, - "end": 325, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 326, - "end": 329, - "ctxt": 0 - }, - "value": "key", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 330, - "end": 338, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 343, - "end": 352, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 343, - "end": 347, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 348, - "end": 352, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 353, - "end": 359, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 355, - "end": 358, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 372, - "end": 380, - "ctxt": 0 - }, - "value": "TodoList", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 381, - "end": 405, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 381, - "end": 405, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 383, - "end": 388, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 383, - "end": 388, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 390, - "end": 405, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 392, - "end": 405, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 392, - "end": 405, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 363, - "end": 510, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 407, - "end": 510, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 413, - "end": 508, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 420, - "end": 507, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 420, - "end": 425, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 425, - "end": 434, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 434, - "end": 496, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 438, - "end": 495, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 438, - "end": 447, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 438, - "end": 443, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 444, - "end": 447, - "ctxt": 0 - }, - "value": "map", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 448, - "end": 494, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 448, - "end": 452, - "ctxt": 0 - }, - "value": "todo", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 456, - "end": 494, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 457, - "end": 461, - "ctxt": 0 - }, - "value": "Todo", - "optional": false - }, - "span": { - "start": 456, - "end": 494, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 462, - "end": 475, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 462, - "end": 465, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 466, - "end": 475, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 467, - "end": 474, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 467, - "end": 471, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 472, - "end": 474, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 476, - "end": 492, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 476, - "end": 480, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 481, - "end": 492, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 482, - "end": 491, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 482, - "end": 486, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 487, - "end": 491, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ], - "typeArguments": null - } - }, - { - "type": "JSXText", - "span": { - "start": 496, - "end": 501, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 501, - "end": 507, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 503, - "end": 506, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 511, - "end": 532, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 515, - "end": 531, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 515, - "end": 516, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 516, - "end": 531, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 518, - "end": 531, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 518, - "end": 531, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 537, - "end": 555, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 537, - "end": 555, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 538, - "end": 546, - "ctxt": 0 - }, - "value": "TodoList", - "optional": false - }, - "span": { - "start": 537, - "end": 555, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 548, - "end": 551, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 551, - "end": 552, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildrenInvalidType.json b/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildrenInvalidType.json deleted file mode 100644 index 06ce4e867a3..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxSpreadChildrenInvalidType.json +++ /dev/null @@ -1,1619 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 48, - "end": 755, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 48, - "end": 147, - "ctxt": 0 - }, - "declare": true, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 63, - "end": 66, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 67, - "end": 147, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 70, - "end": 91, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 80, - "end": 87, - "ctxt": 0 - }, - "value": "Element", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 88, - "end": 91, - "ctxt": 0 - }, - "body": [] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 93, - "end": 145, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 103, - "end": 120, - "ctxt": 0 - }, - "value": "IntrinsicElements", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 121, - "end": 145, - "ctxt": 0 - }, - "body": [ - { - "type": "TsIndexSignature", - "params": [ - { - "type": "Identifier", - "span": { - "start": 126, - "end": 135, - "ctxt": 0 - }, - "value": "s", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 127, - "end": 135, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 129, - "end": 135, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 136, - "end": 141, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "kind": "any" - } - }, - "readonly": false, - "static": false, - "span": { - "start": 125, - "end": 142, - "ctxt": 0 - } - } - ] - } - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 148, - "end": 171, - "ctxt": 0 - }, - "kind": "var", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 160, - "end": 170, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 160, - "end": 165, - "ctxt": 0 - }, - "value": "React", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 170, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 167, - "end": 170, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 173, - "end": 229, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 183, - "end": 191, - "ctxt": 0 - }, - "value": "TodoProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 192, - "end": 229, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 198, - "end": 209, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 200, - "end": 208, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 202, - "end": 208, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 214, - "end": 227, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 214, - "end": 218, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 218, - "end": 226, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 220, - "end": 226, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 230, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 240, - "end": 253, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 254, - "end": 280, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 260, - "end": 278, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 260, - "end": 265, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 277, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 267, - "end": 277, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 267, - "end": 275, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 267, - "end": 275, - "ctxt": 0 - }, - "value": "TodoProp", - "optional": false - }, - "typeParams": null - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 290, - "end": 294, - "ctxt": 0 - }, - "value": "Todo", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 295, - "end": 330, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 295, - "end": 330, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 299, - "end": 330, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 301, - "end": 330, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 303, - "end": 315, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 303, - "end": 306, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 306, - "end": 314, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 308, - "end": 314, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 316, - "end": 328, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 316, - "end": 320, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 320, - "end": 328, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 322, - "end": 328, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 281, - "end": 392, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 332, - "end": 392, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 338, - "end": 390, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 345, - "end": 389, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 345, - "end": 350, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXExpressionContainer", - "span": { - "start": 350, - "end": 383, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 351, - "end": 382, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "CallExpression", - "span": { - "start": 351, - "end": 370, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 351, - "end": 368, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 351, - "end": 359, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 351, - "end": 355, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "value": "key", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 360, - "end": 368, - "ctxt": 0 - }, - "value": "toString", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 373, - "end": 382, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 373, - "end": 377, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 378, - "end": 382, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 383, - "end": 389, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 385, - "end": 388, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 402, - "end": 410, - "ctxt": 0 - }, - "value": "TodoList", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 411, - "end": 435, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 411, - "end": 435, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 413, - "end": 418, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 413, - "end": 418, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 420, - "end": 435, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 422, - "end": 435, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 422, - "end": 435, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 393, - "end": 530, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 437, - "end": 530, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 443, - "end": 528, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 450, - "end": 527, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 451, - "end": 454, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 450, - "end": 455, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 455, - "end": 464, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 464, - "end": 516, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 468, - "end": 515, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 469, - "end": 473, - "ctxt": 0 - }, - "value": "Todo", - "optional": false - }, - "span": { - "start": 468, - "end": 515, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 474, - "end": 491, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 474, - "end": 477, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 478, - "end": 491, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 479, - "end": 490, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 479, - "end": 487, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 479, - "end": 484, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 484, - "end": 487, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 485, - "end": 486, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 488, - "end": 490, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 492, - "end": 512, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 492, - "end": 496, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 497, - "end": 512, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 498, - "end": 511, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 498, - "end": 506, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 498, - "end": 503, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 503, - "end": 506, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 504, - "end": 505, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 507, - "end": 511, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "JSXText", - "span": { - "start": 516, - "end": 521, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 521, - "end": 527, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 523, - "end": 526, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 540, - "end": 555, - "ctxt": 0 - }, - "value": "TodoListNoError", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 556, - "end": 580, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 556, - "end": 580, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 558, - "end": 563, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 558, - "end": 563, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 565, - "end": 580, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 567, - "end": 580, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 567, - "end": 580, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 531, - "end": 710, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 582, - "end": 710, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 614, - "end": 708, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 621, - "end": 707, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 622, - "end": 625, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 621, - "end": 626, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 626, - "end": 635, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXSpreadChild", - "span": { - "start": 635, - "end": 696, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 639, - "end": 695, - "ctxt": 0 - }, - "expression": { - "type": "TsAsExpression", - "span": { - "start": 640, - "end": 694, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 640, - "end": 687, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 641, - "end": 645, - "ctxt": 0 - }, - "value": "Todo", - "optional": false - }, - "span": { - "start": 640, - "end": 687, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 646, - "end": 663, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 646, - "end": 649, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 650, - "end": 663, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 651, - "end": 662, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 651, - "end": 659, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 651, - "end": 656, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 656, - "end": 659, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 657, - "end": 658, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 660, - "end": 662, - "ctxt": 0 - }, - "value": "id", - "optional": false - } - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 664, - "end": 684, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 664, - "end": 668, - "ctxt": 0 - }, - "value": "todo", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 669, - "end": 684, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 670, - "end": 683, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 670, - "end": 678, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 670, - "end": 675, - "ctxt": 0 - }, - "value": "todos", - "optional": false - }, - "property": { - "type": "Computed", - "span": { - "start": 675, - "end": 678, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 676, - "end": 677, - "ctxt": 0 - }, - "value": 0.0 - } - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 679, - "end": 683, - "ctxt": 0 - }, - "value": "todo", - "optional": false - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 691, - "end": 694, - "ctxt": 0 - }, - "kind": "any" - } - } - } - }, - { - "type": "JSXText", - "span": { - "start": 696, - "end": 701, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 701, - "end": 707, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 703, - "end": 706, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 711, - "end": 732, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 715, - "end": 731, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 715, - "end": 716, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 716, - "end": 731, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 718, - "end": 731, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 718, - "end": 731, - "ctxt": 0 - }, - "value": "TodoListProps", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 737, - "end": 755, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 737, - "end": 755, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 738, - "end": 746, - "ctxt": 0 - }, - "value": "TodoList", - "optional": false - }, - "span": { - "start": 737, - "end": 755, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 748, - "end": 751, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 751, - "end": 752, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload1.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload1.json deleted file mode 100644 index 7363a6d1e19..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload1.json +++ /dev/null @@ -1,3879 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 1815, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 189, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 190, - "end": 206, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 190, - "end": 206, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 191, - "end": 206, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 193, - "end": 206, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 194, - "end": 205, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "value": "yxx", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 197, - "end": 205, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 199, - "end": 205, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 164, - "end": 221, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 207, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 209, - "end": 220, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 213, - "end": 220, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 239, - "end": 247, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 248, - "end": 283, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 248, - "end": 283, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 249, - "end": 283, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 251, - "end": 283, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 252, - "end": 265, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - }, - "value": "yxx1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 256, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 258, - "end": 264, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 266, - "end": 282, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 266, - "end": 274, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 274, - "end": 282, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 276, - "end": 282, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 222, - "end": 298, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 284, - "end": 297, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 286, - "end": 297, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 286, - "end": 289, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 290, - "end": 297, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 316, - "end": 324, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 325, - "end": 353, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 325, - "end": 353, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 326, - "end": 353, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 328, - "end": 353, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 329, - "end": 340, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 329, - "end": 331, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 331, - "end": 339, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 333, - "end": 339, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 341, - "end": 352, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 341, - "end": 344, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 344, - "end": 352, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 346, - "end": 352, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 299, - "end": 368, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 354, - "end": 367, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 356, - "end": 367, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 360, - "end": 367, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 386, - "end": 394, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 395, - "end": 437, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 395, - "end": 437, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 396, - "end": 437, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 398, - "end": 437, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 399, - "end": 410, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 399, - "end": 401, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 401, - "end": 409, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 403, - "end": 409, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 411, - "end": 423, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 414, - "end": 422, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 416, - "end": 422, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 424, - "end": 436, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 424, - "end": 427, - "ctxt": 0 - }, - "value": "yy2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 427, - "end": 436, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 429, - "end": 436, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 369, - "end": 452, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 438, - "end": 451, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 440, - "end": 451, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 440, - "end": 443, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 444, - "end": 451, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 470, - "end": 478, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 479, - "end": 519, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 479, - "end": 519, - "ctxt": 0 - }, - "value": "l1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 481, - "end": 519, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 483, - "end": 519, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 484, - "end": 497, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 484, - "end": 488, - "ctxt": 0 - }, - "value": "data", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 488, - "end": 496, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 490, - "end": 496, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 498, - "end": 518, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 498, - "end": 509, - "ctxt": 0 - }, - "value": "data-prop", - "raw": "\"data-prop\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 509, - "end": 518, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 511, - "end": 518, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 453, - "end": 534, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 520, - "end": 533, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 522, - "end": 533, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 522, - "end": 525, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 526, - "end": 533, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 542, - "end": 574, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 548, - "end": 574, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 548, - "end": 550, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 553, - "end": 574, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 554, - "end": 562, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 553, - "end": 574, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 563, - "end": 571, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 563, - "end": 566, - "ctxt": 0 - }, - "value": "yxx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 567, - "end": 571, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 575, - "end": 619, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 581, - "end": 619, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 581, - "end": 583, - "ctxt": 0 - }, - "value": "c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 586, - "end": 619, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 587, - "end": 595, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 586, - "end": 619, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 596, - "end": 604, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 596, - "end": 598, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 599, - "end": 604, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 600, - "end": 603, - "ctxt": 0 - }, - "value": 100.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 606, - "end": 617, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 606, - "end": 609, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 610, - "end": 617, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 620, - "end": 667, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 626, - "end": 667, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 626, - "end": 628, - "ctxt": 0 - }, - "value": "c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 631, - "end": 667, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 632, - "end": 640, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 631, - "end": 667, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 641, - "end": 652, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 641, - "end": 644, - "ctxt": 0 - }, - "value": "yxx", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 645, - "end": 652, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 653, - "end": 664, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 653, - "end": 664, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 668, - "end": 714, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 674, - "end": 714, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 674, - "end": 676, - "ctxt": 0 - }, - "value": "c4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 679, - "end": 714, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 680, - "end": 688, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 679, - "end": 714, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 689, - "end": 701, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 689, - "end": 693, - "ctxt": 0 - }, - "value": "data", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 694, - "end": 701, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 702, - "end": 711, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 702, - "end": 711, - "ctxt": 0 - }, - "value": "data-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 715, - "end": 762, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 721, - "end": 762, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 721, - "end": 723, - "ctxt": 0 - }, - "value": "c5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 726, - "end": 762, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 727, - "end": 735, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 726, - "end": 746, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 736, - "end": 745, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 736, - "end": 740, - "ctxt": 0 - }, - "value": "yxx1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 741, - "end": 745, - "ctxt": 0 - }, - "value": "ok", - "raw": "'ok'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 746, - "end": 751, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 751, - "end": 762, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 753, - "end": 761, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 782, - "end": 797, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 798, - "end": 810, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "ObjectPattern", - "span": { - "start": 798, - "end": 810, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValuePatternProperty", - "key": { - "type": "Identifier", - "span": { - "start": 799, - "end": 801, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "Identifier", - "span": { - "start": 803, - "end": 809, - "ctxt": 0 - }, - "value": "string", - "optional": false, - "typeAnnotation": null - } - } - ], - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 765, - "end": 825, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 811, - "end": 824, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 813, - "end": 824, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 813, - "end": 816, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 817, - "end": 824, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 843, - "end": 858, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 859, - "end": 897, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 859, - "end": 897, - "ctxt": 0 - }, - "value": "j", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 860, - "end": 897, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 862, - "end": 897, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 863, - "end": 884, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 863, - "end": 875, - "ctxt": 0 - }, - "value": "extra-data", - "raw": "\"extra-data\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 875, - "end": 883, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 877, - "end": 883, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 885, - "end": 896, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 885, - "end": 887, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 888, - "end": 896, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 890, - "end": 896, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 826, - "end": 912, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 898, - "end": 911, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 900, - "end": 911, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 900, - "end": 903, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 904, - "end": 911, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 930, - "end": 945, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 946, - "end": 981, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 946, - "end": 981, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 947, - "end": 981, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 949, - "end": 981, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 950, - "end": 961, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 950, - "end": 952, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 952, - "end": 960, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 954, - "end": 960, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 962, - "end": 980, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 962, - "end": 971, - "ctxt": 0 - }, - "value": "direction", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 972, - "end": 980, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 974, - "end": 980, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 913, - "end": 996, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 982, - "end": 995, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 984, - "end": 995, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 984, - "end": 987, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 988, - "end": 995, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1014, - "end": 1029, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1030, - "end": 1059, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1030, - "end": 1059, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1031, - "end": 1059, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1033, - "end": 1059, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1034, - "end": 1045, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1034, - "end": 1036, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1036, - "end": 1044, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1038, - "end": 1044, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1046, - "end": 1058, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1046, - "end": 1050, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1050, - "end": 1058, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1052, - "end": 1058, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 997, - "end": 1074, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1060, - "end": 1073, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1062, - "end": 1073, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1062, - "end": 1065, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1066, - "end": 1073, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1082, - "end": 1127, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1088, - "end": 1126, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1088, - "end": 1090, - "ctxt": 0 - }, - "value": "d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1093, - "end": 1126, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1094, - "end": 1109, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1093, - "end": 1126, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1110, - "end": 1112, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1110, - "end": 1112, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1113, - "end": 1123, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1113, - "end": 1123, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1128, - "end": 1178, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1134, - "end": 1177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1134, - "end": 1136, - "ctxt": 0 - }, - "value": "d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1139, - "end": 1177, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1140, - "end": 1155, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1139, - "end": 1177, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1156, - "end": 1174, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1156, - "end": 1166, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1167, - "end": 1174, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1179, - "end": 1239, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1185, - "end": 1238, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1185, - "end": 1187, - "ctxt": 0 - }, - "value": "d3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1190, - "end": 1238, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1191, - "end": 1206, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1190, - "end": 1238, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1207, - "end": 1225, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1207, - "end": 1217, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1218, - "end": 1225, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1226, - "end": 1235, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1228, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1229, - "end": 1235, - "ctxt": 0 - }, - "value": "hihi", - "raw": "\"hihi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1240, - "end": 1312, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1246, - "end": 1311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1246, - "end": 1248, - "ctxt": 0 - }, - "value": "d4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1251, - "end": 1311, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1252, - "end": 1267, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1251, - "end": 1311, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1268, - "end": 1286, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1268, - "end": 1278, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1279, - "end": 1286, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1287, - "end": 1293, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1287, - "end": 1289, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1290, - "end": 1293, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1291, - "end": 1292, - "ctxt": 0 - }, - "value": 9.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1294, - "end": 1308, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1294, - "end": 1303, - "ctxt": 0 - }, - "value": "direction", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1304, - "end": 1308, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1305, - "end": 1307, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1313, - "end": 1385, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1319, - "end": 1384, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1319, - "end": 1321, - "ctxt": 0 - }, - "value": "d5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1324, - "end": 1384, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1325, - "end": 1340, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1324, - "end": 1384, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1341, - "end": 1359, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1341, - "end": 1351, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1352, - "end": 1359, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1360, - "end": 1370, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1360, - "end": 1362, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1363, - "end": 1370, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1371, - "end": 1381, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1371, - "end": 1375, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1376, - "end": 1381, - "ctxt": 0 - }, - "value": "Bob", - "raw": "\"Bob\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1405, - "end": 1420, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1421, - "end": 1450, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1421, - "end": 1450, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1422, - "end": 1450, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1424, - "end": 1450, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1425, - "end": 1437, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1425, - "end": 1427, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1428, - "end": 1436, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1430, - "end": 1436, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1438, - "end": 1449, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1438, - "end": 1440, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1441, - "end": 1449, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1443, - "end": 1449, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1388, - "end": 1465, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1451, - "end": 1464, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1453, - "end": 1464, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1453, - "end": 1456, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1457, - "end": 1464, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1483, - "end": 1498, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1499, - "end": 1541, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1499, - "end": 1541, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1500, - "end": 1541, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1502, - "end": 1541, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1503, - "end": 1515, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1503, - "end": 1505, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1505, - "end": 1514, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1507, - "end": 1514, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1516, - "end": 1528, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1516, - "end": 1518, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1519, - "end": 1527, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1521, - "end": 1527, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1529, - "end": 1540, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1529, - "end": 1531, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1531, - "end": 1540, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1533, - "end": 1540, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1466, - "end": 1556, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1542, - "end": 1555, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1544, - "end": 1555, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1544, - "end": 1547, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1548, - "end": 1555, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1564, - "end": 1594, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1570, - "end": 1594, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1570, - "end": 1572, - "ctxt": 0 - }, - "value": "e1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1575, - "end": 1594, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1576, - "end": 1591, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1575, - "end": 1594, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1595, - "end": 1635, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1601, - "end": 1635, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1601, - "end": 1603, - "ctxt": 0 - }, - "value": "e3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1606, - "end": 1635, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1607, - "end": 1622, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1606, - "end": 1635, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1623, - "end": 1633, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1623, - "end": 1625, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1626, - "end": 1633, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1636, - "end": 1687, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1642, - "end": 1687, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1642, - "end": 1644, - "ctxt": 0 - }, - "value": "e4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1647, - "end": 1687, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1648, - "end": 1663, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1647, - "end": 1687, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1664, - "end": 1674, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1664, - "end": 1666, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1667, - "end": 1674, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1675, - "end": 1684, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1675, - "end": 1677, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1678, - "end": 1684, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1679, - "end": 1683, - "ctxt": 0 - }, - "value": 1000.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1688, - "end": 1723, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1694, - "end": 1723, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1694, - "end": 1696, - "ctxt": 0 - }, - "value": "e5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1699, - "end": 1723, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1700, - "end": 1715, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1699, - "end": 1723, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1716, - "end": 1718, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1716, - "end": 1718, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1719, - "end": 1721, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1719, - "end": 1721, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1724, - "end": 1768, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1730, - "end": 1768, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1730, - "end": 1732, - "ctxt": 0 - }, - "value": "e6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1735, - "end": 1768, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1736, - "end": 1751, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1735, - "end": 1768, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1752, - "end": 1754, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1752, - "end": 1754, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1755, - "end": 1757, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1755, - "end": 1757, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1758, - "end": 1765, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1758, - "end": 1760, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1761, - "end": 1765, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1762, - "end": 1764, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1769, - "end": 1815, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1775, - "end": 1815, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1775, - "end": 1777, - "ctxt": 0 - }, - "value": "e2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1780, - "end": 1815, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1781, - "end": 1796, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1780, - "end": 1815, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1797, - "end": 1799, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1797, - "end": 1799, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1800, - "end": 1802, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1800, - "end": 1802, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1803, - "end": 1813, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1803, - "end": 1813, - "ctxt": 0 - }, - "value": "extra-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload2.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload2.json deleted file mode 100644 index 45df083508e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload2.json +++ /dev/null @@ -1,1648 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 920, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 180, - "end": 188, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 163, - "end": 204, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 190, - "end": 203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 192, - "end": 203, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 196, - "end": 203, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 222, - "end": 230, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 231, - "end": 259, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 231, - "end": 259, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 259, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 234, - "end": 259, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 235, - "end": 246, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 247, - "end": 258, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 250, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 252, - "end": 258, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 205, - "end": 274, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 260, - "end": 273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 262, - "end": 273, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 266, - "end": 273, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 276, - "end": 318, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 280, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 286, - "end": 318, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 292, - "end": 294, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 296, - "end": 298, - "ctxt": 0 - }, - "value": 10.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 309, - "end": 316, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 320, - "end": 347, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 324, - "end": 347, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 324, - "end": 328, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 331, - "end": 347, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 337, - "end": 339, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 341, - "end": 345, - "ctxt": 0 - }, - "value": true - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 349, - "end": 403, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 353, - "end": 403, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 353, - "end": 357, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 360, - "end": 403, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 366, - "end": 368, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 370, - "end": 373, - "ctxt": 0 - }, - "value": 500.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 379, - "end": 392, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 394, - "end": 401, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 405, - "end": 425, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 409, - "end": 424, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 409, - "end": 419, - "ctxt": 0 - }, - "value": "defaultObj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 419, - "end": 424, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 421, - "end": 424, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 433, - "end": 456, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 439, - "end": 456, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 439, - "end": 441, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 444, - "end": 456, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 445, - "end": 453, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 444, - "end": 456, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 457, - "end": 488, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 463, - "end": 488, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 463, - "end": 465, - "ctxt": 0 - }, - "value": "c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 468, - "end": 488, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 469, - "end": 477, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 468, - "end": 488, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 479, - "end": 482, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 482, - "end": 485, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 489, - "end": 520, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 495, - "end": 520, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 495, - "end": 497, - "ctxt": 0 - }, - "value": "c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 500, - "end": 520, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 501, - "end": 509, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 500, - "end": 520, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 511, - "end": 514, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 514, - "end": 516, - "ctxt": 0 - }, - "properties": [] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 521, - "end": 563, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 527, - "end": 563, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 527, - "end": 529, - "ctxt": 0 - }, - "value": "c4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 532, - "end": 563, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 533, - "end": 541, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 532, - "end": 563, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 543, - "end": 546, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 546, - "end": 550, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 553, - "end": 556, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 556, - "end": 559, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 564, - "end": 621, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 570, - "end": 621, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 570, - "end": 572, - "ctxt": 0 - }, - "value": "c5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 575, - "end": 621, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 576, - "end": 584, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 575, - "end": 621, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 586, - "end": 589, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 589, - "end": 593, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 595, - "end": 602, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 595, - "end": 597, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 598, - "end": 602, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 599, - "end": 601, - "ctxt": 0 - }, - "value": 42.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 604, - "end": 607, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 607, - "end": 618, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 608, - "end": 611, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 613, - "end": 617, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 622, - "end": 685, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 628, - "end": 685, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 628, - "end": 630, - "ctxt": 0 - }, - "value": "c6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 633, - "end": 685, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 634, - "end": 642, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 633, - "end": 685, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 644, - "end": 647, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 647, - "end": 651, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 654, - "end": 657, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 657, - "end": 681, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 658, - "end": 660, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 662, - "end": 667, - "ctxt": 0 - }, - "value": 10000.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 669, - "end": 672, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 674, - "end": 680, - "ctxt": 0 - }, - "value": "true", - "raw": "\"true\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 686, - "end": 738, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 692, - "end": 737, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 692, - "end": 694, - "ctxt": 0 - }, - "value": "c7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 697, - "end": 737, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 698, - "end": 706, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 697, - "end": 737, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 708, - "end": 711, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 711, - "end": 721, - "ctxt": 0 - }, - "value": "defaultObj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 723, - "end": 725, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 723, - "end": 725, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": null - }, - { - "type": "SpreadElement", - "spread": { - "start": 727, - "end": 730, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 730, - "end": 733, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 781, - "end": 822, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 787, - "end": 822, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 787, - "end": 789, - "ctxt": 0 - }, - "value": "c8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 792, - "end": 822, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 793, - "end": 801, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 792, - "end": 822, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 802, - "end": 819, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 802, - "end": 813, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 814, - "end": 819, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 815, - "end": 818, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 823, - "end": 874, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 829, - "end": 873, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 829, - "end": 831, - "ctxt": 0 - }, - "value": "c9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 834, - "end": 873, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 835, - "end": 843, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 834, - "end": 873, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 845, - "end": 848, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 848, - "end": 869, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "StringLiteral", - "span": { - "start": 850, - "end": 863, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 864, - "end": 867, - "ctxt": 0 - }, - "value": 200.0 - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 875, - "end": 920, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 881, - "end": 919, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 881, - "end": 884, - "ctxt": 0 - }, - "value": "c10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 887, - "end": 919, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 888, - "end": 896, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 887, - "end": 919, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 898, - "end": 901, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 901, - "end": 905, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 907, - "end": 916, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 907, - "end": 910, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 911, - "end": 916, - "ctxt": 0 - }, - "value": "boo", - "raw": "\"boo\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload3.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload3.json deleted file mode 100644 index a48cf3c5861..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload3.json +++ /dev/null @@ -1,1825 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 131, - "end": 1132, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 131, - "end": 168, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 141, - "end": 148, - "ctxt": 0 - }, - "value": "Context", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 149, - "end": 168, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 155, - "end": 166, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 155, - "end": 160, - "ctxt": 0 - }, - "value": "color", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 160, - "end": 165, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 162, - "end": 165, - "ctxt": 0 - }, - "kind": "any" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 186, - "end": 205, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 169, - "end": 221, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 207, - "end": 220, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 209, - "end": 220, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 209, - "end": 212, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 213, - "end": 220, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 239, - "end": 258, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 259, - "end": 287, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 259, - "end": 287, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 260, - "end": 287, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 262, - "end": 287, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 263, - "end": 274, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 265, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 265, - "end": 273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 275, - "end": 286, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 275, - "end": 278, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 278, - "end": 286, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 280, - "end": 286, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 289, - "end": 305, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 289, - "end": 305, - "ctxt": 0 - }, - "value": "context", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 296, - "end": 305, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 298, - "end": 305, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 298, - "end": 305, - "ctxt": 0 - }, - "value": "Context", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 222, - "end": 320, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 308, - "end": 319, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 312, - "end": 319, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 322, - "end": 336, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 326, - "end": 335, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 326, - "end": 330, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 330, - "end": 335, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 332, - "end": 335, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 344, - "end": 381, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 350, - "end": 380, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 350, - "end": 354, - "ctxt": 0 - }, - "value": "two1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 357, - "end": 380, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 377, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "span": { - "start": 357, - "end": 380, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 382, - "end": 440, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 388, - "end": 439, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 388, - "end": 392, - "ctxt": 0 - }, - "value": "two2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 395, - "end": 439, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 396, - "end": 415, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "span": { - "start": 395, - "end": 439, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 416, - "end": 424, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 416, - "end": 418, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 419, - "end": 424, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 420, - "end": 423, - "ctxt": 0 - }, - "value": 100.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 426, - "end": 437, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 426, - "end": 429, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 430, - "end": 437, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 441, - "end": 488, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 447, - "end": 487, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 447, - "end": 451, - "ctxt": 0 - }, - "value": "two3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 454, - "end": 487, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 455, - "end": 474, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "span": { - "start": 454, - "end": 487, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 479, - "end": 483, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 539, - "end": 597, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 545, - "end": 596, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 545, - "end": 549, - "ctxt": 0 - }, - "value": "two4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 552, - "end": 596, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 553, - "end": 572, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "span": { - "start": 552, - "end": 596, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 574, - "end": 583, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 574, - "end": 576, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 577, - "end": 583, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 578, - "end": 582, - "ctxt": 0 - }, - "value": 1000.0 - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 585, - "end": 588, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 588, - "end": 592, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 648, - "end": 706, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 654, - "end": 705, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 654, - "end": 658, - "ctxt": 0 - }, - "value": "two5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 661, - "end": 705, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 662, - "end": 681, - "ctxt": 0 - }, - "value": "ZeroThingOrTwoThing", - "optional": false - }, - "span": { - "start": 661, - "end": 705, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 684, - "end": 687, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 687, - "end": 691, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 693, - "end": 702, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 693, - "end": 695, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 696, - "end": 702, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 697, - "end": 701, - "ctxt": 0 - }, - "value": 1000.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 775, - "end": 785, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 786, - "end": 801, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 786, - "end": 801, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 787, - "end": 801, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 789, - "end": 801, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 790, - "end": 800, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 790, - "end": 792, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 792, - "end": 800, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 794, - "end": 800, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 758, - "end": 816, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 802, - "end": 815, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 804, - "end": 815, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 804, - "end": 807, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 808, - "end": 815, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 834, - "end": 844, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 845, - "end": 860, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 845, - "end": 860, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 846, - "end": 860, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 848, - "end": 860, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 849, - "end": 859, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 849, - "end": 851, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 851, - "end": 859, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 853, - "end": 859, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 817, - "end": 875, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 861, - "end": 874, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 863, - "end": 874, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 863, - "end": 866, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 867, - "end": 874, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 893, - "end": 903, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 904, - "end": 932, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 904, - "end": 932, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 905, - "end": 932, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 907, - "end": 932, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 908, - "end": 919, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 908, - "end": 910, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 910, - "end": 918, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 912, - "end": 918, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 920, - "end": 931, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 920, - "end": 923, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 923, - "end": 931, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 925, - "end": 931, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 934, - "end": 950, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 934, - "end": 950, - "ctxt": 0 - }, - "value": "context", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 941, - "end": 950, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 943, - "end": 950, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 943, - "end": 950, - "ctxt": 0 - }, - "value": "Context", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 952, - "end": 964, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 952, - "end": 964, - "ctxt": 0 - }, - "value": "updater", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 959, - "end": 964, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 961, - "end": 964, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 876, - "end": 979, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 965, - "end": 978, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 967, - "end": 978, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 967, - "end": 970, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 971, - "end": 978, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 987, - "end": 1043, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 993, - "end": 1042, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 993, - "end": 999, - "ctxt": 0 - }, - "value": "three1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1002, - "end": 1042, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1003, - "end": 1013, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "span": { - "start": 1002, - "end": 1042, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1014, - "end": 1021, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1014, - "end": 1016, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1017, - "end": 1021, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1018, - "end": 1020, - "ctxt": 0 - }, - "value": 99.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1022, - "end": 1039, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1025, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1026, - "end": 1039, - "ctxt": 0 - }, - "value": "hello world", - "raw": "\"hello world\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1044, - "end": 1083, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1050, - "end": 1082, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1050, - "end": 1056, - "ctxt": 0 - }, - "value": "three2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1059, - "end": 1082, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1060, - "end": 1070, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "span": { - "start": 1059, - "end": 1082, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1071, - "end": 1079, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1073, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1074, - "end": 1079, - "ctxt": 0 - }, - "value": "Bye", - "raw": "\"Bye\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1084, - "end": 1132, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1090, - "end": 1131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1090, - "end": 1096, - "ctxt": 0 - }, - "value": "three3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1099, - "end": 1131, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1100, - "end": 1110, - "ctxt": 0 - }, - "value": "ThreeThing", - "optional": false - }, - "span": { - "start": 1099, - "end": 1131, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1112, - "end": 1115, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1115, - "end": 1119, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1121, - "end": 1128, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1121, - "end": 1123, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1124, - "end": 1128, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1125, - "end": 1127, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload4.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload4.json deleted file mode 100644 index 6823080bbed..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload4.json +++ /dev/null @@ -1,3064 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 1820, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 180, - "end": 188, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 163, - "end": 204, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 190, - "end": 203, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 192, - "end": 203, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 196, - "end": 203, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 222, - "end": 230, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 231, - "end": 259, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 231, - "end": 259, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 232, - "end": 259, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 234, - "end": 259, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 235, - "end": 246, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 237, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 237, - "end": 245, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 239, - "end": 245, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 247, - "end": 258, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 250, - "end": 258, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 252, - "end": 258, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 205, - "end": 274, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 260, - "end": 273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 262, - "end": 273, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 262, - "end": 265, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 266, - "end": 273, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 276, - "end": 318, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 280, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 286, - "end": 318, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 292, - "end": 294, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 296, - "end": 298, - "ctxt": 0 - }, - "value": 10.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 309, - "end": 316, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 319, - "end": 333, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 323, - "end": 332, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 323, - "end": 327, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 327, - "end": 332, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 329, - "end": 332, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 344, - "end": 378, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 350, - "end": 377, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 350, - "end": 352, - "ctxt": 0 - }, - "value": "c0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 355, - "end": 377, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 356, - "end": 364, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 355, - "end": 377, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 365, - "end": 374, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 365, - "end": 374, - "ctxt": 0 - }, - "value": "extraProp", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 399, - "end": 430, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 405, - "end": 429, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 405, - "end": 407, - "ctxt": 0 - }, - "value": "c1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 410, - "end": 429, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 411, - "end": 419, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 410, - "end": 429, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 420, - "end": 427, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 420, - "end": 422, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 423, - "end": 427, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 424, - "end": 426, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 453, - "end": 490, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 459, - "end": 489, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 459, - "end": 461, - "ctxt": 0 - }, - "value": "c2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 464, - "end": 489, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 465, - "end": 473, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 464, - "end": 489, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 483, - "end": 486, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 483, - "end": 486, - "ctxt": 0 - }, - "value": "yy1", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 573, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 519, - "end": 572, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 519, - "end": 521, - "ctxt": 0 - }, - "value": "c3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 524, - "end": 572, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 525, - "end": 533, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 524, - "end": 572, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 535, - "end": 538, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 538, - "end": 541, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 544, - "end": 547, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 547, - "end": 568, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 548, - "end": 553, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 555, - "end": 567, - "ctxt": 0 - }, - "value": "extra attr", - "raw": "\"extra attr\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 623, - "end": 667, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 629, - "end": 666, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 629, - "end": 631, - "ctxt": 0 - }, - "value": "c4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 634, - "end": 666, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 635, - "end": 643, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 634, - "end": 666, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 645, - "end": 648, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 648, - "end": 651, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 653, - "end": 663, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 653, - "end": 655, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 656, - "end": 663, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 657, - "end": 662, - "ctxt": 0 - }, - "value": 10000.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 688, - "end": 737, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 694, - "end": 736, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 694, - "end": 696, - "ctxt": 0 - }, - "value": "c5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 699, - "end": 736, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 700, - "end": 708, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 699, - "end": 736, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 710, - "end": 713, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 713, - "end": 716, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 719, - "end": 722, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 722, - "end": 732, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 723, - "end": 725, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "BooleanLiteral", - "span": { - "start": 727, - "end": 731, - "ctxt": 0 - }, - "value": true - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 761, - "end": 822, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 767, - "end": 821, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 767, - "end": 769, - "ctxt": 0 - }, - "value": "c6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 772, - "end": 821, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 773, - "end": 781, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 772, - "end": 821, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 783, - "end": 786, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 786, - "end": 790, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 793, - "end": 796, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 796, - "end": 817, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 797, - "end": 802, - "ctxt": 0 - }, - "value": "extra", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 804, - "end": 816, - "ctxt": 0 - }, - "value": "extra attr", - "raw": "\"extra attr\"" - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 910, - "end": 947, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 916, - "end": 946, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 916, - "end": 918, - "ctxt": 0 - }, - "value": "c7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 921, - "end": 946, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 922, - "end": 930, - "ctxt": 0 - }, - "value": "OneThing", - "optional": false - }, - "span": { - "start": 921, - "end": 946, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 932, - "end": 935, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 935, - "end": 939, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 941, - "end": 943, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 941, - "end": 943, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1053, - "end": 1068, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1069, - "end": 1094, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1069, - "end": 1094, - "ctxt": 0 - }, - "value": "j", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1070, - "end": 1094, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1072, - "end": 1094, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1073, - "end": 1093, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 1073, - "end": 1085, - "ctxt": 0 - }, - "value": "extra-data", - "raw": "\"extra-data\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1085, - "end": 1093, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1087, - "end": 1093, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1036, - "end": 1109, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1095, - "end": 1108, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1097, - "end": 1108, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1100, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1101, - "end": 1108, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1127, - "end": 1142, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1143, - "end": 1178, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1178, - "ctxt": 0 - }, - "value": "n", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1144, - "end": 1178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1146, - "end": 1178, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1147, - "end": 1158, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1147, - "end": 1149, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1149, - "end": 1157, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1151, - "end": 1157, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1159, - "end": 1177, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1159, - "end": 1168, - "ctxt": 0 - }, - "value": "direction", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1169, - "end": 1177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1171, - "end": 1177, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1110, - "end": 1193, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1179, - "end": 1192, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1181, - "end": 1192, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1181, - "end": 1184, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1185, - "end": 1192, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1204, - "end": 1245, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1210, - "end": 1245, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1210, - "end": 1212, - "ctxt": 0 - }, - "value": "d1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1215, - "end": 1245, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1216, - "end": 1231, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1215, - "end": 1245, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1232, - "end": 1242, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1232, - "end": 1242, - "ctxt": 0 - }, - "value": "extra-data", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1246, - "end": 1304, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1252, - "end": 1304, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1252, - "end": 1254, - "ctxt": 0 - }, - "value": "d2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1257, - "end": 1304, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1258, - "end": 1273, - "ctxt": 0 - }, - "value": "TestingOneThing", - "optional": false - }, - "span": { - "start": 1257, - "end": 1304, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1274, - "end": 1284, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1276, - "ctxt": 0 - }, - "value": "yy", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1277, - "end": 1284, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1285, - "end": 1301, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1285, - "end": 1294, - "ctxt": 0 - }, - "value": "direction", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1295, - "end": 1301, - "ctxt": 0 - }, - "value": "left", - "raw": "\"left\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1323, - "end": 1338, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1339, - "end": 1368, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1339, - "end": 1368, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1340, - "end": 1368, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1342, - "end": 1368, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1343, - "end": 1355, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1343, - "end": 1345, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1346, - "end": 1354, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1348, - "end": 1354, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1356, - "end": 1367, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1356, - "end": 1358, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1359, - "end": 1367, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1361, - "end": 1367, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1306, - "end": 1383, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1369, - "end": 1382, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1371, - "end": 1382, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1371, - "end": 1374, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1375, - "end": 1382, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1401, - "end": 1416, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1417, - "end": 1469, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1417, - "end": 1469, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1418, - "end": 1469, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1420, - "end": 1469, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1421, - "end": 1433, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1421, - "end": 1423, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1424, - "end": 1432, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1426, - "end": 1432, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1434, - "end": 1446, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1434, - "end": 1436, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1437, - "end": 1445, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1439, - "end": 1445, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1447, - "end": 1468, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1447, - "end": 1455, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1455, - "end": 1468, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1457, - "end": 1468, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1457, - "end": 1460, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1461, - "end": 1468, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1384, - "end": 1484, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1470, - "end": 1483, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1472, - "end": 1483, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1472, - "end": 1475, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1476, - "end": 1483, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1502, - "end": 1517, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1518, - "end": 1560, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1518, - "end": 1560, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1519, - "end": 1560, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1521, - "end": 1560, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1522, - "end": 1534, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1522, - "end": 1524, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1524, - "end": 1533, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1526, - "end": 1533, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1535, - "end": 1547, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1535, - "end": 1537, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1538, - "end": 1546, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1540, - "end": 1546, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1548, - "end": 1559, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1548, - "end": 1550, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1550, - "end": 1559, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1552, - "end": 1559, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1485, - "end": 1575, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1561, - "end": 1574, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1563, - "end": 1574, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1563, - "end": 1566, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1567, - "end": 1574, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1586, - "end": 1629, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1592, - "end": 1629, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1592, - "end": 1594, - "ctxt": 0 - }, - "value": "e1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1597, - "end": 1629, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1598, - "end": 1613, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1597, - "end": 1629, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1614, - "end": 1616, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1614, - "end": 1616, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": null - }, - { - "type": "JSXAttribute", - "span": { - "start": 1617, - "end": 1627, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1617, - "end": 1619, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1620, - "end": 1627, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1630, - "end": 1684, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1636, - "end": 1684, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1636, - "end": 1638, - "ctxt": 0 - }, - "value": "e2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1641, - "end": 1684, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1642, - "end": 1657, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1641, - "end": 1684, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1658, - "end": 1668, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1658, - "end": 1660, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1661, - "end": 1668, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1669, - "end": 1678, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1669, - "end": 1671, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1672, - "end": 1678, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1673, - "end": 1677, - "ctxt": 0 - }, - "value": 1000.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1679, - "end": 1681, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1679, - "end": 1681, - "ctxt": 0 - }, - "value": "y3", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1685, - "end": 1750, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1691, - "end": 1750, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1691, - "end": 1693, - "ctxt": 0 - }, - "value": "e3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1696, - "end": 1750, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1697, - "end": 1712, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1696, - "end": 1750, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1713, - "end": 1723, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1713, - "end": 1715, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1716, - "end": 1723, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1724, - "end": 1733, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1724, - "end": 1726, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1727, - "end": 1733, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1728, - "end": 1732, - "ctxt": 0 - }, - "value": 1000.0 - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1734, - "end": 1747, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1734, - "end": 1742, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1743, - "end": 1747, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1751, - "end": 1820, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1757, - "end": 1820, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1757, - "end": 1759, - "ctxt": 0 - }, - "value": "e4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1762, - "end": 1820, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1763, - "end": 1778, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - }, - "span": { - "start": 1762, - "end": 1800, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1779, - "end": 1789, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1779, - "end": 1781, - "ctxt": 0 - }, - "value": "y1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1782, - "end": 1789, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1790, - "end": 1799, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1790, - "end": 1792, - "ctxt": 0 - }, - "value": "y2", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1793, - "end": 1799, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1794, - "end": 1798, - "ctxt": 0 - }, - "value": 1000.0 - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1800, - "end": 1802, - "ctxt": 0 - }, - "value": "Hi", - "raw": "Hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1802, - "end": 1820, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1804, - "end": 1819, - "ctxt": 0 - }, - "value": "TestingOptional", - "optional": false - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload5.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload5.json deleted file mode 100644 index f68199f6543..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload5.json +++ /dev/null @@ -1,2959 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 2014, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 164, - "end": 246, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 171, - "end": 246, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 195, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 196, - "end": 246, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 202, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 225, - "end": 244, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 237, - "end": 243, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 248, - "end": 346, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 255, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 276, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 300, - "end": 346, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 306, - "end": 344, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 306, - "end": 313, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 343, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 315, - "end": 343, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 321, - "end": 338, - "ctxt": 0 - }, - "value": "MouseEventHandler", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 338, - "end": 343, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 348, - "end": 417, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 355, - "end": 417, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 365, - "end": 374, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 398, - "end": 417, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 404, - "end": 415, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 404, - "end": 406, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 406, - "end": 414, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 408, - "end": 414, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 419, - "end": 501, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 426, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 436, - "end": 447, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 456, - "end": 470, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 456, - "end": 470, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 471, - "end": 501, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 477, - "end": 499, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 477, - "end": 490, - "ctxt": 0 - }, - "value": "data-format", - "raw": "\"data-format\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 490, - "end": 498, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 492, - "end": 498, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 503, - "end": 534, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 507, - "end": 533, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 507, - "end": 511, - "ctxt": 0 - }, - "value": "obj0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 514, - "end": 533, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 520, - "end": 522, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 524, - "end": 531, - "ctxt": 0 - }, - "value": "world", - "raw": "\"world\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 536, - "end": 584, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 540, - "end": 584, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 540, - "end": 544, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 547, - "end": 584, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 553, - "end": 561, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 563, - "end": 567, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 573, - "end": 575, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 577, - "end": 582, - "ctxt": 0 - }, - "value": "boo", - "raw": "\"boo\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 586, - "end": 620, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 590, - "end": 620, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 590, - "end": 594, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 597, - "end": 620, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 603, - "end": 610, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 612, - "end": 618, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 616, - "end": 618, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 622, - "end": 636, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 626, - "end": 635, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 626, - "end": 630, - "ctxt": 0 - }, - "value": "obj3", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 630, - "end": 635, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 632, - "end": 635, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 638, - "end": 704, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 654, - "end": 664, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 665, - "end": 689, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 665, - "end": 689, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 676, - "end": 689, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 678, - "end": 689, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 678, - "end": 689, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 645, - "end": 704, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 690, - "end": 703, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 692, - "end": 703, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 692, - "end": 695, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 696, - "end": 703, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 705, - "end": 767, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 721, - "end": 731, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 732, - "end": 752, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 732, - "end": 752, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 741, - "end": 752, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 743, - "end": 752, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 743, - "end": 752, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 712, - "end": 767, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 753, - "end": 766, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 755, - "end": 766, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 755, - "end": 758, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 759, - "end": 766, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 768, - "end": 834, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 784, - "end": 794, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 795, - "end": 819, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 795, - "end": 819, - "ctxt": 0 - }, - "value": "hyphenProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 806, - "end": 819, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 808, - "end": 819, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 808, - "end": 819, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 775, - "end": 834, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 820, - "end": 833, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 822, - "end": 833, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 822, - "end": 825, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 826, - "end": 833, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 835, - "end": 1080, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 851, - "end": 861, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 862, - "end": 906, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 862, - "end": 906, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 867, - "end": 906, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 869, - "end": 906, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 869, - "end": 880, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 869, - "end": 880, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 883, - "end": 892, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 883, - "end": 892, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 895, - "end": 906, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 895, - "end": 906, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 842, - "end": 1080, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 921, - "end": 1080, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 927, - "end": 964, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 933, - "end": 963, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 933, - "end": 942, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsAsExpression", - "span": { - "start": 945, - "end": 963, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 945, - "end": 950, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 954, - "end": 963, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 954, - "end": 963, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 969, - "end": 1036, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 972, - "end": 984, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 972, - "end": 981, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 982, - "end": 984, - "ctxt": 0 - }, - "value": "to", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 986, - "end": 1036, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 996, - "end": 1030, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 1003, - "end": 1029, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1003, - "end": 1022, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1003, - "end": 1007, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1008, - "end": 1022, - "ctxt": 0 - }, - "value": "_buildMainLink", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1023, - "end": 1028, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "alternate": null - }, - { - "type": "ReturnStatement", - "span": { - "start": 1042, - "end": 1078, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 1049, - "end": 1077, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1049, - "end": 1070, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1049, - "end": 1053, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1054, - "end": 1070, - "ctxt": 0 - }, - "value": "_buildMainButton", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1071, - "end": 1076, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 907, - "end": 920, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 909, - "end": 920, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 909, - "end": 912, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 913, - "end": 920, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1091, - "end": 1164, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1097, - "end": 1163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1099, - "ctxt": 0 - }, - "value": "b0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1102, - "end": 1163, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1103, - "end": 1113, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1102, - "end": 1148, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1114, - "end": 1129, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1114, - "end": 1116, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1117, - "end": 1129, - "ctxt": 0 - }, - "value": "/some/path", - "raw": "'/some/path'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1130, - "end": 1147, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1130, - "end": 1137, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1138, - "end": 1147, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1139, - "end": 1146, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1140, - "end": 1141, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1144, - "end": 1146, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1148, - "end": 1150, - "ctxt": 0 - }, - "value": "GO", - "raw": "GO" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1150, - "end": 1163, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1152, - "end": 1162, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1185, - "end": 1267, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1191, - "end": 1266, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1191, - "end": 1193, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1196, - "end": 1266, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1197, - "end": 1207, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1196, - "end": 1242, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1208, - "end": 1231, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1208, - "end": 1215, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1216, - "end": 1231, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1217, - "end": 1230, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1218, - "end": 1224, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1219, - "end": 1224, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1221, - "end": 1224, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1228, - "end": 1230, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1233, - "end": 1236, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1236, - "end": 1240, - "ctxt": 0 - }, - "value": "obj0", - "optional": false - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1242, - "end": 1253, - "ctxt": 0 - }, - "value": "Hello world", - "raw": "Hello world" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1253, - "end": 1266, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1255, - "end": 1265, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1288, - "end": 1343, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1294, - "end": 1342, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1294, - "end": 1296, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1299, - "end": 1342, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1300, - "end": 1310, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1299, - "end": 1342, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1312, - "end": 1315, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1315, - "end": 1328, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1316, - "end": 1318, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1320, - "end": 1327, - "ctxt": 0 - }, - "value": "10000", - "raw": "\"10000\"" - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1331, - "end": 1334, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1334, - "end": 1338, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1363, - "end": 1434, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1369, - "end": 1433, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1369, - "end": 1371, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1374, - "end": 1433, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1375, - "end": 1385, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1374, - "end": 1433, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1387, - "end": 1390, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1390, - "end": 1403, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1391, - "end": 1393, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1395, - "end": 1402, - "ctxt": 0 - }, - "value": "10000", - "raw": "\"10000\"" - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1406, - "end": 1409, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1409, - "end": 1429, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1410, - "end": 1417, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1419, - "end": 1428, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1420, - "end": 1421, - "ctxt": 0 - }, - "value": "k", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1426, - "end": 1428, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1454, - "end": 1493, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1460, - "end": 1492, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1460, - "end": 1462, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1465, - "end": 1492, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1466, - "end": 1476, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1465, - "end": 1492, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1478, - "end": 1481, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1481, - "end": 1485, - "ctxt": 0 - }, - "value": "obj3", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1487, - "end": 1489, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1487, - "end": 1489, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1583, - "end": 1648, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1589, - "end": 1647, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1589, - "end": 1591, - "ctxt": 0 - }, - "value": "b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1594, - "end": 1647, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1595, - "end": 1605, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1594, - "end": 1647, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1607, - "end": 1610, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1610, - "end": 1633, - "ctxt": 0 - }, - "properties": [ - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1612, - "end": 1619, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1620, - "end": 1626, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1620, - "end": 1626, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1621, - "end": 1626, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1623, - "end": 1626, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1612, - "end": 1631, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1628, - "end": 1631, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1636, - "end": 1639, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1639, - "end": 1643, - "ctxt": 0 - }, - "value": "obj0", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1743, - "end": 1810, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1749, - "end": 1809, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1749, - "end": 1751, - "ctxt": 0 - }, - "value": "b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1754, - "end": 1809, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1755, - "end": 1765, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1754, - "end": 1809, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1767, - "end": 1770, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1770, - "end": 1791, - "ctxt": 0 - }, - "properties": [ - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1772, - "end": 1779, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1780, - "end": 1786, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1780, - "end": 1786, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1781, - "end": 1786, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1783, - "end": 1786, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1772, - "end": 1789, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1787, - "end": 1789, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1793, - "end": 1806, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1793, - "end": 1801, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1802, - "end": 1806, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1803, - "end": 1805, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1853, - "end": 1933, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1859, - "end": 1932, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1859, - "end": 1861, - "ctxt": 0 - }, - "value": "b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1864, - "end": 1932, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1865, - "end": 1875, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1864, - "end": 1932, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1877, - "end": 1880, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1880, - "end": 1901, - "ctxt": 0 - }, - "properties": [ - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1882, - "end": 1889, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1890, - "end": 1896, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1890, - "end": 1896, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1891, - "end": 1896, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1893, - "end": 1896, - "ctxt": 0 - }, - "kind": "any" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1882, - "end": 1899, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1897, - "end": 1899, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1903, - "end": 1919, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1903, - "end": 1911, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1912, - "end": 1919, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1920, - "end": 1929, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1920, - "end": 1929, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1976, - "end": 2014, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1982, - "end": 2013, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1982, - "end": 1984, - "ctxt": 0 - }, - "value": "b8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1987, - "end": 2013, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1988, - "end": 1998, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1987, - "end": 2013, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1999, - "end": 2010, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1999, - "end": 2010, - "ctxt": 0 - }, - "value": "data-format", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload6.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload6.json deleted file mode 100644 index cdf46e6f722..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentOverload6.json +++ /dev/null @@ -1,3105 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 1939, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 164, - "end": 246, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 171, - "end": 246, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 181, - "end": 195, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 196, - "end": 246, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 202, - "end": 220, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 219, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 213, - "end": 219, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 225, - "end": 244, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 225, - "end": 234, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 237, - "end": 243, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 248, - "end": 346, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 255, - "end": 346, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 265, - "end": 276, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 285, - "end": 299, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 300, - "end": 346, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 306, - "end": 344, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 306, - "end": 313, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 313, - "end": 343, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 315, - "end": 343, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 315, - "end": 320, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 321, - "end": 338, - "ctxt": 0 - }, - "value": "MouseEventHandler", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 338, - "end": 343, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 348, - "end": 417, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 355, - "end": 417, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 365, - "end": 374, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 383, - "end": 397, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 398, - "end": 417, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 404, - "end": 415, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 404, - "end": 406, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 406, - "end": 414, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 408, - "end": 414, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 419, - "end": 501, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 426, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 436, - "end": 447, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 456, - "end": 470, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 456, - "end": 470, - "ctxt": 0 - }, - "value": "ClickableProps", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 471, - "end": 501, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 477, - "end": 499, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 477, - "end": 490, - "ctxt": 0 - }, - "value": "data-format", - "raw": "\"data-format\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 490, - "end": 498, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 492, - "end": 498, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 503, - "end": 550, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 507, - "end": 550, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 507, - "end": 510, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 513, - "end": 550, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 519, - "end": 527, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 529, - "end": 533, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 539, - "end": 541, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 543, - "end": 548, - "ctxt": 0 - }, - "value": "boo", - "raw": "\"boo\"" - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 551, - "end": 565, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 555, - "end": 564, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 555, - "end": 559, - "ctxt": 0 - }, - "value": "obj1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 559, - "end": 564, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 561, - "end": 564, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 566, - "end": 602, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 570, - "end": 602, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 570, - "end": 574, - "ctxt": 0 - }, - "value": "obj2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 577, - "end": 602, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 583, - "end": 590, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 592, - "end": 600, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 598, - "end": 600, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "ExportDeclaration", - "span": { - "start": 604, - "end": 670, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 620, - "end": 630, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 631, - "end": 655, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 631, - "end": 655, - "ctxt": 0 - }, - "value": "buttonProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 642, - "end": 655, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 644, - "end": 655, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 644, - "end": 655, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 611, - "end": 670, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 656, - "end": 669, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 658, - "end": 669, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 658, - "end": 661, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 662, - "end": 669, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 671, - "end": 733, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 687, - "end": 697, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 698, - "end": 718, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 698, - "end": 718, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 707, - "end": 718, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 709, - "end": 718, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 709, - "end": 718, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 678, - "end": 733, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 719, - "end": 732, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 721, - "end": 732, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 721, - "end": 724, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 725, - "end": 732, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 734, - "end": 800, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 750, - "end": 760, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 761, - "end": 785, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 761, - "end": 785, - "ctxt": 0 - }, - "value": "hyphenProps", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 772, - "end": 785, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 774, - "end": 785, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 774, - "end": 785, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 741, - "end": 800, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 786, - "end": 799, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 788, - "end": 799, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 788, - "end": 791, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 792, - "end": 799, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 801, - "end": 1046, - "ctxt": 0 - }, - "declaration": { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 817, - "end": 827, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 828, - "end": 872, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 828, - "end": 872, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 833, - "end": 872, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 835, - "end": 872, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 835, - "end": 846, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 835, - "end": 846, - "ctxt": 0 - }, - "value": "ButtonProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 849, - "end": 858, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 849, - "end": 858, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 861, - "end": 872, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 861, - "end": 872, - "ctxt": 0 - }, - "value": "HyphenProps", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 808, - "end": 1046, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 887, - "end": 1046, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 893, - "end": 930, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 899, - "end": 929, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 899, - "end": 908, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsAsExpression", - "span": { - "start": 911, - "end": 929, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 911, - "end": 916, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 920, - "end": 929, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 920, - "end": 929, - "ctxt": 0 - }, - "value": "LinkProps", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 935, - "end": 1002, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 938, - "end": 950, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 938, - "end": 947, - "ctxt": 0 - }, - "value": "linkProps", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 948, - "end": 950, - "ctxt": 0 - }, - "value": "to", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 952, - "end": 1002, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 962, - "end": 996, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 969, - "end": 995, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 969, - "end": 988, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 969, - "end": 973, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 974, - "end": 988, - "ctxt": 0 - }, - "value": "_buildMainLink", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 989, - "end": 994, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "alternate": null - }, - { - "type": "ReturnStatement", - "span": { - "start": 1008, - "end": 1044, - "ctxt": 0 - }, - "argument": { - "type": "CallExpression", - "span": { - "start": 1015, - "end": 1043, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1015, - "end": 1036, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 1015, - "end": 1019, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 1020, - "end": 1036, - "ctxt": 0 - }, - "value": "_buildMainButton", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1037, - "end": 1042, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 873, - "end": 886, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 875, - "end": 886, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 875, - "end": 878, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 879, - "end": 886, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1054, - "end": 1109, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1060, - "end": 1108, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1060, - "end": 1062, - "ctxt": 0 - }, - "value": "b0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1065, - "end": 1108, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1066, - "end": 1076, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1065, - "end": 1093, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1077, - "end": 1092, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1077, - "end": 1079, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1080, - "end": 1092, - "ctxt": 0 - }, - "value": "/some/path", - "raw": "'/some/path'" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1093, - "end": 1095, - "ctxt": 0 - }, - "value": "GO", - "raw": "GO" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1095, - "end": 1108, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1107, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1110, - "end": 1178, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1116, - "end": 1177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1118, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1121, - "end": 1177, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1122, - "end": 1132, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1121, - "end": 1153, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1133, - "end": 1152, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1133, - "end": 1140, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1141, - "end": 1152, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1142, - "end": 1151, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1143, - "end": 1144, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1149, - "end": 1151, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1153, - "end": 1164, - "ctxt": 0 - }, - "value": "Hello world", - "raw": "Hello world" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1164, - "end": 1177, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1166, - "end": 1176, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1179, - "end": 1214, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1185, - "end": 1213, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1185, - "end": 1187, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1190, - "end": 1213, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1191, - "end": 1201, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1190, - "end": 1213, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1203, - "end": 1206, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1206, - "end": 1209, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1215, - "end": 1267, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1221, - "end": 1266, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1221, - "end": 1223, - "ctxt": 0 - }, - "value": "b3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1226, - "end": 1266, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1227, - "end": 1237, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1226, - "end": 1266, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1239, - "end": 1242, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1242, - "end": 1253, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1243, - "end": 1245, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 1247, - "end": 1252, - "ctxt": 0 - }, - "value": 10000.0 - } - } - ] - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 1256, - "end": 1259, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1259, - "end": 1262, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1268, - "end": 1304, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1274, - "end": 1303, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1276, - "ctxt": 0 - }, - "value": "b4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1279, - "end": 1303, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1280, - "end": 1290, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1279, - "end": 1303, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1292, - "end": 1295, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1295, - "end": 1299, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1343, - "end": 1398, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1349, - "end": 1397, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1349, - "end": 1351, - "ctxt": 0 - }, - "value": "b5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1354, - "end": 1397, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1355, - "end": 1365, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1354, - "end": 1397, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1367, - "end": 1370, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1370, - "end": 1374, - "ctxt": 0 - }, - "value": "obj1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1376, - "end": 1394, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1376, - "end": 1378, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1379, - "end": 1394, - "ctxt": 0 - }, - "value": "/to/somewhere", - "raw": "\"/to/somewhere\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1435, - "end": 1471, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1441, - "end": 1470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1441, - "end": 1443, - "ctxt": 0 - }, - "value": "b6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1446, - "end": 1470, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1447, - "end": 1457, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1446, - "end": 1470, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1459, - "end": 1462, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 1462, - "end": 1466, - "ctxt": 0 - }, - "value": "obj2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1472, - "end": 1542, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1478, - "end": 1541, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1478, - "end": 1480, - "ctxt": 0 - }, - "value": "b7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1483, - "end": 1541, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1484, - "end": 1494, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1483, - "end": 1541, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1496, - "end": 1499, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1499, - "end": 1537, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1500, - "end": 1507, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1509, - "end": 1536, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BlockStatement", - "span": { - "start": 1515, - "end": 1536, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1517, - "end": 1534, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1517, - "end": 1534, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1517, - "end": 1528, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1517, - "end": 1524, - "ctxt": 0 - }, - "value": "console", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1525, - "end": 1528, - "ctxt": 0 - }, - "value": "log", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1529, - "end": 1533, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "typeArguments": null - } - } - ] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1543, - "end": 1589, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1549, - "end": 1588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1549, - "end": 1551, - "ctxt": 0 - }, - "value": "b8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1554, - "end": 1588, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1555, - "end": 1565, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1554, - "end": 1588, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 1567, - "end": 1570, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 1570, - "end": 1584, - "ctxt": 0 - }, - "properties": [ - { - "type": "MethodProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1571, - "end": 1578, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "params": [], - "decorators": [], - "span": { - "start": 1571, - "end": 1583, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1581, - "end": 1583, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ] - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1650, - "end": 1716, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1656, - "end": 1715, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1656, - "end": 1658, - "ctxt": 0 - }, - "value": "b9", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1661, - "end": 1715, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1662, - "end": 1672, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1661, - "end": 1700, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1673, - "end": 1688, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1673, - "end": 1675, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1676, - "end": 1688, - "ctxt": 0 - }, - "value": "/some/path", - "raw": "'/some/path'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1689, - "end": 1699, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1689, - "end": 1699, - "ctxt": 0 - }, - "value": "extra-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1700, - "end": 1702, - "ctxt": 0 - }, - "value": "GO", - "raw": "GO" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1702, - "end": 1715, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1704, - "end": 1714, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1717, - "end": 1786, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1723, - "end": 1785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1723, - "end": 1726, - "ctxt": 0 - }, - "value": "b10", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1729, - "end": 1785, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1730, - "end": 1740, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1729, - "end": 1772, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1741, - "end": 1756, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1741, - "end": 1743, - "ctxt": 0 - }, - "value": "to", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1744, - "end": 1756, - "ctxt": 0 - }, - "value": "/some/path", - "raw": "'/some/path'" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1757, - "end": 1770, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1757, - "end": 1765, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1766, - "end": 1770, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1772, - "end": 1785, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1774, - "end": 1784, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1787, - "end": 1886, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1793, - "end": 1885, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1793, - "end": 1796, - "ctxt": 0 - }, - "value": "b11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1799, - "end": 1885, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1800, - "end": 1810, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1799, - "end": 1861, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1811, - "end": 1830, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1811, - "end": 1818, - "ctxt": 0 - }, - "value": "onClick", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1819, - "end": 1830, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1820, - "end": 1829, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1821, - "end": 1822, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1827, - "end": 1829, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1831, - "end": 1848, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1831, - "end": 1840, - "ctxt": 0 - }, - "value": "className", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1841, - "end": 1848, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 1849, - "end": 1860, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1849, - "end": 1860, - "ctxt": 0 - }, - "value": "data-format", - "optional": false - }, - "value": null - } - ], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 1861, - "end": 1872, - "ctxt": 0 - }, - "value": "Hello world", - "raw": "Hello world" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 1872, - "end": 1885, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1874, - "end": 1884, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - } - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1887, - "end": 1939, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1893, - "end": 1939, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1893, - "end": 1896, - "ctxt": 0 - }, - "value": "b12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1899, - "end": 1939, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1900, - "end": 1910, - "ctxt": 0 - }, - "value": "MainButton", - "optional": false - }, - "span": { - "start": 1899, - "end": 1939, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1911, - "end": 1936, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1911, - "end": 1922, - "ctxt": 0 - }, - "value": "data-format", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1923, - "end": 1936, - "ctxt": 0 - }, - "value": "Hello world", - "raw": "\"Hello world\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter1.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter1.json deleted file mode 100644 index 3c2b45aa1e2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter1.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 415, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 164, - "end": 213, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 174, - "end": 189, - "ctxt": 0 - }, - "value": "MyComponentProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 190, - "end": 213, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 196, - "end": 211, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 224, - "end": 235, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 257, - "end": 264, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 257, - "end": 264, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 261, - "end": 264, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 215, - "end": 303, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 266, - "end": 303, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 272, - "end": 301, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 279, - "end": 301, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 279, - "end": 284, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 284, - "end": 295, - "ctxt": 0 - }, - "value": "attr.values", - "raw": "attr.values" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 295, - "end": 301, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 297, - "end": 300, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 235, - "end": 256, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 236, - "end": 255, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 236, - "end": 237, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": { - "type": "TsTypeReference", - "span": { - "start": 240, - "end": 255, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 240, - "end": 255, - "ctxt": 0 - }, - "value": "MyComponentProp", - "optional": false - }, - "typeParams": null - } - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 311, - "end": 342, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 315, - "end": 341, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 315, - "end": 316, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 319, - "end": 341, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 320, - "end": 331, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 319, - "end": 341, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 332, - "end": 338, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 332, - "end": 338, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 376, - "end": 415, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 380, - "end": 414, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 380, - "end": 382, - "ctxt": 0 - }, - "value": "i1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 385, - "end": 414, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 386, - "end": 397, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 385, - "end": 414, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 398, - "end": 412, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 398, - "end": 404, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 405, - "end": 412, - "ctxt": 0 - }, - "value": "Hello", - "raw": "\"Hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter2.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter2.json deleted file mode 100644 index d07cb5a98bd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentWithDefaultTypeParameter2.json +++ /dev/null @@ -1,419 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 358, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 164, - "end": 213, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 174, - "end": 189, - "ctxt": 0 - }, - "value": "MyComponentProp", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 190, - "end": 213, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 196, - "end": 211, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 196, - "end": 202, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 202, - "end": 210, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 224, - "end": 236, - "ctxt": 0 - }, - "value": "MyComponent1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 264, - "end": 271, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 264, - "end": 271, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 268, - "end": 271, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 270, - "end": 271, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 215, - "end": 310, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 273, - "end": 310, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 279, - "end": 308, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 286, - "end": 308, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 287, - "end": 290, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 291, - "end": 302, - "ctxt": 0 - }, - "value": "attr.values", - "raw": "attr.values" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 302, - "end": 308, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 304, - "end": 307, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 236, - "end": 263, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 237, - "end": 262, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 237, - "end": 238, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeReference", - "span": { - "start": 247, - "end": 262, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 247, - "end": 262, - "ctxt": 0 - }, - "value": "MyComponentProp", - "optional": false - }, - "typeParams": null - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 322, - "end": 358, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 326, - "end": 357, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 326, - "end": 328, - "ctxt": 0 - }, - "value": "i1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 331, - "end": 357, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 332, - "end": 344, - "ctxt": 0 - }, - "value": "MyComponent1", - "optional": false - }, - "span": { - "start": 331, - "end": 357, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 345, - "end": 355, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 345, - "end": 351, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 352, - "end": 355, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 353, - "end": 354, - "ctxt": 0 - }, - "value": 5.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents1.tsx b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents1.tsx deleted file mode 100644 index 5cf85eee812..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents1.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// @filename: file.tsx -// @jsx: preserve -// @noLib: true -// @skipLibCheck: true -// @libFiles: react.d.ts,lib.d.ts - -function EmptyPropSFC() { - return
Default Greeting
; -} - -function Greet(x: {name: string}) { - return
Hello, {x}
; -} -function Meet({name = 'world'}) { - return
Hello, {name}
; -} -function MeetAndGreet(k: {"prop-name": string}) { - return
Hi Hi
; -} - -// OK -let a = ; -let a1 = ; -// Error -let b = ; - -// OK -let c = ; -let c1 = ; -// OK -let d = ; -// Error -let e = ; -// Error -let f = ; - -// OK -let g = ; -// Error -let h = ; - -// Error -let i = -let i1 = x.greeting.substr(10)} /> - -let o = { - prop1: true; -} - -// OK as access properties are allow when spread -let i2 = - -let o1: any; -// OK -let j = -let j1 = -let j2 = -let j3 = -let j4 = - diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents2.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents2.json deleted file mode 100644 index 31de5decb06..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents2.json +++ /dev/null @@ -1,1663 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 115, - "end": 1094, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 115, - "end": 147, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 122, - "end": 127, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 130, - "end": 146, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 138, - "end": 145, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 158, - "end": 163, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 164, - "end": 182, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 164, - "end": 182, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 165, - "end": 182, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 167, - "end": 182, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 181, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 172, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 173, - "end": 181, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 175, - "end": 181, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 149, - "end": 218, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 184, - "end": 218, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 187, - "end": 216, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 194, - "end": 215, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 194, - "end": 199, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 199, - "end": 206, - "ctxt": 0 - }, - "value": "Hello, ", - "raw": "Hello, " - }, - { - "type": "JSXExpressionContainer", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 209, - "end": 215, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 226, - "end": 236, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "declare": false, - "span": { - "start": 220, - "end": 343, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 287, - "end": 322, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 287, - "end": 293, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 287, - "end": 322, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 296, - "end": 322, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 300, - "end": 319, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 307, - "end": 318, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 307, - "end": 312, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 312, - "end": 318, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 324, - "end": 341, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 324, - "end": 332, - "ctxt": 0 - }, - "value": "greeting", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 332, - "end": 340, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 334, - "end": 340, - "ctxt": 0 - }, - "kind": "string" - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 245, - "end": 260, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 245, - "end": 250, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 251, - "end": 260, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 260, - "end": 283, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 261, - "end": 278, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 263, - "end": 276, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 267, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 268, - "end": 276, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 270, - "end": 276, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 280, - "end": 282, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 351, - "end": 369, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 355, - "end": 368, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 355, - "end": 356, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 359, - "end": 368, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 360, - "end": 365, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 359, - "end": 368, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 408, - "end": 434, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 412, - "end": 433, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 412, - "end": 413, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 416, - "end": 433, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 422, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 416, - "end": 433, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 423, - "end": 430, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 423, - "end": 426, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 427, - "end": 430, - "ctxt": 0 - }, - "value": "k", - "raw": "\"k\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 483, - "end": 513, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 487, - "end": 512, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 491, - "end": 512, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 492, - "end": 497, - "ctxt": 0 - }, - "value": "Greet", - "optional": false - }, - "span": { - "start": 491, - "end": 512, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 498, - "end": 509, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 498, - "end": 501, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 502, - "end": 509, - "ctxt": 0 - }, - "value": "myRef", - "raw": "\"myRef\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 549, - "end": 605, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 553, - "end": 604, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 553, - "end": 554, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 557, - "end": 604, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 558, - "end": 568, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 557, - "end": 604, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 569, - "end": 601, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 569, - "end": 572, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 573, - "end": 601, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 574, - "end": 600, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 574, - "end": 575, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 579, - "end": 600, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 579, - "end": 596, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 579, - "end": 589, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 579, - "end": 580, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 581, - "end": 589, - "ctxt": 0 - }, - "value": "greeting", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 590, - "end": 596, - "ctxt": 0 - }, - "value": "substr", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 597, - "end": 599, - "ctxt": 0 - }, - "value": 10.0 - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 639, - "end": 694, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 643, - "end": 693, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 643, - "end": 644, - "ctxt": 0 - }, - "value": "e", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 647, - "end": 693, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 648, - "end": 658, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 647, - "end": 693, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 659, - "end": 690, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 659, - "end": 662, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 663, - "end": 690, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 664, - "end": 689, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 664, - "end": 665, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 669, - "end": 689, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 669, - "end": 685, - "ctxt": 0 - }, - "object": { - "type": "MemberExpression", - "span": { - "start": 669, - "end": 679, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 669, - "end": 670, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 671, - "end": 679, - "ctxt": 0 - }, - "value": "greeting", - "optional": false - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 680, - "end": 685, - "ctxt": 0 - }, - "value": "subtr", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 686, - "end": 688, - "ctxt": 0 - }, - "value": 10.0 - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 741, - "end": 794, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 745, - "end": 793, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 745, - "end": 746, - "ctxt": 0 - }, - "value": "f", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 749, - "end": 793, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 750, - "end": 760, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 749, - "end": 793, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 761, - "end": 790, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 761, - "end": 764, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 765, - "end": 790, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 766, - "end": 789, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 766, - "end": 767, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 771, - "end": 789, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 771, - "end": 772, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 773, - "end": 789, - "ctxt": 0 - }, - "value": "notARealProperty", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 824, - "end": 857, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 828, - "end": 856, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 828, - "end": 829, - "ctxt": 0 - }, - "value": "g", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 832, - "end": 856, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 833, - "end": 843, - "ctxt": 0 - }, - "value": "BigGreeter", - "optional": false - }, - "span": { - "start": 832, - "end": 856, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 844, - "end": 853, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 844, - "end": 847, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 848, - "end": 853, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 849, - "end": 852, - "ctxt": 0 - }, - "value": 100.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 919, - "end": 958, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 923, - "end": 957, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 923, - "end": 924, - "ctxt": 0 - }, - "value": "h", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 927, - "end": 957, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 928, - "end": 931, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 927, - "end": 957, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 932, - "end": 954, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 932, - "end": 935, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 936, - "end": 954, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 937, - "end": 953, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 937, - "end": 938, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 942, - "end": 953, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 942, - "end": 943, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 944, - "end": 953, - "ctxt": 0 - }, - "value": "innerText", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1037, - "end": 1094, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1041, - "end": 1093, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1041, - "end": 1042, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1045, - "end": 1093, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1046, - "end": 1049, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 1045, - "end": 1093, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1050, - "end": 1090, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1050, - "end": 1053, - "ctxt": 0 - }, - "value": "ref", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1054, - "end": 1090, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1055, - "end": 1089, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1056, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "MemberExpression", - "span": { - "start": 1060, - "end": 1089, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1060, - "end": 1061, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1062, - "end": 1089, - "ctxt": 0 - }, - "value": "propertyNotOnHtmlDivElement", - "optional": false - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents3.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents3.json deleted file mode 100644 index 1ab3c79a258..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponents3.json +++ /dev/null @@ -1,735 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 461, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 163, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 165, - "end": 200, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 171, - "end": 199, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 171, - "end": 174, - "ctxt": 0 - }, - "value": "Foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 177, - "end": 199, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 178, - "end": 188, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 183, - "end": 188, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 185, - "end": 188, - "ctxt": 0 - }, - "kind": "any" - } - } - } - ], - "body": { - "type": "JSXElement", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 194, - "end": 197, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 217, - "end": 237, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 223, - "end": 236, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 223, - "end": 226, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 229, - "end": 236, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "value": "Foo", - "optional": false - }, - "span": { - "start": 229, - "end": 236, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 256, - "end": 350, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 260, - "end": 349, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 260, - "end": 268, - "ctxt": 0 - }, - "value": "MainMenu", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 268, - "end": 298, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 270, - "end": 298, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 276, - "end": 294, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 294, - "end": 298, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 295, - "end": 297, - "ctxt": 0 - }, - "members": [] - } - ] - } - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 301, - "end": 349, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 302, - "end": 307, - "ctxt": 0 - }, - "value": "props", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 312, - "end": 349, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 313, - "end": 348, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 317, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 313, - "end": 318, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 318, - "end": 323, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 323, - "end": 341, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 324, - "end": 326, - "ctxt": 0 - }, - "value": "h3", - "optional": false - }, - "span": { - "start": 323, - "end": 327, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 327, - "end": 336, - "ctxt": 0 - }, - "value": "Main Menu", - "raw": "Main Menu" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 336, - "end": 341, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 340, - "ctxt": 0 - }, - "value": "h3", - "optional": false - } - } - }, - { - "type": "JSXText", - "span": { - "start": 341, - "end": 342, - "ctxt": 0 - }, - "value": "\n\n", - "raw": "\n\n" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 342, - "end": 348, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 347, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 352, - "end": 461, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 356, - "end": 460, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 356, - "end": 359, - "ctxt": 0 - }, - "value": "App", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 359, - "end": 399, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 361, - "end": 399, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 361, - "end": 366, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 367, - "end": 385, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 385, - "end": 399, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 386, - "end": 398, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 388, - "end": 396, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 388, - "end": 396, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": null, - "typeParams": null - } - ] - } - ] - } - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 402, - "end": 460, - "ctxt": 0 - }, - "params": [ - { - "type": "ObjectPattern", - "span": { - "start": 403, - "end": 413, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 404, - "end": 412, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 404, - "end": 412, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "ParenthesisExpression", - "span": { - "start": 418, - "end": 460, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 424, - "end": 458, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 425, - "end": 428, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 424, - "end": 430, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 430, - "end": 439, - "ctxt": 0 - }, - "value": "\n\n ", - "raw": "\n\n " - }, - { - "type": "JSXElement", - "span": { - "start": 439, - "end": 450, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 440, - "end": 448, - "ctxt": 0 - }, - "value": "MainMenu", - "optional": false - }, - "span": { - "start": 439, - "end": 450, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - { - "type": "JSXText", - "span": { - "start": 450, - "end": 452, - "ctxt": 0 - }, - "value": "\n\n\t", - "raw": "\n\n\t" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 452, - "end": 458, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 454, - "end": 457, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments1.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments1.json deleted file mode 100644 index 926271882ba..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments1.json +++ /dev/null @@ -1,2052 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 968, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 207, - "ctxt": 0 - }, - "value": "ComponentWithTwoAttributes", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 213, - "end": 235, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 213, - "end": 235, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 235, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 216, - "end": 235, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 217, - "end": 225, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 217, - "end": 221, - "ctxt": 0 - }, - "value": "key1", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 221, - "end": 224, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 223, - "end": 224, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 226, - "end": 234, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 226, - "end": 231, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 231, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 233, - "end": 234, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 233, - "end": 234, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 164, - "end": 250, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 207, - "end": 212, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 208, - "end": 209, - "ctxt": 0 - }, - "value": "K", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "V", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 236, - "end": 249, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 238, - "end": 249, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 238, - "end": 241, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 242, - "end": 249, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 267, - "end": 270, - "ctxt": 0 - }, - "value": "Baz", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 276, - "end": 283, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 276, - "end": 283, - "ctxt": 0 - }, - "value": "key1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 280, - "end": 283, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 282, - "end": 283, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 282, - "end": 283, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 285, - "end": 293, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 285, - "end": 293, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 290, - "end": 293, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 292, - "end": 293, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 258, - "end": 454, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 295, - "end": 454, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 301, - "end": 366, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 305, - "end": 366, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 305, - "end": 307, - "ctxt": 0 - }, - "value": "a0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 310, - "end": 366, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 311, - "end": 337, - "ctxt": 0 - }, - "value": "ComponentWithTwoAttributes", - "optional": false - }, - "span": { - "start": 310, - "end": 366, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 338, - "end": 349, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 338, - "end": 342, - "ctxt": 0 - }, - "value": "key1", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 343, - "end": 349, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 344, - "end": 348, - "ctxt": 0 - }, - "value": "key1", - "optional": false - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 350, - "end": 363, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 350, - "end": 355, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 356, - "end": 363, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 357, - "end": 362, - "ctxt": 0 - }, - "value": "value", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 371, - "end": 452, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 375, - "end": 452, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 375, - "end": 377, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 380, - "end": 452, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 381, - "end": 407, - "ctxt": 0 - }, - "value": "ComponentWithTwoAttributes", - "optional": false - }, - "span": { - "start": 380, - "end": 452, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 409, - "end": 412, - "ctxt": 0 - }, - "arguments": { - "type": "ObjectExpression", - "span": { - "start": 412, - "end": 432, - "ctxt": 0 - }, - "properties": [ - { - "type": "Identifier", - "span": { - "start": 413, - "end": 417, - "ctxt": 0 - }, - "value": "key1", - "optional": false - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 419, - "end": 424, - "ctxt": 0 - }, - "value": "value", - "optional": false - }, - "value": { - "type": "Identifier", - "span": { - "start": 426, - "end": 431, - "ctxt": 0 - }, - "value": "value", - "optional": false - } - } - ] - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 434, - "end": 449, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 434, - "end": 437, - "ctxt": 0 - }, - "value": "key", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 438, - "end": 449, - "ctxt": 0 - }, - "value": "Component", - "raw": "\"Component\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 270, - "end": 275, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 271, - "end": 272, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 473, - "end": 477, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 481, - "end": 506, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 481, - "end": 506, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 482, - "end": 506, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 484, - "end": 506, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 485, - "end": 505, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 485, - "end": 489, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 489, - "end": 505, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 491, - "end": 505, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 492, - "end": 498, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 495, - "end": 498, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 499, - "end": 505, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 501, - "end": 505, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 456, - "end": 521, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 477, - "end": 480, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 507, - "end": 520, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 509, - "end": 520, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 509, - "end": 512, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 513, - "end": 520, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 538, - "end": 548, - "ctxt": 0 - }, - "value": "createLink", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 549, - "end": 572, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 549, - "end": 572, - "ctxt": 0 - }, - "value": "func", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 553, - "end": 572, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 555, - "end": 572, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 556, - "end": 565, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 557, - "end": 565, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 559, - "end": 565, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 566, - "end": 572, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 568, - "end": 572, - "ctxt": 0 - }, - "kind": "void" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 529, - "end": 610, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 574, - "end": 610, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 580, - "end": 608, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 584, - "end": 608, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 584, - "end": 585, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 588, - "end": 608, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 589, - "end": 593, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "span": { - "start": 588, - "end": 608, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 594, - "end": 605, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 594, - "end": 598, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 599, - "end": 605, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 600, - "end": 604, - "ctxt": 0 - }, - "value": "func", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 621, - "end": 632, - "ctxt": 0 - }, - "value": "createLink1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 633, - "end": 659, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 633, - "end": 659, - "ctxt": 0 - }, - "value": "func", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 637, - "end": 659, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 639, - "end": 659, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 640, - "end": 649, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 641, - "end": 649, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 643, - "end": 649, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 650, - "end": 659, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 652, - "end": 659, - "ctxt": 0 - }, - "kind": "boolean" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 612, - "end": 697, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 661, - "end": 697, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 667, - "end": 695, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 671, - "end": 695, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 671, - "end": 672, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 675, - "end": 695, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 676, - "end": 680, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "span": { - "start": 675, - "end": 695, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 681, - "end": 692, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 681, - "end": 685, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 686, - "end": 692, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 687, - "end": 691, - "ctxt": 0 - }, - "value": "func", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 699, - "end": 797, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 709, - "end": 723, - "ctxt": 0 - }, - "value": "InferParamProp", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 723, - "end": 726, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 724, - "end": 725, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 724, - "end": 725, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 727, - "end": 797, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 733, - "end": 750, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 733, - "end": 739, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 739, - "end": 749, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 741, - "end": 749, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 741, - "end": 746, - "ctxt": 0 - }, - "value": "Array", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 746, - "end": 749, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 747, - "end": 748, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 747, - "end": 748, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 755, - "end": 795, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 755, - "end": 768, - "ctxt": 0 - }, - "value": "selectHandler", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 768, - "end": 794, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 770, - "end": 794, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 771, - "end": 785, - "ctxt": 0 - }, - "value": "selectedVal", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 782, - "end": 785, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 784, - "end": 785, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 784, - "end": 785, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 787, - "end": 794, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 790, - "end": 794, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 816, - "end": 835, - "ctxt": 0 - }, - "value": "InferParamComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 839, - "end": 862, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 839, - "end": 862, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 843, - "end": 862, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 845, - "end": 862, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 845, - "end": 859, - "ctxt": 0 - }, - "value": "InferParamProp", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 859, - "end": 862, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 860, - "end": 861, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 860, - "end": 861, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 799, - "end": 877, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 835, - "end": 838, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 836, - "end": 837, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 836, - "end": 837, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 863, - "end": 876, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 865, - "end": 876, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 865, - "end": 868, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 869, - "end": 876, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 885, - "end": 968, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 889, - "end": 967, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 889, - "end": 890, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 893, - "end": 967, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 894, - "end": 913, - "ctxt": 0 - }, - "value": "InferParamComponent", - "optional": false - }, - "span": { - "start": 893, - "end": 967, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 914, - "end": 935, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 914, - "end": 920, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 921, - "end": 935, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 922, - "end": 934, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 923, - "end": 924, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 926, - "end": 927, - "ctxt": 0 - }, - "value": 2.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 929, - "end": 930, - "ctxt": 0 - }, - "value": 3.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 932, - "end": 933, - "ctxt": 0 - }, - "value": 4.0 - } - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 936, - "end": 964, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 936, - "end": 949, - "ctxt": 0 - }, - "value": "selectHandler", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 950, - "end": 964, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 951, - "end": 963, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 952, - "end": 955, - "ctxt": 0 - }, - "value": "val", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 960, - "end": 963, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments2.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments2.json deleted file mode 100644 index 0c8dbb7bd67..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments2.json +++ /dev/null @@ -1,2045 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 980, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 199, - "ctxt": 0 - }, - "value": "ComponentSpecific1", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 203, - "end": 238, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 203, - "end": 238, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 204, - "end": 238, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 206, - "end": 238, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 207, - "end": 215, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 207, - "end": 211, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 211, - "end": 214, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 216, - "end": 237, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 216, - "end": 229, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 229, - "end": 237, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 231, - "end": 237, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 164, - "end": 253, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 199, - "end": 202, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 200, - "end": 201, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 252, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 241, - "end": 252, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 241, - "end": 244, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 245, - "end": 252, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 271, - "end": 289, - "ctxt": 0 - }, - "value": "ComponentSpecific2", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 293, - "end": 305, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 293, - "end": 305, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 305, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 296, - "end": 305, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 297, - "end": 304, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 297, - "end": 301, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 301, - "end": 304, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 303, - "end": 304, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 254, - "end": 320, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 289, - "end": 292, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 306, - "end": 319, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 308, - "end": 319, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 308, - "end": 311, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 312, - "end": 319, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 340, - "end": 343, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 370, - "end": 376, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 370, - "end": 376, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 373, - "end": 376, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 375, - "end": 376, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 375, - "end": 376, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 331, - "end": 445, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 378, - "end": 445, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 384, - "end": 442, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 388, - "end": 441, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 388, - "end": 390, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 393, - "end": 441, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 412, - "ctxt": 0 - }, - "value": "ComponentSpecific1", - "optional": false - }, - "span": { - "start": 393, - "end": 441, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 414, - "end": 417, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 417, - "end": 420, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 422, - "end": 438, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 433, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 434, - "end": 438, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 435, - "end": 437, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 343, - "end": 369, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 344, - "end": 368, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 344, - "end": 345, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 354, - "end": 368, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 355, - "end": 367, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 355, - "end": 359, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 359, - "end": 367, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 361, - "end": 367, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 465, - "end": 468, - "ctxt": 0 - }, - "value": "Baz", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 472, - "end": 478, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 472, - "end": 478, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 475, - "end": 478, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 456, - "end": 528, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 480, - "end": 528, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 486, - "end": 526, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 490, - "end": 526, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 490, - "end": 492, - "ctxt": 0 - }, - "value": "a0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 495, - "end": 526, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 496, - "end": 514, - "ctxt": 0 - }, - "value": "ComponentSpecific1", - "optional": false - }, - "span": { - "start": 495, - "end": 526, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 516, - "end": 519, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 519, - "end": 522, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 468, - "end": 471, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 469, - "end": 470, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 469, - "end": 470, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 547, - "end": 551, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 555, - "end": 580, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 555, - "end": 580, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 556, - "end": 580, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 558, - "end": 580, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 559, - "end": 579, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 559, - "end": 563, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 563, - "end": 579, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 565, - "end": 579, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 566, - "end": 572, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 569, - "end": 572, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 571, - "end": 572, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 571, - "end": 572, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 573, - "end": 579, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 575, - "end": 579, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 530, - "end": 595, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 551, - "end": 554, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 552, - "end": 553, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 552, - "end": 553, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 581, - "end": 594, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 583, - "end": 594, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 583, - "end": 586, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 587, - "end": 594, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 615, - "end": 625, - "ctxt": 0 - }, - "value": "createLink", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 626, - "end": 660, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 626, - "end": 660, - "ctxt": 0 - }, - "value": "func", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 630, - "end": 660, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 632, - "end": 660, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 633, - "end": 642, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 634, - "end": 642, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 636, - "end": 642, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 644, - "end": 653, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 645, - "end": 653, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 647, - "end": 653, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 654, - "end": 660, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 656, - "end": 660, - "ctxt": 0 - }, - "kind": "void" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 606, - "end": 698, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 662, - "end": 698, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 668, - "end": 696, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 672, - "end": 696, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 672, - "end": 673, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 676, - "end": 696, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 677, - "end": 681, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "span": { - "start": 676, - "end": 696, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 682, - "end": 693, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 682, - "end": 686, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 687, - "end": 693, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 688, - "end": 692, - "ctxt": 0 - }, - "value": "func", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 700, - "end": 798, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 710, - "end": 724, - "ctxt": 0 - }, - "value": "InferParamProp", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 724, - "end": 727, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 728, - "end": 798, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 734, - "end": 751, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 734, - "end": 740, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 740, - "end": 750, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 742, - "end": 750, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 742, - "end": 747, - "ctxt": 0 - }, - "value": "Array", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 747, - "end": 750, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 748, - "end": 749, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 756, - "end": 796, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 756, - "end": 769, - "ctxt": 0 - }, - "value": "selectHandler", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 769, - "end": 795, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 771, - "end": 795, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 772, - "end": 786, - "ctxt": 0 - }, - "value": "selectedVal", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 783, - "end": 786, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 785, - "end": 786, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 785, - "end": 786, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 788, - "end": 795, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 791, - "end": 795, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 817, - "end": 836, - "ctxt": 0 - }, - "value": "InferParamComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 840, - "end": 863, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 840, - "end": 863, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 844, - "end": 863, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 846, - "end": 863, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 846, - "end": 860, - "ctxt": 0 - }, - "value": "InferParamProp", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 860, - "end": 863, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 861, - "end": 862, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 861, - "end": 862, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 800, - "end": 878, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 836, - "end": 839, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 837, - "end": 838, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 837, - "end": 838, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 864, - "end": 877, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 866, - "end": 877, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 866, - "end": 869, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 870, - "end": 877, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 889, - "end": 980, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 893, - "end": 979, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 893, - "end": 894, - "ctxt": 0 - }, - "value": "i", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 897, - "end": 979, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 898, - "end": 917, - "ctxt": 0 - }, - "value": "InferParamComponent", - "optional": false - }, - "span": { - "start": 897, - "end": 979, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 918, - "end": 939, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 918, - "end": 924, - "ctxt": 0 - }, - "value": "values", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 925, - "end": 939, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 926, - "end": 938, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 927, - "end": 928, - "ctxt": 0 - }, - "value": 1.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 930, - "end": 931, - "ctxt": 0 - }, - "value": 2.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 933, - "end": 934, - "ctxt": 0 - }, - "value": 3.0 - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 936, - "end": 937, - "ctxt": 0 - }, - "value": 4.0 - } - } - ] - } - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 940, - "end": 976, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 940, - "end": 953, - "ctxt": 0 - }, - "value": "selectHandler", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 954, - "end": 976, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 955, - "end": 975, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 956, - "end": 967, - "ctxt": 0 - }, - "value": "val", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 959, - "end": 967, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 961, - "end": 967, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 972, - "end": 975, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments3.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments3.json deleted file mode 100644 index 44f5787449d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments3.json +++ /dev/null @@ -1,2599 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 1200, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 198, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 164, - "end": 217, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 203, - "end": 216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 205, - "end": 216, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 205, - "end": 208, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 209, - "end": 216, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 252, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 256, - "end": 304, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 256, - "end": 304, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 260, - "end": 304, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 262, - "end": 304, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 269, - "end": 280, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 271, - "end": 279, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 273, - "end": 279, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 281, - "end": 303, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 281, - "end": 294, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 294, - "end": 303, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 296, - "end": 303, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 218, - "end": 319, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 252, - "end": 255, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 305, - "end": 318, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 307, - "end": 318, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 307, - "end": 310, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 311, - "end": 318, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 337, - "end": 354, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 361, - "end": 379, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 361, - "end": 379, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 365, - "end": 379, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 367, - "end": 379, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 368, - "end": 373, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 368, - "end": 369, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 369, - "end": 372, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 371, - "end": 372, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 371, - "end": 372, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 374, - "end": 378, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 374, - "end": 375, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 375, - "end": 378, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 377, - "end": 378, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 377, - "end": 378, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 320, - "end": 394, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 354, - "end": 360, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 355, - "end": 356, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 355, - "end": 356, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 358, - "end": 359, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 380, - "end": 393, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 382, - "end": 393, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 382, - "end": 385, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 386, - "end": 393, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 411, - "end": 414, - "ctxt": 0 - }, - "value": "Baz", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 472, - "end": 479, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 472, - "end": 479, - "ctxt": 0 - }, - "value": "arg1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 481, - "end": 488, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 481, - "end": 488, - "ctxt": 0 - }, - "value": "arg2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 485, - "end": 488, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 487, - "end": 488, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 402, - "end": 916, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 490, - "end": 916, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 496, - "end": 559, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 500, - "end": 558, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 500, - "end": 502, - "ctxt": 0 - }, - "value": "a0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 505, - "end": 558, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 506, - "end": 523, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 505, - "end": 558, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 525, - "end": 528, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 528, - "end": 532, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 534, - "end": 543, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 534, - "end": 535, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 536, - "end": 543, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 544, - "end": 555, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 544, - "end": 555, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 564, - "end": 630, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 568, - "end": 629, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 568, - "end": 570, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 573, - "end": 629, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 574, - "end": 591, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 573, - "end": 629, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 593, - "end": 596, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 596, - "end": 600, - "ctxt": 0 - }, - "value": "arg2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 602, - "end": 626, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 602, - "end": 612, - "ctxt": 0 - }, - "value": "ignore-pro", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 613, - "end": 626, - "ctxt": 0 - }, - "value": "hello world", - "raw": "\"hello world\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 635, - "end": 676, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 639, - "end": 675, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 639, - "end": 641, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 644, - "end": 675, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 645, - "end": 662, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 644, - "end": 675, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 664, - "end": 667, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 667, - "end": 671, - "ctxt": 0 - }, - "value": "arg2", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 681, - "end": 734, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 685, - "end": 733, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 685, - "end": 687, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 690, - "end": 733, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 691, - "end": 708, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 690, - "end": 733, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 710, - "end": 713, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 713, - "end": 717, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 719, - "end": 730, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 719, - "end": 730, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 739, - "end": 770, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 743, - "end": 769, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 743, - "end": 745, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 748, - "end": 769, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 749, - "end": 766, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 748, - "end": 769, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 775, - "end": 846, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 779, - "end": 845, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 779, - "end": 781, - "ctxt": 0 - }, - "value": "a5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 784, - "end": 845, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 785, - "end": 802, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 784, - "end": 845, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 804, - "end": 807, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 807, - "end": 811, - "ctxt": 0 - }, - "value": "arg2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 813, - "end": 832, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 813, - "end": 824, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 825, - "end": 832, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - }, - { - "type": "SpreadElement", - "spread": { - "start": 834, - "end": 837, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 837, - "end": 841, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 851, - "end": 914, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 855, - "end": 913, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 855, - "end": 857, - "ctxt": 0 - }, - "value": "a6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 860, - "end": 913, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 861, - "end": 878, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 860, - "end": 913, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 880, - "end": 883, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 883, - "end": 887, - "ctxt": 0 - }, - "value": "arg2", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 889, - "end": 900, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 889, - "end": 900, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": null - }, - { - "type": "SpreadElement", - "spread": { - "start": 902, - "end": 905, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 905, - "end": 909, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 414, - "end": 471, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 415, - "end": 436, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 415, - "end": 416, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 425, - "end": 436, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 426, - "end": 435, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 426, - "end": 427, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 427, - "end": 435, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 429, - "end": 435, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 438, - "end": 470, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 438, - "end": 439, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 448, - "end": 470, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 449, - "end": 460, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 449, - "end": 450, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 450, - "end": 459, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 452, - "end": 459, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 461, - "end": 469, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 461, - "end": 462, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 462, - "end": 469, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 463, - "end": 469, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 935, - "end": 939, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 943, - "end": 968, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 943, - "end": 968, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 944, - "end": 968, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 946, - "end": 968, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 947, - "end": 967, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 947, - "end": 951, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 951, - "end": 967, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 953, - "end": 967, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 954, - "end": 960, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 957, - "end": 960, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 959, - "end": 960, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 959, - "end": 960, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 961, - "end": 967, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 963, - "end": 967, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 918, - "end": 983, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 939, - "end": 942, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 940, - "end": 941, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 940, - "end": 941, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 969, - "end": 982, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 971, - "end": 982, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 971, - "end": 974, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 975, - "end": 982, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1001, - "end": 1005, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1009, - "end": 1048, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1009, - "end": 1048, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1010, - "end": 1048, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1012, - "end": 1048, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1013, - "end": 1047, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1013, - "end": 1017, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1017, - "end": 1047, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 1019, - "end": 1047, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1020, - "end": 1026, - "ctxt": 0 - }, - "value": "arg1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1024, - "end": 1026, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1025, - "end": 1026, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1025, - "end": 1026, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "Identifier", - "span": { - "start": 1028, - "end": 1040, - "ctxt": 0 - }, - "value": "arg2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1032, - "end": 1040, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1034, - "end": 1040, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1041, - "end": 1047, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1043, - "end": 1047, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 984, - "end": 1063, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1005, - "end": 1008, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1006, - "end": 1007, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1006, - "end": 1007, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 1049, - "end": 1062, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1051, - "end": 1062, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 1051, - "end": 1054, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1062, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1073, - "end": 1083, - "ctxt": 0 - }, - "value": "createLink", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1084, - "end": 1107, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1084, - "end": 1107, - "ctxt": 0 - }, - "value": "func", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1088, - "end": 1107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 1090, - "end": 1107, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1100, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1092, - "end": 1100, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1094, - "end": 1100, - "ctxt": 0 - }, - "kind": "number" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1101, - "end": 1107, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1103, - "end": 1107, - "ctxt": 0 - }, - "kind": "void" - } - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1064, - "end": 1200, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1109, - "end": 1200, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 1115, - "end": 1143, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1119, - "end": 1143, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1120, - "ctxt": 0 - }, - "value": "o", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1123, - "end": 1143, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1124, - "end": 1128, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "span": { - "start": 1123, - "end": 1143, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1129, - "end": 1140, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1129, - "end": 1133, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1134, - "end": 1140, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1135, - "end": 1139, - "ctxt": 0 - }, - "value": "func", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1148, - "end": 1198, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1152, - "end": 1197, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1152, - "end": 1154, - "ctxt": 0 - }, - "value": "o1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 1157, - "end": 1197, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 1158, - "end": 1162, - "ctxt": 0 - }, - "value": "Link", - "optional": false - }, - "span": { - "start": 1157, - "end": 1197, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 1163, - "end": 1194, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1163, - "end": 1167, - "ctxt": 0 - }, - "value": "func", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 1168, - "end": 1194, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1169, - "end": 1193, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1170, - "end": 1178, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1171, - "end": 1178, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1172, - "end": 1178, - "ctxt": 0 - }, - "kind": "number" - } - } - }, - { - "type": "Identifier", - "span": { - "start": 1180, - "end": 1188, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1181, - "end": 1188, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1182, - "end": 1188, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 1191, - "end": 1193, - "ctxt": 0 - }, - "stmts": [] - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments4.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments4.json deleted file mode 100644 index 5357bfcbabc..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments4.json +++ /dev/null @@ -1,1212 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 611, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 198, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [], - "decorators": [], - "span": { - "start": 164, - "end": 217, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 198, - "end": 201, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 199, - "end": 200, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 203, - "end": 216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 205, - "end": 216, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 205, - "end": 208, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 209, - "end": 216, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 235, - "end": 252, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 256, - "end": 303, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 256, - "end": 303, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 260, - "end": 303, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 262, - "end": 303, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 263, - "end": 264, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 264, - "end": 267, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 266, - "end": 267, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 269, - "end": 279, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 269, - "end": 270, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 270, - "end": 278, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 272, - "end": 278, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 280, - "end": 302, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 280, - "end": 293, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 293, - "end": 302, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 295, - "end": 302, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 218, - "end": 318, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 252, - "end": 255, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 253, - "end": 254, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 304, - "end": 317, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 306, - "end": 317, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 306, - "end": 309, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 310, - "end": 317, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 336, - "end": 353, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 360, - "end": 378, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 360, - "end": 378, - "ctxt": 0 - }, - "value": "attr", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 364, - "end": 378, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 366, - "end": 378, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 367, - "end": 372, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 367, - "end": 368, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 368, - "end": 371, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 373, - "end": 377, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 373, - "end": 374, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 374, - "end": 377, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 376, - "end": 377, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 319, - "end": 393, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 353, - "end": 359, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 354, - "end": 355, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 357, - "end": 358, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 379, - "end": 392, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 381, - "end": 392, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 381, - "end": 384, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 385, - "end": 392, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 413, - "end": 416, - "ctxt": 0 - }, - "value": "Baz", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 474, - "end": 481, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 474, - "end": 481, - "ctxt": 0 - }, - "value": "arg1", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 478, - "end": 481, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 480, - "end": 481, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 480, - "end": 481, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 483, - "end": 490, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 483, - "end": 490, - "ctxt": 0 - }, - "value": "arg2", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 487, - "end": 490, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 404, - "end": 611, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 492, - "end": 611, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 498, - "end": 538, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 502, - "end": 538, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 502, - "end": 504, - "ctxt": 0 - }, - "value": "a0", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 507, - "end": 538, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 508, - "end": 525, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 507, - "end": 538, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 526, - "end": 536, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 526, - "end": 527, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 528, - "end": 536, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 529, - "end": 535, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 529, - "end": 533, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 534, - "end": 535, - "ctxt": 0 - }, - "value": "b", - "optional": false - } - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 543, - "end": 595, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 547, - "end": 595, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 547, - "end": 549, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 552, - "end": 595, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 553, - "end": 570, - "ctxt": 0 - }, - "value": "OverloadComponent", - "optional": false - }, - "span": { - "start": 552, - "end": 595, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 572, - "end": 575, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 575, - "end": 579, - "ctxt": 0 - }, - "value": "arg1", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 581, - "end": 592, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 581, - "end": 592, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 416, - "end": 473, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 417, - "end": 438, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 417, - "end": 418, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 427, - "end": 438, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 428, - "end": 437, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 428, - "end": 429, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 429, - "end": 437, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 431, - "end": 437, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 440, - "end": 472, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 440, - "end": 441, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 450, - "end": 472, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 451, - "end": 462, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 452, - "end": 461, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 454, - "end": 461, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 463, - "end": 471, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 463, - "end": 464, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 464, - "end": 471, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 465, - "end": 471, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.json b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.json deleted file mode 100644 index 0682918802c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.json +++ /dev/null @@ -1,1560 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 131, - "end": 883, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 131, - "end": 162, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 138, - "end": 143, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 146, - "end": 162, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 154, - "end": 161, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 181, - "end": 190, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 194, - "end": 198, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 194, - "end": 198, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 164, - "end": 213, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 190, - "end": 193, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 191, - "end": 192, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 199, - "end": 212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 201, - "end": 212, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 201, - "end": 204, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 205, - "end": 212, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 223, - "end": 238, - "ctxt": 0 - }, - "value": "createComponent", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 267, - "end": 273, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 270, - "end": 273, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 272, - "end": 273, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 214, - "end": 358, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 275, - "end": 358, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 281, - "end": 313, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 285, - "end": 312, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 285, - "end": 287, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 290, - "end": 312, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 291, - "end": 300, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 290, - "end": 312, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 302, - "end": 305, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 305, - "end": 308, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 318, - "end": 356, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 322, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 322, - "end": 324, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 327, - "end": 355, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 328, - "end": 337, - "ctxt": 0 - }, - "value": "Component", - "optional": false - }, - "span": { - "start": 327, - "end": 355, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 339, - "end": 342, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 342, - "end": 345, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 347, - "end": 352, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 347, - "end": 352, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 238, - "end": 266, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 239, - "end": 265, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 239, - "end": 240, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 249, - "end": 265, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 251, - "end": 263, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 251, - "end": 255, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 255, - "end": 263, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 257, - "end": 263, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 377, - "end": 394, - "ctxt": 0 - }, - "value": "ComponentSpecific", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 398, - "end": 412, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 398, - "end": 412, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 399, - "end": 412, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 401, - "end": 412, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 403, - "end": 410, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 403, - "end": 407, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 407, - "end": 410, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 409, - "end": 410, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 409, - "end": 410, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 360, - "end": 427, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 395, - "end": 396, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 413, - "end": 426, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 415, - "end": 426, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 415, - "end": 418, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 419, - "end": 426, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 445, - "end": 463, - "ctxt": 0 - }, - "value": "ComponentSpecific1", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 467, - "end": 504, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 467, - "end": 504, - "ctxt": 0 - }, - "value": "l", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 468, - "end": 504, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 470, - "end": 504, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 472, - "end": 480, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 472, - "end": 476, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 476, - "end": 479, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 481, - "end": 502, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "StringLiteral", - "span": { - "start": 481, - "end": 494, - "ctxt": 0 - }, - "value": "ignore-prop", - "raw": "\"ignore-prop\"" - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 494, - "end": 502, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 496, - "end": 502, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 428, - "end": 519, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 463, - "end": 466, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 464, - "end": 465, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 505, - "end": 518, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 507, - "end": 518, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 507, - "end": 510, - "ctxt": 0 - }, - "value": "JSX", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 511, - "end": 518, - "ctxt": 0 - }, - "value": "Element", - "optional": false - } - }, - "typeParams": null - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 530, - "end": 533, - "ctxt": 0 - }, - "value": "Bar", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 562, - "end": 568, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 562, - "end": 568, - "ctxt": 0 - }, - "value": "arg", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 565, - "end": 568, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 567, - "end": 568, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 567, - "end": 568, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 521, - "end": 883, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 570, - "end": 883, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 576, - "end": 633, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 580, - "end": 632, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 580, - "end": 582, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 585, - "end": 632, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 586, - "end": 603, - "ctxt": 0 - }, - "value": "ComponentSpecific", - "optional": false - }, - "span": { - "start": 585, - "end": 632, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 605, - "end": 608, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 608, - "end": 611, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 613, - "end": 629, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 613, - "end": 624, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 625, - "end": 629, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 654, - "end": 712, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 658, - "end": 711, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 658, - "end": 660, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 663, - "end": 711, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 664, - "end": 682, - "ctxt": 0 - }, - "value": "ComponentSpecific1", - "optional": false - }, - "span": { - "start": 663, - "end": 711, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 684, - "end": 687, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 687, - "end": 690, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 692, - "end": 708, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 692, - "end": 703, - "ctxt": 0 - }, - "value": "ignore-prop", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 704, - "end": 708, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 705, - "end": 707, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 733, - "end": 786, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 737, - "end": 785, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 737, - "end": 739, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 742, - "end": 785, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 743, - "end": 760, - "ctxt": 0 - }, - "value": "ComponentSpecific", - "optional": false - }, - "span": { - "start": 742, - "end": 785, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 762, - "end": 765, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 765, - "end": 768, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 770, - "end": 782, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 770, - "end": 774, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 775, - "end": 782, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 809, - "end": 863, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 813, - "end": 862, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 813, - "end": 815, - "ctxt": 0 - }, - "value": "a4", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 818, - "end": 862, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 819, - "end": 836, - "ctxt": 0 - }, - "value": "ComponentSpecific", - "optional": false - }, - "span": { - "start": 818, - "end": 862, - "ctxt": 0 - }, - "attributes": [ - { - "type": "SpreadElement", - "spread": { - "start": 838, - "end": 841, - "ctxt": 0 - }, - "arguments": { - "type": "Identifier", - "span": { - "start": 841, - "end": 844, - "ctxt": 0 - }, - "value": "arg", - "optional": false - } - }, - { - "type": "JSXAttribute", - "span": { - "start": 846, - "end": 859, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 846, - "end": 851, - "ctxt": 0 - }, - "value": "prop1", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 852, - "end": 859, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 533, - "end": 561, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 534, - "end": 560, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 534, - "end": 535, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "constraint": { - "type": "TsTypeLiteral", - "span": { - "start": 544, - "end": 560, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 546, - "end": 558, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 546, - "end": 550, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 550, - "end": 558, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 552, - "end": 558, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - "default": null - } - ] - }, - "returnType": null - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.tsx b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.tsx index a3beabf97a4..8a7fb5cb947 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxStatelessFunctionComponentsWithTypeArguments5.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: preserve // @module: amd // @noLib: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxTypeArgumentResolution.tsx b/crates/swc_ecma_parser/tests/tsc/tsxTypeArgumentResolution.tsx deleted file mode 100644 index 2a644a33f8e..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxTypeArgumentResolution.tsx +++ /dev/null @@ -1,59 +0,0 @@ -// @filename: file.tsx -// @jsx: preserve -// @noLib: true -// @skipLibCheck: true -// @libFiles: react.d.ts,lib.d.ts - -import React = require('react'); - -interface Prop { - a: number, - b: string -} - -declare class MyComp

extends React.Component { - internalProp: P; -} - -let x = a={10} b="hi" />; // OK - -x = a={10} b="hi">; // OK - -x = a={10} b={20} />; // error - -x = a={10} b={20}>; // error - -x = a={10} b="hi" />; // error - -x = a={10} b="hi">; // error - -x = a={10} b="hi" />; // error - -x = a={10} b="hi">; // error - -x= /> // OK - -x= > // OK - -declare class MyComp2

extends React.Component

{ - internalProp: [P, P2]; -} -x = a="a" b="b" />; // OK - -x = a="a" b="b">; // OK - -x = a={10} b="hi" />; // error - -x = a={10} b="hi">; // error - -x = a="hi" b="hi" />; // OK - -x = a="hi" b="hi">; // OK - -x = a="hi" b="hi" />; // error - -x = a="hi" b="hi">; // error - -x = a="hi" b="hi" />; // error - -x = a="hi" b="hi">; // error diff --git a/crates/swc_ecma_parser/tests/tsc/tsxTypeErrors.json b/crates/swc_ecma_parser/tests/tsc/tsxTypeErrors.json deleted file mode 100644 index 0a7f194eede..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxTypeErrors.json +++ /dev/null @@ -1,974 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 45, - "end": 846, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 45, - "end": 71, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 49, - "end": 70, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 49, - "end": 51, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 54, - "end": 70, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 55, - "end": 58, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 54, - "end": 70, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 59, - "end": 67, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 59, - "end": 61, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 62, - "end": 67, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 128, - "end": 159, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 132, - "end": 159, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 132, - "end": 134, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 137, - "end": 159, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 138, - "end": 141, - "ctxt": 0 - }, - "value": "img", - "optional": false - }, - "span": { - "start": 137, - "end": 159, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 142, - "end": 156, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 142, - "end": 146, - "ctxt": 0 - }, - "value": "srce", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 147, - "end": 156, - "ctxt": 0 - }, - "value": "foo.jpg", - "raw": "\"foo.jpg\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 226, - "end": 252, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 230, - "end": 251, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 230, - "end": 235, - "ctxt": 0 - }, - "value": "thing", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 238, - "end": 251, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 240, - "end": 244, - "ctxt": 0 - }, - "value": "oops", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 246, - "end": 249, - "ctxt": 0 - }, - "value": 100.0 - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 253, - "end": 280, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 257, - "end": 280, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 257, - "end": 259, - "ctxt": 0 - }, - "value": "a3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 262, - "end": 280, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 262, - "end": 280, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 267, - "end": 277, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 267, - "end": 269, - "ctxt": 0 - }, - "value": "id", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 270, - "end": 277, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 271, - "end": 276, - "ctxt": 0 - }, - "value": "thing", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 312, - "end": 343, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 316, - "end": 343, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 316, - "end": 318, - "ctxt": 0 - }, - "value": "e1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 321, - "end": 343, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 322, - "end": 326, - "ctxt": 0 - }, - "value": "imag", - "optional": false - }, - "span": { - "start": 321, - "end": 343, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 327, - "end": 340, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 327, - "end": 330, - "ctxt": 0 - }, - "value": "src", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 331, - "end": 340, - "ctxt": 0 - }, - "value": "bar.jpg", - "raw": "\"bar.jpg\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 368, - "end": 375, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "declare": false, - "span": { - "start": 362, - "end": 462, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 380, - "end": 460, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 380, - "end": 385, - "ctxt": 0 - }, - "value": "props", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 385, - "end": 460, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 387, - "end": 460, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 393, - "end": 424, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 393, - "end": 395, - "ctxt": 0 - }, - "value": "pt", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 396, - "end": 423, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 398, - "end": 423, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 400, - "end": 410, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 400, - "end": 401, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 401, - "end": 409, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 403, - "end": 409, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 411, - "end": 421, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 411, - "end": 412, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 412, - "end": 420, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 414, - "end": 420, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 426, - "end": 440, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 426, - "end": 430, - "ctxt": 0 - }, - "value": "name", - "optional": false - }, - "computed": false, - "optional": true, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 431, - "end": 439, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 433, - "end": 439, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 442, - "end": 456, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 442, - "end": 446, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 446, - "end": 455, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 448, - "end": 455, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 513, - "end": 546, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 517, - "end": 545, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 517, - "end": 519, - "ctxt": 0 - }, - "value": "b1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 522, - "end": 545, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 523, - "end": 530, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 522, - "end": 545, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 531, - "end": 542, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 531, - "end": 535, - "ctxt": 0 - }, - "value": "reqd", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 536, - "end": 542, - "ctxt": 0 - }, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 537, - "end": 541, - "ctxt": 0 - }, - "value": true - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 802, - "end": 846, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 806, - "end": 845, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 806, - "end": 808, - "ctxt": 0 - }, - "value": "b2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 811, - "end": 845, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 812, - "end": 819, - "ctxt": 0 - }, - "value": "MyClass", - "optional": false - }, - "span": { - "start": 811, - "end": 845, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 820, - "end": 842, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 820, - "end": 822, - "ctxt": 0 - }, - "value": "pt", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 823, - "end": 842, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 824, - "end": 841, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 825, - "end": 826, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 828, - "end": 829, - "ctxt": 0 - }, - "value": 4.0 - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 831, - "end": 832, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 834, - "end": 840, - "ctxt": 0 - }, - "value": "oops", - "raw": "'oops'" - } - } - ] - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.json deleted file mode 100644 index 144e0f53310..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 326, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 159, - "ctxt": 0 - }, - "value": "SFC1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 166, - "end": 179, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 177, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 171, - "end": 177, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 146, - "end": 213, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 181, - "end": 213, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 187, - "end": 211, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 194, - "end": 210, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 194, - "end": 199, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 199, - "end": 204, - "ctxt": 0 - }, - "value": "hello", - "raw": "hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "EmptyStatement", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 225, - "end": 229, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 230, - "end": 250, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 230, - "end": 250, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 234, - "end": 250, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 236, - "end": 250, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 238, - "end": 248, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 238, - "end": 239, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 248, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 241, - "end": 248, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 216, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 252, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 258, - "end": 281, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 280, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 268, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "value": "World ", - "raw": "World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 277, - "end": 279, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 285, - "end": 312, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 289, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 289, - "end": 296, - "ctxt": 0 - }, - "value": "SFCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 299, - "end": 311, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 299, - "end": 303, - "ctxt": 0 - }, - "value": "SFC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 307, - "end": 311, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 313, - "end": 326, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 313, - "end": 326, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "value": "SFCComp", - "optional": false - }, - "span": { - "start": 313, - "end": 326, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.tsx index 28691e9f449..91457469a8d 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType1.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.json deleted file mode 100644 index acb5fa00ad4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.json +++ /dev/null @@ -1,557 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 332, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 159, - "ctxt": 0 - }, - "value": "SFC1", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 160, - "end": 179, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 164, - "end": 179, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 166, - "end": 179, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 168, - "end": 177, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 168, - "end": 169, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 169, - "end": 177, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 171, - "end": 177, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 146, - "end": 213, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 181, - "end": 213, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 187, - "end": 211, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 194, - "end": 210, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 194, - "end": 199, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 199, - "end": 204, - "ctxt": 0 - }, - "value": "hello", - "raw": "hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 206, - "end": 209, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "EmptyStatement", - "span": { - "start": 213, - "end": 214, - "ctxt": 0 - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 225, - "end": 229, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 230, - "end": 250, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 230, - "end": 250, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 234, - "end": 250, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 236, - "end": 250, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 238, - "end": 248, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 238, - "end": 239, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 239, - "end": 248, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 241, - "end": 248, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 216, - "end": 283, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 252, - "end": 283, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 258, - "end": 281, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 265, - "end": 280, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 266, - "end": 268, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 269, - "end": 275, - "ctxt": 0 - }, - "value": "World ", - "raw": "World " - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 275, - "end": 280, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 277, - "end": 279, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 285, - "end": 312, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 289, - "end": 311, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 289, - "end": 296, - "ctxt": 0 - }, - "value": "SFCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 299, - "end": 311, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 299, - "end": 303, - "ctxt": 0 - }, - "value": "SFC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 307, - "end": 311, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 313, - "end": 332, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 313, - "end": 332, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 314, - "end": 321, - "ctxt": 0 - }, - "value": "SFCComp", - "optional": false - }, - "span": { - "start": 313, - "end": 332, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 322, - "end": 330, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 322, - "end": 323, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 324, - "end": 330, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 325, - "end": 329, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.tsx index c85a87472e1..ae0c0843b81 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType2.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.json deleted file mode 100644 index 8b224f39e1a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.json +++ /dev/null @@ -1,1341 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 799, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "declare": false, - "span": { - "start": 146, - "end": 243, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 213, - "end": 241, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 223, - "end": 235, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 164, - "end": 179, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 164, - "end": 169, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 179, - "end": 197, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 180, - "end": 192, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 181, - "end": 191, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 183, - "end": 191, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 185, - "end": 191, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "value": "RC2", - "optional": false - }, - "declare": false, - "span": { - "start": 245, - "end": 368, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 304, - "end": 341, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 304, - "end": 341, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 313, - "end": 341, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 323, - "end": 335, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 330, - "end": 334, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 346, - "end": 366, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 354, - "end": 360, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 346, - "end": 366, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 263, - "end": 278, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 278, - "end": 297, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 279, - "end": 292, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 281, - "end": 290, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 282, - "end": 290, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 284, - "end": 290, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 294, - "end": 296, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "value": "RC3", - "optional": false - }, - "declare": false, - "span": { - "start": 370, - "end": 457, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 418, - "end": 455, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 418, - "end": 424, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 418, - "end": 455, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 427, - "end": 455, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 437, - "end": 449, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 444, - "end": 448, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 388, - "end": 403, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 394, - "end": 403, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 403, - "end": 411, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 404, - "end": 406, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 408, - "end": 410, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 465, - "end": 468, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - }, - "declare": false, - "span": { - "start": 459, - "end": 546, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 507, - "end": 544, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 507, - "end": 513, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 507, - "end": 544, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 516, - "end": 544, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 526, - "end": 538, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 533, - "end": 537, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 477, - "end": 492, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 477, - "end": 482, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 483, - "end": 492, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 492, - "end": 500, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 493, - "end": 495, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 497, - "end": 499, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 548, - "end": 577, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 552, - "end": 576, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 552, - "end": 563, - "ctxt": 0 - }, - "value": "EmptyRCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 566, - "end": 576, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 566, - "end": 569, - "ctxt": 0 - }, - "value": "RC3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 573, - "end": 576, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 578, - "end": 606, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 582, - "end": 605, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 582, - "end": 592, - "ctxt": 0 - }, - "value": "PartRCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 595, - "end": 605, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 595, - "end": 598, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 602, - "end": 605, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 607, - "end": 631, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 611, - "end": 630, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 611, - "end": 617, - "ctxt": 0 - }, - "value": "RCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 620, - "end": 630, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 620, - "end": 623, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 627, - "end": 630, - "ctxt": 0 - }, - "value": "RC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 638, - "end": 664, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 642, - "end": 663, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 646, - "end": 663, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 647, - "end": 653, - "ctxt": 0 - }, - "value": "RCComp", - "optional": false - }, - "span": { - "start": 646, - "end": 663, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 654, - "end": 660, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 654, - "end": 655, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 656, - "end": 660, - "ctxt": 0 - }, - "value": "Hi", - "raw": "\"Hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 665, - "end": 690, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 669, - "end": 689, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 669, - "end": 671, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 674, - "end": 689, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 675, - "end": 686, - "ctxt": 0 - }, - "value": "EmptyRCComp", - "optional": false - }, - "span": { - "start": 674, - "end": 689, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 691, - "end": 734, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 695, - "end": 733, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 695, - "end": 697, - "ctxt": 0 - }, - "value": "a2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 700, - "end": 733, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 701, - "end": 712, - "ctxt": 0 - }, - "value": "EmptyRCComp", - "optional": false - }, - "span": { - "start": 700, - "end": 733, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 713, - "end": 730, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 713, - "end": 722, - "ctxt": 0 - }, - "value": "data-prop", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 723, - "end": 730, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 735, - "end": 757, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 739, - "end": 757, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 739, - "end": 740, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 743, - "end": 757, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 744, - "end": 754, - "ctxt": 0 - }, - "value": "PartRCComp", - "optional": false - }, - "span": { - "start": 743, - "end": 757, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 758, - "end": 799, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 762, - "end": 799, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 762, - "end": 763, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 766, - "end": 799, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 767, - "end": 777, - "ctxt": 0 - }, - "value": "PartRCComp", - "optional": false - }, - "span": { - "start": 766, - "end": 799, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 778, - "end": 796, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 778, - "end": 788, - "ctxt": 0 - }, - "value": "data-extra", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 789, - "end": 796, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.tsx index dddaab1d105..46fea83de02 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType3.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.json deleted file mode 100644 index 4a8fb682399..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.json +++ /dev/null @@ -1,1204 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 722, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 152, - "end": 155, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "declare": false, - "span": { - "start": 146, - "end": 243, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 204, - "end": 210, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 204, - "end": 241, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 213, - "end": 241, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 223, - "end": 235, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 164, - "end": 179, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 164, - "end": 169, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 170, - "end": 179, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 179, - "end": 197, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 180, - "end": 192, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 181, - "end": 191, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 181, - "end": 182, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 183, - "end": 191, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 185, - "end": 191, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "value": "RC2", - "optional": false - }, - "declare": false, - "span": { - "start": 245, - "end": 368, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 304, - "end": 341, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 304, - "end": 310, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 304, - "end": 341, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 313, - "end": 341, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 323, - "end": 335, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 330, - "end": 334, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 346, - "end": 366, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 354, - "end": 360, - "ctxt": 0 - }, - "value": "method", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 346, - "end": 366, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 363, - "end": 366, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": "private", - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 263, - "end": 278, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 263, - "end": 268, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 269, - "end": 278, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 278, - "end": 297, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 279, - "end": 292, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 281, - "end": 290, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 281, - "end": 282, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 282, - "end": 290, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 284, - "end": 290, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 294, - "end": 296, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 376, - "end": 379, - "ctxt": 0 - }, - "value": "RC3", - "optional": false - }, - "declare": false, - "span": { - "start": 370, - "end": 457, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 418, - "end": 455, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 418, - "end": 424, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 418, - "end": 455, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 427, - "end": 455, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 437, - "end": 449, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 444, - "end": 448, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 388, - "end": 403, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 388, - "end": 393, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 394, - "end": 403, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 403, - "end": 411, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 404, - "end": 406, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 408, - "end": 410, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 465, - "end": 468, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - }, - "declare": false, - "span": { - "start": 459, - "end": 546, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 507, - "end": 544, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 507, - "end": 513, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 507, - "end": 544, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 516, - "end": 544, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 526, - "end": 538, - "ctxt": 0 - }, - "argument": { - "type": "NullLiteral", - "span": { - "start": 533, - "end": 537, - "ctxt": 0 - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 477, - "end": 492, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 477, - "end": 482, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 483, - "end": 492, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 492, - "end": 500, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 493, - "end": 495, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 497, - "end": 499, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 548, - "end": 572, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 552, - "end": 571, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 552, - "end": 558, - "ctxt": 0 - }, - "value": "RCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 561, - "end": 571, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 561, - "end": 564, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 568, - "end": 571, - "ctxt": 0 - }, - "value": "RC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 573, - "end": 602, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 577, - "end": 601, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 577, - "end": 588, - "ctxt": 0 - }, - "value": "EmptyRCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 591, - "end": 601, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 591, - "end": 594, - "ctxt": 0 - }, - "value": "RC3", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 598, - "end": 601, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 603, - "end": 631, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 607, - "end": 630, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 607, - "end": 617, - "ctxt": 0 - }, - "value": "PartRCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 620, - "end": 630, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 620, - "end": 623, - "ctxt": 0 - }, - "value": "RC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 627, - "end": 630, - "ctxt": 0 - }, - "value": "RC4", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 641, - "end": 662, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 645, - "end": 661, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 645, - "end": 646, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 649, - "end": 661, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 650, - "end": 656, - "ctxt": 0 - }, - "value": "RCComp", - "optional": false - }, - "span": { - "start": 649, - "end": 661, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 657, - "end": 658, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 657, - "end": 658, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 663, - "end": 692, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 667, - "end": 692, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 671, - "end": 692, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 672, - "end": 682, - "ctxt": 0 - }, - "value": "PartRCComp", - "optional": false - }, - "span": { - "start": 671, - "end": 692, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 683, - "end": 689, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 683, - "end": 684, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 685, - "end": 689, - "ctxt": 0 - }, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 686, - "end": 688, - "ctxt": 0 - }, - "value": 10.0 - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 693, - "end": 722, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 697, - "end": 721, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 697, - "end": 698, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 701, - "end": 721, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 702, - "end": 713, - "ctxt": 0 - }, - "value": "EmptyRCComp", - "optional": false - }, - "span": { - "start": 701, - "end": 721, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 714, - "end": 718, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 714, - "end": 718, - "ctxt": 0 - }, - "value": "prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.tsx index fbd3e04017c..7b64cca5ef6 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType4.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.json deleted file mode 100644 index acd2ae7c753..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.json +++ /dev/null @@ -1,786 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 501, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 164, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 146, - "end": 199, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 167, - "end": 199, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 173, - "end": 197, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 180, - "end": 196, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 180, - "end": 185, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 185, - "end": 190, - "ctxt": 0 - }, - "value": "hello", - "raw": "hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 190, - "end": 196, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 192, - "end": 195, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 210, - "end": 219, - "ctxt": 0 - }, - "value": "EmptySFC2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 201, - "end": 254, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 222, - "end": 254, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 228, - "end": 252, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 235, - "end": 251, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 236, - "end": 239, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 235, - "end": 240, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 240, - "end": 245, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 245, - "end": 251, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 265, - "end": 269, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 270, - "end": 290, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 270, - "end": 290, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 274, - "end": 290, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 276, - "end": 290, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 278, - "end": 288, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 278, - "end": 279, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 279, - "end": 288, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 281, - "end": 288, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 256, - "end": 322, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 292, - "end": 322, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 298, - "end": 320, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 305, - "end": 319, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 306, - "end": 308, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 305, - "end": 309, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "value": "World", - "raw": "World" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 314, - "end": 319, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 316, - "end": 318, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 324, - "end": 366, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 328, - "end": 365, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 328, - "end": 340, - "ctxt": 0 - }, - "value": "EmptySFCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 343, - "end": 365, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 343, - "end": 352, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 356, - "end": 365, - "ctxt": 0 - }, - "value": "EmptySFC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 367, - "end": 408, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 371, - "end": 407, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 371, - "end": 387, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 390, - "end": 407, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 390, - "end": 394, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 398, - "end": 407, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 410, - "end": 434, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 414, - "end": 434, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 414, - "end": 415, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 418, - "end": 434, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 419, - "end": 431, - "ctxt": 0 - }, - "value": "EmptySFCComp", - "optional": false - }, - "span": { - "start": 418, - "end": 434, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 435, - "end": 470, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 439, - "end": 470, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 439, - "end": 441, - "ctxt": 0 - }, - "value": "a1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 444, - "end": 470, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 445, - "end": 457, - "ctxt": 0 - }, - "value": "EmptySFCComp", - "optional": false - }, - "span": { - "start": 444, - "end": 470, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 458, - "end": 467, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 458, - "end": 467, - "ctxt": 0 - }, - "value": "data-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 471, - "end": 501, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 475, - "end": 501, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 475, - "end": 476, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 479, - "end": 501, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 480, - "end": 496, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false - }, - "span": { - "start": 479, - "end": 501, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 497, - "end": 498, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.tsx index 28f4fcefc20..664e9067ba0 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType5.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.json deleted file mode 100644 index 253961fb60b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.json +++ /dev/null @@ -1,878 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 547, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 164, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 146, - "end": 195, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 167, - "end": 195, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 173, - "end": 193, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 180, - "end": 193, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 181, - "end": 184, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 180, - "end": 185, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 185, - "end": 187, - "ctxt": 0 - }, - "value": "Hi", - "raw": "Hi" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 187, - "end": 193, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 189, - "end": 192, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 206, - "end": 215, - "ctxt": 0 - }, - "value": "EmptySFC2", - "optional": false - }, - "declare": false, - "params": [], - "decorators": [], - "span": { - "start": 197, - "end": 249, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 218, - "end": 249, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 224, - "end": 247, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 231, - "end": 247, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 232, - "end": 235, - "ctxt": 0 - }, - "value": "div", - "optional": false - }, - "span": { - "start": 231, - "end": 236, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 236, - "end": 241, - "ctxt": 0 - }, - "value": "Hello", - "raw": "Hello" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 241, - "end": 247, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 243, - "end": 246, - "ctxt": 0 - }, - "value": "div", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 260, - "end": 264, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 265, - "end": 285, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 265, - "end": 285, - "ctxt": 0 - }, - "value": "prop", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 269, - "end": 285, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 271, - "end": 285, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 273, - "end": 283, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 273, - "end": 274, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 274, - "end": 283, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 276, - "end": 283, - "ctxt": 0 - }, - "kind": "boolean" - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 251, - "end": 317, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 287, - "end": 317, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 293, - "end": 315, - "ctxt": 0 - }, - "argument": { - "type": "JSXElement", - "span": { - "start": 300, - "end": 314, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 301, - "end": 303, - "ctxt": 0 - }, - "value": "h1", - "optional": false - }, - "span": { - "start": 300, - "end": 304, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 304, - "end": 309, - "ctxt": 0 - }, - "value": "World", - "raw": "World" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 309, - "end": 314, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 311, - "end": 313, - "ctxt": 0 - }, - "value": "h1", - "optional": false - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 319, - "end": 361, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 323, - "end": 360, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 323, - "end": 335, - "ctxt": 0 - }, - "value": "EmptySFCComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 338, - "end": 360, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 338, - "end": 347, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 351, - "end": 360, - "ctxt": 0 - }, - "value": "EmptySFC2", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 362, - "end": 403, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 366, - "end": 402, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 366, - "end": 382, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "BinaryExpression", - "span": { - "start": 385, - "end": 402, - "ctxt": 0 - }, - "operator": "||", - "left": { - "type": "Identifier", - "span": { - "start": 385, - "end": 389, - "ctxt": 0 - }, - "value": "SFC2", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 393, - "end": 402, - "ctxt": 0 - }, - "value": "EmptySFC1", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 413, - "end": 440, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 417, - "end": 439, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 417, - "end": 418, - "ctxt": 0 - }, - "value": "a", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 421, - "end": 439, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 422, - "end": 434, - "ctxt": 0 - }, - "value": "EmptySFCComp", - "optional": false - }, - "span": { - "start": 421, - "end": 439, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 435, - "end": 436, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 441, - "end": 477, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 445, - "end": 476, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 445, - "end": 446, - "ctxt": 0 - }, - "value": "b", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 449, - "end": 476, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 450, - "end": 466, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false - }, - "span": { - "start": 449, - "end": 476, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 467, - "end": 473, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 467, - "end": 468, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 469, - "end": 473, - "ctxt": 0 - }, - "value": "hi", - "raw": "\"hi\"" - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 478, - "end": 507, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 482, - "end": 506, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 482, - "end": 483, - "ctxt": 0 - }, - "value": "c", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 486, - "end": 506, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 487, - "end": 503, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false - }, - "span": { - "start": 486, - "end": 506, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 508, - "end": 547, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 512, - "end": 546, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 512, - "end": 513, - "ctxt": 0 - }, - "value": "d", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "JSXElement", - "span": { - "start": 516, - "end": 546, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 517, - "end": 533, - "ctxt": 0 - }, - "value": "SFC2AndEmptyComp", - "optional": false - }, - "span": { - "start": 516, - "end": 546, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 534, - "end": 543, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 534, - "end": 543, - "ctxt": 0 - }, - "value": "data-prop", - "optional": false - }, - "value": null - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.tsx b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.tsx index bc4fab301b3..3cbf3dde8c8 100644 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.tsx +++ b/crates/swc_ecma_parser/tests/tsc/tsxUnionElementType6.tsx @@ -1,4 +1,4 @@ -// @filename: file.tsx +// @filename: file.tsx // @jsx: react // @noLib: true // @skipLibCheck: true diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent1.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent1.json deleted file mode 100644 index ca6676f6924..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent1.json +++ /dev/null @@ -1,780 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 648, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 146, - "end": 251, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 156, - "end": 170, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 171, - "end": 251, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 177, - "end": 249, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 177, - "end": 189, - "ctxt": 0 - }, - "value": "AnyComponent", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 189, - "end": 248, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 191, - "end": 248, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 191, - "end": 220, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 191, - "end": 196, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 197, - "end": 215, - "ctxt": 0 - }, - "value": "StatelessComponent", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 215, - "end": 220, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 216, - "end": 219, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - }, - { - "type": "TsTypeReference", - "span": { - "start": 223, - "end": 248, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 229, - "end": 243, - "ctxt": 0 - }, - "value": "ComponentClass", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 243, - "end": 248, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 244, - "end": 247, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 259, - "end": 270, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 253, - "end": 419, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 321, - "end": 417, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 321, - "end": 327, - "ctxt": 0 - }, - "value": "render", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 321, - "end": 417, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 330, - "end": 417, - "ctxt": 0 - }, - "stmts": [ - { - "type": "VariableDeclaration", - "span": { - "start": 340, - "end": 376, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 346, - "end": 375, - "ctxt": 0 - }, - "id": { - "type": "ObjectPattern", - "span": { - "start": 346, - "end": 362, - "ctxt": 0 - }, - "properties": [ - { - "type": "AssignmentPatternProperty", - "span": { - "start": 348, - "end": 360, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 348, - "end": 360, - "ctxt": 0 - }, - "value": "AnyComponent", - "optional": false - }, - "value": null - } - ], - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 365, - "end": 375, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 365, - "end": 369, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 370, - "end": 375, - "ctxt": 0 - }, - "value": "props", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "ReturnStatement", - "span": { - "start": 385, - "end": 411, - "ctxt": 0 - }, - "argument": { - "type": "ParenthesisExpression", - "span": { - "start": 392, - "end": 410, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 393, - "end": 409, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 394, - "end": 406, - "ctxt": 0 - }, - "value": "AnyComponent", - "optional": false - }, - "span": { - "start": 393, - "end": 409, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 279, - "end": 294, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 279, - "end": 284, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 285, - "end": 294, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 294, - "end": 314, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 295, - "end": 309, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 295, - "end": 309, - "ctxt": 0 - }, - "value": "ComponentProps", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 311, - "end": 313, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 453, - "end": 510, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 453, - "end": 510, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 454, - "end": 465, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 453, - "end": 510, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 466, - "end": 508, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 466, - "end": 478, - "ctxt": 0 - }, - "value": "AnyComponent", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 479, - "end": 508, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 480, - "end": 507, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "JSXElement", - "span": { - "start": 486, - "end": 507, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 487, - "end": 493, - "ctxt": 0 - }, - "value": "button", - "optional": false - }, - "span": { - "start": 486, - "end": 494, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": false, - "typeArguments": null - }, - "children": [ - { - "type": "JSXText", - "span": { - "start": 494, - "end": 498, - "ctxt": 0 - }, - "value": "test", - "raw": "test" - } - ], - "closing": { - "type": "JSXClosingElement", - "span": { - "start": 498, - "end": 507, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 500, - "end": 506, - "ctxt": 0 - }, - "value": "button", - "optional": false - } - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 546, - "end": 563, - "ctxt": 0 - }, - "value": "MyButtonComponent", - "optional": false - }, - "declare": false, - "span": { - "start": 540, - "end": 598, - "ctxt": 0 - }, - "decorators": [], - "body": [], - "superClass": { - "type": "MemberExpression", - "span": { - "start": 572, - "end": 587, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 572, - "end": 577, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 578, - "end": 587, - "ctxt": 0 - }, - "value": "Component", - "optional": false - } - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 587, - "end": 594, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeLiteral", - "span": { - "start": 588, - "end": 590, - "ctxt": 0 - }, - "members": [] - }, - { - "type": "TsTypeLiteral", - "span": { - "start": 591, - "end": 593, - "ctxt": 0 - }, - "members": [] - } - ] - }, - "implements": [] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 600, - "end": 648, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 600, - "end": 648, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 601, - "end": 612, - "ctxt": 0 - }, - "value": "MyComponent", - "optional": false - }, - "span": { - "start": 600, - "end": 648, - "ctxt": 0 - }, - "attributes": [ - { - "type": "JSXAttribute", - "span": { - "start": 613, - "end": 645, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 613, - "end": 625, - "ctxt": 0 - }, - "value": "AnyComponent", - "optional": false - }, - "value": { - "type": "JSXExpressionContainer", - "span": { - "start": 626, - "end": 645, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 627, - "end": 644, - "ctxt": 0 - }, - "value": "MyButtonComponent", - "optional": false - } - } - } - ], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent2.json b/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent2.json deleted file mode 100644 index ad906a6092d..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/tsxUnionTypeComponent2.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "type": "Module", - "span": { - "start": 112, - "end": 229, - "ctxt": 0 - }, - "body": [ - { - "type": "TsImportEqualsDeclaration", - "span": { - "start": 112, - "end": 144, - "ctxt": 0 - }, - "declare": false, - "isExport": false, - "isTypeOnly": false, - "id": { - "type": "Identifier", - "span": { - "start": 119, - "end": 124, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "moduleRef": { - "type": "TsExternalModuleReference", - "span": { - "start": 127, - "end": 143, - "ctxt": 0 - }, - "expression": { - "type": "StringLiteral", - "span": { - "start": 135, - "end": 142, - "ctxt": 0 - }, - "value": "react", - "raw": "'react'" - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 146, - "end": 197, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 151, - "end": 159, - "ctxt": 0 - }, - "value": "Invalid1", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 162, - "end": 196, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 162, - "end": 187, - "ctxt": 0 - }, - "typeName": { - "type": "TsQualifiedName", - "left": { - "type": "Identifier", - "span": { - "start": 162, - "end": 167, - "ctxt": 0 - }, - "value": "React", - "optional": false - }, - "right": { - "type": "Identifier", - "span": { - "start": 168, - "end": 182, - "ctxt": 0 - }, - "value": "ComponentClass", - "optional": false - } - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 182, - "end": 187, - "ctxt": 0 - }, - "params": [ - { - "type": "TsKeywordType", - "span": { - "start": 183, - "end": 186, - "ctxt": 0 - }, - "kind": "any" - } - ] - } - }, - { - "type": "TsKeywordType", - "span": { - "start": 190, - "end": 196, - "ctxt": 0 - }, - "kind": "number" - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 199, - "end": 221, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 205, - "end": 220, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "X", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 206, - "end": 216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 208, - "end": 216, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 208, - "end": 216, - "ctxt": 0 - }, - "value": "Invalid1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "NumericLiteral", - "span": { - "start": 219, - "end": 220, - "ctxt": 0 - }, - "value": 1.0 - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 223, - "end": 229, - "ctxt": 0 - }, - "expression": { - "type": "JSXElement", - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "opening": { - "type": "JSXOpeningElement", - "name": { - "type": "Identifier", - "span": { - "start": 224, - "end": 225, - "ctxt": 0 - }, - "value": "X", - "optional": false - }, - "span": { - "start": 223, - "end": 228, - "ctxt": 0 - }, - "attributes": [], - "selfClosing": true, - "typeArguments": null - }, - "children": [], - "closing": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.json b/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.json deleted file mode 100644 index cdf5c9905ef..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.json +++ /dev/null @@ -1,751 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 17, - "end": 388, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 23, - "end": 24, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 17, - "end": 89, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 31, - "end": 52, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 35, - "end": 36, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 31, - "end": 52, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 39, - "end": 52, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 41, - "end": 50, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 48, - "end": 49, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 57, - "end": 78, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 61, - "end": 62, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 57, - "end": 78, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 65, - "end": 78, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 67, - "end": 76, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 74, - "end": 75, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 97, - "end": 98, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 91, - "end": 147, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 105, - "end": 118, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 109, - "end": 110, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 111, - "end": 112, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 105, - "end": 118, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 114, - "end": 118, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 123, - "end": 136, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 127, - "end": 128, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 129, - "end": 130, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 123, - "end": 136, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 132, - "end": 136, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 155, - "end": 156, - "ctxt": 0 - }, - "value": "E", - "optional": false - }, - "declare": false, - "span": { - "start": 149, - "end": 215, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassMethod", - "span": { - "start": 163, - "end": 196, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 167, - "end": 168, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 163, - "end": 196, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 171, - "end": 196, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 181, - "end": 190, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 201, - "end": 213, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 201, - "end": 213, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 210, - "end": 213, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 217, - "end": 319, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 221, - "end": 319, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 221, - "end": 222, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 225, - "end": 319, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 231, - "end": 264, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 239, - "end": 264, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 249, - "end": 258, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 256, - "end": 257, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - }, - { - "type": "GetterProperty", - "span": { - "start": 284, - "end": 317, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 288, - "end": 289, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 292, - "end": 317, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 302, - "end": 311, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - } - ] - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 321, - "end": 388, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 325, - "end": 388, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 325, - "end": 326, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ObjectExpression", - "span": { - "start": 329, - "end": 388, - "ctxt": 0 - }, - "properties": [ - { - "type": "GetterProperty", - "span": { - "start": 335, - "end": 368, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 339, - "end": 340, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "typeAnnotation": null, - "body": { - "type": "BlockStatement", - "span": { - "start": 343, - "end": 368, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 353, - "end": 362, - "ctxt": 0 - }, - "argument": { - "type": "NumericLiteral", - "span": { - "start": 360, - "end": 361, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - } - }, - { - "type": "SetterProperty", - "span": { - "start": 374, - "end": 386, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 378, - "end": 379, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "param": { - "type": "Identifier", - "span": { - "start": 380, - "end": 381, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": null - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 383, - "end": 386, - "ctxt": 0 - }, - "stmts": [] - } - } - ] - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.ts b/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.ts deleted file mode 100644 index a9253f406dd..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/twoAccessorsWithSameName.ts +++ /dev/null @@ -1,35 +0,0 @@ -// @target: ES5 -class C { - get x() { return 1; } - get x() { return 1; } // error -} - -class D { - set x(v) { } - set x(v) { } // error -} - -class E { - get x() { - return 1; - } - set x(v) { } -} - -var x = { - get x() { - return 1; - }, - - // error - get x() { - return 1; - } -} - -var y = { - get x() { - return 1; - }, - set x(v) { } -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.json b/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.json new file mode 100644 index 00000000000..68df623d1a9 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.json @@ -0,0 +1,353 @@ +{ + "type": "Module", + "span": { + "start": 40, + "end": 330, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 40, + "end": 64, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 47, + "end": 64, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 53, + "end": 63, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 53, + "end": 59, + "ctxt": 0 + }, + "value": "COFFEE", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 62, + "end": 63, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 65, + "end": 86, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 72, + "end": 86, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 78, + "end": 85, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 78, + "end": 81, + "ctxt": 0 + }, + "value": "TEA", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 84, + "end": 85, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 112, + "end": 138, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 119, + "end": 138, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 124, + "end": 129, + "ctxt": 0 + }, + "value": "Drink", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 132, + "end": 137, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 132, + "end": 133, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 132, + "end": 133, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 136, + "end": 137, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 136, + "end": 137, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 139, + "end": 176, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "span": { + "start": 146, + "end": 156, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 151, + "end": 156, + "ctxt": 0 + }, + "value": "Drink", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 162, + "end": 175, + "ctxt": 0 + }, + "value": "./constants", + "raw": "\"./constants\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 202, + "end": 234, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 211, + "end": 216, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 211, + "end": 216, + "ctxt": 0 + }, + "value": "Drink", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 224, + "end": 233, + "ctxt": 0 + }, + "value": "./drink", + "raw": "\"./drink\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 303, + "end": 330, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 309, + "end": 329, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 309, + "end": 310, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 310, + "end": 317, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 312, + "end": 317, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 312, + "end": 317, + "ctxt": 0 + }, + "value": "Drink", + "optional": false + }, + "typeParams": null + } + } + }, + "init": { + "type": "MemberExpression", + "span": { + "start": 320, + "end": 329, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 320, + "end": 325, + "ctxt": 0 + }, + "value": "Drink", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 326, + "end": 329, + "ctxt": 0 + }, + "value": "TEA", + "optional": false + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.ts b/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.ts new file mode 100644 index 00000000000..a7a7d3f3e56 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeAndNamespaceExportMerge.ts @@ -0,0 +1,16 @@ +// @strict + +// @Filename: constants.ts +export const COFFEE = 0; +export const TEA = 1; + + +// @Filename: drink.ts +export type Drink = 0 | 1; +export * as Drink from "./constants"; + + +// @Filename: index.ts +import { Drink } from "./drink"; +// 'Drink' only refers to a type, but is being used as a value here +const x: Drink = Drink.TEA; diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.json b/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.json deleted file mode 100644 index 6f365070c20..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.json +++ /dev/null @@ -1,3009 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 121, - "end": 1739, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 121, - "end": 1739, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 131, - "end": 135, - "ctxt": 0 - }, - "value": "Test", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 136, - "end": 1739, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 139, - "end": 475, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 152, - "end": 168, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "declare": false, - "span": { - "start": 146, - "end": 475, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 173, - "end": 205, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 173, - "end": 178, - "ctxt": 0 - }, - "value": "isFSO", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 180, - "end": 204, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 208, - "end": 272, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 208, - "end": 272, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 235, - "end": 272, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 240, - "end": 268, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 247, - "end": 267, - "ctxt": 0 - }, - "operator": "instanceof", - "left": { - "type": "ThisExpression", - "span": { - "start": 247, - "end": 251, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 263, - "end": 267, - "ctxt": 0 - }, - "value": "File", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 220, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 222, - "end": 234, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 222, - "end": 226, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "typeParams": null - } - } - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 275, - "end": 309, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 279, - "end": 285, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 275, - "end": 309, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 293, - "end": 309, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 312, - "end": 391, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 316, - "end": 327, - "ctxt": 0 - }, - "value": "isDirectory", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 312, - "end": 391, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 349, - "end": 391, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 354, - "end": 387, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 361, - "end": 386, - "ctxt": 0 - }, - "operator": "instanceof", - "left": { - "type": "ThisExpression", - "span": { - "start": 361, - "end": 365, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 377, - "end": 386, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 329, - "end": 348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 331, - "end": 348, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 331, - "end": 335, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - }, - "typeParams": null - } - } - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 394, - "end": 434, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 394, - "end": 405, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 405, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 407, - "end": 433, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 415, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsParenthesizedType", - "span": { - "start": 415, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsIntersectionType", - "span": { - "start": 416, - "end": 432, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "value": "Networked", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsThisType", - "span": { - "start": 428, - "end": 432, - "ctxt": 0 - } - } - ] - } - } - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 437, - "end": 472, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 437, - "end": 448, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 449, - "end": 468, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 456, - "end": 468, - "ctxt": 0 - }, - "value": "path", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 460, - "end": 468, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 462, - "end": 468, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 470, - "end": 472, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 478, - "end": 594, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 491, - "end": 495, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "declare": false, - "span": { - "start": 485, - "end": 594, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 525, - "end": 591, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 525, - "end": 536, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 537, - "end": 549, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 537, - "end": 549, - "ctxt": 0 - }, - "value": "path", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 541, - "end": 549, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 543, - "end": 549, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "TsParameterProperty", - "span": { - "start": 551, - "end": 573, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 558, - "end": 573, - "ctxt": 0 - }, - "value": "content", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 565, - "end": 573, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 567, - "end": 573, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 575, - "end": 591, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 577, - "end": 589, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 577, - "end": 588, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 577, - "end": 582, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 583, - "end": 587, - "ctxt": 0 - }, - "value": "path", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 504, - "end": 520, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 596, - "end": 680, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 609, - "end": 618, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - }, - "declare": false, - "span": { - "start": 603, - "end": 680, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 648, - "end": 677, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 648, - "end": 656, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 656, - "end": 676, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 658, - "end": 676, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 658, - "end": 674, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 658, - "end": 674, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 627, - "end": 643, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 682, - "end": 729, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 689, - "end": 729, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 699, - "end": 708, - "ctxt": 0 - }, - "value": "Networked", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 709, - "end": 729, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 713, - "end": 726, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 713, - "end": 717, - "ctxt": 0 - }, - "value": "host", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 717, - "end": 725, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 719, - "end": 725, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 732, - "end": 792, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 736, - "end": 791, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 736, - "end": 740, - "ctxt": 0 - }, - "value": "file", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 740, - "end": 758, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 742, - "end": 758, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 742, - "end": 758, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "NewExpression", - "span": { - "start": 761, - "end": 791, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 765, - "end": 769, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 770, - "end": 783, - "ctxt": 0 - }, - "value": "foo/bar.txt", - "raw": "\"foo/bar.txt\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 785, - "end": 790, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 794, - "end": 819, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 794, - "end": 818, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 794, - "end": 810, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 794, - "end": 798, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 799, - "end": 810, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 813, - "end": 818, - "ctxt": 0 - }, - "value": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 821, - "end": 846, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 821, - "end": 845, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 821, - "end": 831, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 821, - "end": 825, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 826, - "end": 831, - "ctxt": 0 - }, - "value": "isFSO", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 834, - "end": 845, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 834, - "end": 838, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 839, - "end": 845, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 848, - "end": 867, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 848, - "end": 866, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 848, - "end": 859, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 848, - "end": 852, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 853, - "end": 859, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - }, - "right": { - "type": "BooleanLiteral", - "span": { - "start": 862, - "end": 866, - "ctxt": 0 - }, - "value": true - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 869, - "end": 889, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 873, - "end": 888, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 873, - "end": 874, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "MemberExpression", - "span": { - "start": 877, - "end": 888, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 877, - "end": 881, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 882, - "end": 888, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - }, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 891, - "end": 1085, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 895, - "end": 906, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 895, - "end": 899, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 900, - "end": 906, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 908, - "end": 989, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 912, - "end": 925, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 912, - "end": 924, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 912, - "end": 916, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 917, - "end": 924, - "ctxt": 0 - }, - "value": "content", - "optional": false - } - } - }, - { - "type": "IfStatement", - "span": { - "start": 928, - "end": 986, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 932, - "end": 948, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 932, - "end": 936, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 937, - "end": 948, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 950, - "end": 986, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 955, - "end": 965, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 955, - "end": 964, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 955, - "end": 959, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 960, - "end": 964, - "ctxt": 0 - }, - "value": "host", - "optional": false - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 969, - "end": 982, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 969, - "end": 981, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 969, - "end": 973, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 974, - "end": 981, - "ctxt": 0 - }, - "value": "content", - "optional": false - } - } - } - ] - }, - "alternate": null - } - ] - }, - "alternate": { - "type": "IfStatement", - "span": { - "start": 996, - "end": 1085, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 1000, - "end": 1016, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1000, - "end": 1004, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1005, - "end": 1016, - "ctxt": 0 - }, - "value": "isDirectory", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1018, - "end": 1039, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1022, - "end": 1036, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1022, - "end": 1035, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1022, - "end": 1026, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1027, - "end": 1035, - "ctxt": 0 - }, - "value": "children", - "optional": false - } - } - } - ] - }, - "alternate": { - "type": "IfStatement", - "span": { - "start": 1046, - "end": 1085, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 1050, - "end": 1066, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1050, - "end": 1054, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1055, - "end": 1066, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1068, - "end": 1085, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1072, - "end": 1082, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 1072, - "end": 1081, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1072, - "end": 1076, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1077, - "end": 1081, - "ctxt": 0 - }, - "value": "host", - "optional": false - } - } - } - ] - }, - "alternate": null - } - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1089, - "end": 1163, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1099, - "end": 1115, - "ctxt": 0 - }, - "value": "GenericLeadGuard", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1115, - "end": 1118, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1116, - "end": 1117, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1116, - "end": 1117, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1127, - "end": 1142, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1127, - "end": 1139, - "ctxt": 0 - }, - "value": "GenericGuard", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1139, - "end": 1142, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1140, - "end": 1141, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1140, - "end": 1141, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1143, - "end": 1163, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 1147, - "end": 1160, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1147, - "end": 1151, - "ctxt": 0 - }, - "value": "lead", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 1153, - "end": 1159, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1155, - "end": 1159, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1167, - "end": 1247, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1177, - "end": 1197, - "ctxt": 0 - }, - "value": "GenericFollowerGuard", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1197, - "end": 1200, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1198, - "end": 1199, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1198, - "end": 1199, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1209, - "end": 1224, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1209, - "end": 1221, - "ctxt": 0 - }, - "value": "GenericGuard", - "optional": false - }, - "typeArguments": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1221, - "end": 1224, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1222, - "end": 1223, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1222, - "end": 1223, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1225, - "end": 1247, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 1229, - "end": 1244, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1229, - "end": 1235, - "ctxt": 0 - }, - "value": "follow", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 1237, - "end": 1243, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1239, - "end": 1243, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1251, - "end": 1384, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1261, - "end": 1273, - "ctxt": 0 - }, - "value": "GenericGuard", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1273, - "end": 1276, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1274, - "end": 1275, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1275, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1277, - "end": 1384, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1281, - "end": 1291, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1281, - "end": 1287, - "ctxt": 0 - }, - "value": "target", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1287, - "end": 1290, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1289, - "end": 1290, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1289, - "end": 1290, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1294, - "end": 1334, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1294, - "end": 1302, - "ctxt": 0 - }, - "value": "isLeader", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1302, - "end": 1333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 1304, - "end": 1333, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 1304, - "end": 1308, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1312, - "end": 1333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsParenthesizedType", - "span": { - "start": 1312, - "end": 1333, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1313, - "end": 1332, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1313, - "end": 1329, - "ctxt": 0 - }, - "value": "GenericLeadGuard", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1329, - "end": 1332, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1330, - "end": 1331, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1330, - "end": 1331, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 1337, - "end": 1381, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1337, - "end": 1347, - "ctxt": 0 - }, - "value": "isFollower", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1347, - "end": 1380, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 1349, - "end": 1380, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 1349, - "end": 1353, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1357, - "end": 1380, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1357, - "end": 1380, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1357, - "end": 1377, - "ctxt": 0 - }, - "value": "GenericFollowerGuard", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1377, - "end": 1380, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1378, - "end": 1379, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1378, - "end": 1379, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1387, - "end": 1417, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1391, - "end": 1416, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1391, - "end": 1396, - "ctxt": 0 - }, - "value": "guard", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1396, - "end": 1416, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1398, - "end": 1416, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1398, - "end": 1410, - "ctxt": 0 - }, - "value": "GenericGuard", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1410, - "end": 1416, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1411, - "end": 1415, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1411, - "end": 1415, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 1419, - "end": 1510, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 1423, - "end": 1437, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1423, - "end": 1428, - "ctxt": 0 - }, - "value": "guard", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1429, - "end": 1437, - "ctxt": 0 - }, - "value": "isLeader", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1439, - "end": 1459, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1443, - "end": 1456, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1443, - "end": 1455, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1443, - "end": 1453, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1443, - "end": 1448, - "ctxt": 0 - }, - "value": "guard", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1449, - "end": 1453, - "ctxt": 0 - }, - "value": "lead", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": { - "type": "IfStatement", - "span": { - "start": 1466, - "end": 1510, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 1470, - "end": 1486, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1470, - "end": 1475, - "ctxt": 0 - }, - "value": "guard", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1476, - "end": 1486, - "ctxt": 0 - }, - "value": "isFollower", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1488, - "end": 1510, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1492, - "end": 1507, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1492, - "end": 1506, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1492, - "end": 1504, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1492, - "end": 1497, - "ctxt": 0 - }, - "value": "guard", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1498, - "end": 1504, - "ctxt": 0 - }, - "value": "follow", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": null - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1513, - "end": 1586, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1523, - "end": 1536, - "ctxt": 0 - }, - "value": "SpecificGuard", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1537, - "end": 1586, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1541, - "end": 1583, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1541, - "end": 1555, - "ctxt": 0 - }, - "value": "isMoreSpecific", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1555, - "end": 1582, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 1557, - "end": 1582, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 1557, - "end": 1561, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1565, - "end": 1582, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1565, - "end": 1582, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1565, - "end": 1582, - "ctxt": 0 - }, - "value": "MoreSpecificGuard", - "optional": false - }, - "typeParams": null - } - } - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1589, - "end": 1657, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1599, - "end": 1616, - "ctxt": 0 - }, - "value": "MoreSpecificGuard", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [ - { - "type": "TsExpressionWithTypeArguments", - "span": { - "start": 1625, - "end": 1638, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 1625, - "end": 1638, - "ctxt": 0 - }, - "value": "SpecificGuard", - "optional": false - }, - "typeArguments": null - } - ], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1639, - "end": 1657, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 1643, - "end": 1654, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1643, - "end": 1645, - "ctxt": 0 - }, - "value": "do", - "optional": false - }, - "computed": false, - "optional": false, - "params": [], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 1647, - "end": 1653, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 1649, - "end": 1653, - "ctxt": 0 - }, - "kind": "void" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1660, - "end": 1687, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1664, - "end": 1686, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1664, - "end": 1671, - "ctxt": 0 - }, - "value": "general", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1671, - "end": 1686, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1673, - "end": 1686, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1673, - "end": 1686, - "ctxt": 0 - }, - "value": "SpecificGuard", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "IfStatement", - "span": { - "start": 1689, - "end": 1737, - "ctxt": 0 - }, - "test": { - "type": "MemberExpression", - "span": { - "start": 1693, - "end": 1715, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1693, - "end": 1700, - "ctxt": 0 - }, - "value": "general", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1701, - "end": 1715, - "ctxt": 0 - }, - "value": "isMoreSpecific", - "optional": false - } - }, - "consequent": { - "type": "BlockStatement", - "span": { - "start": 1717, - "end": 1737, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 1721, - "end": 1734, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1721, - "end": 1733, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1721, - "end": 1731, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1721, - "end": 1728, - "ctxt": 0 - }, - "value": "general", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1729, - "end": 1731, - "ctxt": 0 - }, - "value": "do", - "optional": false - } - }, - "arguments": [], - "typeArguments": null - } - } - ] - }, - "alternate": null - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.ts b/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.ts deleted file mode 100644 index 86795b021f2..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMember.ts +++ /dev/null @@ -1,83 +0,0 @@ -// @target: es5 -// @declaration: true -// There's a 'File' class in the stdlib, wrap with a namespace to avoid collision -namespace Test { - export class FileSystemObject { - isFSO: this is FileSystemObject; - get isFile(): this is File { - return this instanceof File; - } - set isFile(param) { - // noop - } - get isDirectory(): this is Directory { - return this instanceof Directory; - } - isNetworked: this is (Networked & this); - constructor(public path: string) {} - } - - export class File extends FileSystemObject { - constructor(path: string, public content: string) { super(path); } - } - export class Directory extends FileSystemObject { - children: FileSystemObject[]; - } - export interface Networked { - host: string; - } - - let file: FileSystemObject = new File("foo/bar.txt", "foo"); - file.isNetworked = false; - file.isFSO = file.isFile; - file.isFile = true; - let x = file.isFile; - if (file.isFile) { - file.content; - if (file.isNetworked) { - file.host; - file.content; - } - } - else if (file.isDirectory) { - file.children; - } - else if (file.isNetworked) { - file.host; - } - - interface GenericLeadGuard extends GenericGuard { - lead(): void; - } - - interface GenericFollowerGuard extends GenericGuard { - follow(): void; - } - - interface GenericGuard { - target: T; - isLeader: this is (GenericLeadGuard); - isFollower: this is GenericFollowerGuard; - } - - let guard: GenericGuard; - if (guard.isLeader) { - guard.lead(); - } - else if (guard.isFollower) { - guard.follow(); - } - - interface SpecificGuard { - isMoreSpecific: this is MoreSpecificGuard; - } - - interface MoreSpecificGuard extends SpecificGuard { - do(): void; - } - - let general: SpecificGuard; - if (general.isMoreSpecific) { - general.do(); - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.json b/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.json deleted file mode 100644 index 57e3685cb76..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.json +++ /dev/null @@ -1,1367 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 121, - "end": 886, - "ctxt": 0 - }, - "body": [ - { - "type": "TsModuleDeclaration", - "span": { - "start": 121, - "end": 886, - "ctxt": 0 - }, - "declare": false, - "global": false, - "id": { - "type": "Identifier", - "span": { - "start": 131, - "end": 135, - "ctxt": 0 - }, - "value": "Test", - "optional": false - }, - "body": { - "type": "TsModuleBlock", - "span": { - "start": 136, - "end": 886, - "ctxt": 0 - }, - "body": [ - { - "type": "ExportDeclaration", - "span": { - "start": 139, - "end": 475, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 152, - "end": 168, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "declare": false, - "span": { - "start": 146, - "end": 475, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 173, - "end": 205, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 173, - "end": 178, - "ctxt": 0 - }, - "value": "isFSO", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 178, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 180, - "end": 204, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 188, - "end": 204, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 208, - "end": 272, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 212, - "end": 218, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 208, - "end": 272, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 235, - "end": 272, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 240, - "end": 268, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 247, - "end": 267, - "ctxt": 0 - }, - "operator": "instanceof", - "left": { - "type": "ThisExpression", - "span": { - "start": 247, - "end": 251, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 263, - "end": 267, - "ctxt": 0 - }, - "value": "File", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 220, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 222, - "end": 234, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 222, - "end": 226, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 230, - "end": 234, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "typeParams": null - } - } - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 275, - "end": 309, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 279, - "end": 285, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 286, - "end": 291, - "ctxt": 0 - }, - "value": "param", - "optional": false, - "typeAnnotation": null - } - } - ], - "decorators": [], - "span": { - "start": 275, - "end": 309, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 293, - "end": 309, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 312, - "end": 391, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 316, - "end": 327, - "ctxt": 0 - }, - "value": "isDirectory", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 312, - "end": 391, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 349, - "end": 391, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 354, - "end": 387, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 361, - "end": 386, - "ctxt": 0 - }, - "operator": "instanceof", - "left": { - "type": "ThisExpression", - "span": { - "start": 361, - "end": 365, - "ctxt": 0 - } - }, - "right": { - "type": "Identifier", - "span": { - "start": 377, - "end": 386, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 329, - "end": 348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 331, - "end": 348, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 331, - "end": 335, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 339, - "end": 348, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - }, - "typeParams": null - } - } - } - } - }, - "kind": "getter", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassProperty", - "span": { - "start": 394, - "end": 434, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 394, - "end": 405, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 405, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 407, - "end": 433, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 407, - "end": 411, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 415, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsParenthesizedType", - "span": { - "start": 415, - "end": 433, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsIntersectionType", - "span": { - "start": 416, - "end": 432, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 416, - "end": 425, - "ctxt": 0 - }, - "value": "Networked", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsThisType", - "span": { - "start": 428, - "end": 432, - "ctxt": 0 - } - } - ] - } - } - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "Constructor", - "span": { - "start": 437, - "end": 472, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 437, - "end": 448, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "TsParameterProperty", - "span": { - "start": 449, - "end": 468, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 456, - "end": 468, - "ctxt": 0 - }, - "value": "path", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 460, - "end": 468, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 462, - "end": 468, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 470, - "end": 472, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 478, - "end": 594, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 491, - "end": 495, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "declare": false, - "span": { - "start": 485, - "end": 594, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 525, - "end": 591, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 525, - "end": 536, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 537, - "end": 549, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 537, - "end": 549, - "ctxt": 0 - }, - "value": "path", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 541, - "end": 549, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 543, - "end": 549, - "ctxt": 0 - }, - "kind": "string" - } - } - } - }, - { - "type": "TsParameterProperty", - "span": { - "start": 551, - "end": 573, - "ctxt": 0 - }, - "decorators": [], - "accessibility": "public", - "override": false, - "readonly": false, - "param": { - "type": "Identifier", - "span": { - "start": 558, - "end": 573, - "ctxt": 0 - }, - "value": "content", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 565, - "end": 573, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 567, - "end": 573, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 575, - "end": 591, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 577, - "end": 589, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 577, - "end": 588, - "ctxt": 0 - }, - "callee": { - "type": "Super", - "span": { - "start": 577, - "end": 582, - "ctxt": 0 - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 583, - "end": 587, - "ctxt": 0 - }, - "value": "path", - "optional": false - } - } - ], - "typeArguments": null - } - } - ] - }, - "accessibility": null, - "isOptional": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 504, - "end": 520, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 596, - "end": 680, - "ctxt": 0 - }, - "declaration": { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 609, - "end": 618, - "ctxt": 0 - }, - "value": "Directory", - "optional": false - }, - "declare": false, - "span": { - "start": 603, - "end": 680, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 648, - "end": 677, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 648, - "end": 656, - "ctxt": 0 - }, - "value": "children", - "optional": false - }, - "value": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 656, - "end": 676, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 658, - "end": 676, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 658, - "end": 674, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 658, - "end": 674, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - }, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 627, - "end": 643, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - }, - { - "type": "ExportDeclaration", - "span": { - "start": 682, - "end": 729, - "ctxt": 0 - }, - "declaration": { - "type": "TsInterfaceDeclaration", - "span": { - "start": 689, - "end": 729, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 699, - "end": 708, - "ctxt": 0 - }, - "value": "Networked", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 709, - "end": 729, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 713, - "end": 726, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 713, - "end": 717, - "ctxt": 0 - }, - "value": "host", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 717, - "end": 725, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 719, - "end": 725, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 732, - "end": 792, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 736, - "end": 791, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 736, - "end": 740, - "ctxt": 0 - }, - "value": "file", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 740, - "end": 758, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 742, - "end": 758, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 742, - "end": 758, - "ctxt": 0 - }, - "value": "FileSystemObject", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "NewExpression", - "span": { - "start": 761, - "end": 791, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 765, - "end": 769, - "ctxt": 0 - }, - "value": "File", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 770, - "end": 783, - "ctxt": 0 - }, - "value": "foo/bar.txt", - "raw": "\"foo/bar.txt\"" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 785, - "end": 790, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 794, - "end": 825, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 794, - "end": 824, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 794, - "end": 810, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 794, - "end": 798, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 799, - "end": 810, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 813, - "end": 824, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 813, - "end": 817, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 818, - "end": 824, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 827, - "end": 857, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 827, - "end": 856, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 827, - "end": 837, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 827, - "end": 831, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 832, - "end": 837, - "ctxt": 0 - }, - "value": "isFSO", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 840, - "end": 856, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 840, - "end": 844, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 845, - "end": 856, - "ctxt": 0 - }, - "value": "isNetworked", - "optional": false - } - } - } - }, - { - "type": "ExpressionStatement", - "span": { - "start": 859, - "end": 884, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 859, - "end": 883, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 859, - "end": 870, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 859, - "end": 863, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 864, - "end": 870, - "ctxt": 0 - }, - "value": "isFile", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 873, - "end": 883, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 873, - "end": 877, - "ctxt": 0 - }, - "value": "file", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 878, - "end": 883, - "ctxt": 0 - }, - "value": "isFSO", - "optional": false - } - } - } - } - ] - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.ts b/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.ts deleted file mode 100644 index 43bdb0b4e47..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardOfFormThisMemberErrors.ts +++ /dev/null @@ -1,34 +0,0 @@ -// @target: es5 -// @declaration: true -// There's a 'File' class in the stdlib, wrap with a namespace to avoid collision -namespace Test { - export class FileSystemObject { - isFSO: this is FileSystemObject; - get isFile(): this is File { - return this instanceof File; - } - set isFile(param) { - // noop - } - get isDirectory(): this is Directory { - return this instanceof Directory; - } - isNetworked: this is (Networked & this); - constructor(public path: string) {} - } - - export class File extends FileSystemObject { - constructor(path: string, public content: string) { super(path); } - } - export class Directory extends FileSystemObject { - children: FileSystemObject[]; - } - export interface Networked { - host: string; - } - - let file: FileSystemObject = new File("foo/bar.txt", "foo"); - file.isNetworked = file.isFile; - file.isFSO = file.isNetworked; - file.isFile = file.isFSO; -} \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardsOnClassProperty.ts b/crates/swc_ecma_parser/tests/tsc/typeGuardsOnClassProperty.ts index 43ce321cbc2..1df284b6189 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardsOnClassProperty.ts +++ b/crates/swc_ecma_parser/tests/tsc/typeGuardsOnClassProperty.ts @@ -1,4 +1,4 @@ -// Note that type guards affect types of variables and parameters only and +// Note that type guards affect types of variables and parameters only and // have no effect on members of objects such as properties. // Note that the class's property must be copied to a local variable for diff --git a/crates/swc_ecma_parser/tests/tsc/typeGuardsWithInstanceOf.ts b/crates/swc_ecma_parser/tests/tsc/typeGuardsWithInstanceOf.ts index c17e0c3f477..bb6c82142ba 100644 --- a/crates/swc_ecma_parser/tests/tsc/typeGuardsWithInstanceOf.ts +++ b/crates/swc_ecma_parser/tests/tsc/typeGuardsWithInstanceOf.ts @@ -1,4 +1,4 @@ -// @strictNullChecks: true +// @strictNullChecks: true interface I { global: string; } var result!: I; diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.json b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.json deleted file mode 100644 index 26b8fc8de17..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.json +++ /dev/null @@ -1,1980 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 107, - "end": 963, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 107, - "end": 130, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 121, - "end": 129, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 121, - "end": 124, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 124, - "end": 129, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 126, - "end": 129, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 143, - "end": 144, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 132, - "end": 193, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 132, - "end": 136, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 133, - "end": 136, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 151, - "end": 164, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 162, - "end": 163, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 169, - "end": 191, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 176, - "end": 177, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 180, - "end": 190, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 180, - "end": 186, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 180, - "end": 184, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 185, - "end": 186, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 189, - "end": 190, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 206, - "end": 207, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 195, - "end": 550, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 195, - "end": 199, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 196, - "end": 199, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 224, - "end": 237, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 231, - "end": 232, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 235, - "end": 236, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 242, - "end": 264, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 249, - "end": 250, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 253, - "end": 263, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 253, - "end": 259, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 253, - "end": 257, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 258, - "end": 259, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 262, - "end": 263, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 269, - "end": 301, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 276, - "end": 277, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 280, - "end": 300, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 280, - "end": 296, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "SuperPropExpression", - "span": { - "start": 280, - "end": 287, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 280, - "end": 285, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 286, - "end": 287, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 290, - "end": 296, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 290, - "end": 294, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 295, - "end": 296, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 299, - "end": 300, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 306, - "end": 334, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 313, - "end": 314, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 317, - "end": 333, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BinaryExpression", - "span": { - "start": 323, - "end": 333, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 323, - "end": 329, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 323, - "end": 327, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 328, - "end": 329, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 339, - "end": 377, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 346, - "end": 348, - "ctxt": 0 - }, - "value": "ff", - "optional": false - }, - "value": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 351, - "end": 377, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 363, - "end": 377, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 365, - "end": 375, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 365, - "end": 375, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 365, - "end": 371, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 365, - "end": 369, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 370, - "end": 371, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 374, - "end": 375, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 382, - "end": 430, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 389, - "end": 392, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 382, - "end": 430, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 396, - "end": 430, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 406, - "end": 424, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 413, - "end": 423, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 413, - "end": 419, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 413, - "end": 417, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 418, - "end": 419, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 422, - "end": 423, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 435, - "end": 486, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 446, - "end": 448, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 435, - "end": 486, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 452, - "end": 486, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 462, - "end": 480, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 469, - "end": 479, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 469, - "end": 475, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 469, - "end": 473, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 474, - "end": 475, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 478, - "end": 479, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 491, - "end": 548, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 502, - "end": 504, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 506, - "end": 515, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 506, - "end": 515, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 507, - "end": 515, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 509, - "end": 515, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 491, - "end": 548, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 517, - "end": 548, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 527, - "end": 542, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 527, - "end": 541, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 527, - "end": 533, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 527, - "end": 531, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 532, - "end": 533, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 536, - "end": 541, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 536, - "end": 537, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 540, - "end": 541, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 558, - "end": 560, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "declare": false, - "span": { - "start": 552, - "end": 609, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 567, - "end": 580, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 574, - "end": 575, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 578, - "end": 579, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 585, - "end": 607, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 592, - "end": 593, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 596, - "end": 606, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 596, - "end": 602, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 596, - "end": 600, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 601, - "end": 602, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 605, - "end": 606, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 617, - "end": 619, - "ctxt": 0 - }, - "value": "DD", - "optional": false - }, - "declare": false, - "span": { - "start": 611, - "end": 963, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 637, - "end": 650, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 644, - "end": 645, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 648, - "end": 649, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 655, - "end": 677, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 662, - "end": 663, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 666, - "end": 676, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 666, - "end": 672, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 666, - "end": 670, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 671, - "end": 672, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 675, - "end": 676, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 682, - "end": 714, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 689, - "end": 690, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 693, - "end": 713, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 693, - "end": 709, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "SuperPropExpression", - "span": { - "start": 693, - "end": 700, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 693, - "end": 698, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 699, - "end": 700, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 703, - "end": 709, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 703, - "end": 707, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 708, - "end": 709, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 712, - "end": 713, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 719, - "end": 747, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 726, - "end": 727, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 730, - "end": 746, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BinaryExpression", - "span": { - "start": 736, - "end": 746, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 736, - "end": 742, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 736, - "end": 740, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 741, - "end": 742, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 745, - "end": 746, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 752, - "end": 790, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 759, - "end": 761, - "ctxt": 0 - }, - "value": "ff", - "optional": false - }, - "value": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 764, - "end": 790, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 776, - "end": 790, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 778, - "end": 788, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 778, - "end": 788, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 778, - "end": 784, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 778, - "end": 782, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 783, - "end": 784, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 787, - "end": 788, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 795, - "end": 843, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 802, - "end": 805, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 795, - "end": 843, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 809, - "end": 843, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 819, - "end": 837, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 826, - "end": 836, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 826, - "end": 832, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 826, - "end": 830, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 831, - "end": 832, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 835, - "end": 836, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 848, - "end": 899, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 859, - "end": 861, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 848, - "end": 899, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 865, - "end": 899, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 875, - "end": 893, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 882, - "end": 892, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 882, - "end": 888, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 882, - "end": 886, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 887, - "end": 888, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 891, - "end": 892, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 904, - "end": 961, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 915, - "end": 917, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 919, - "end": 928, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 919, - "end": 928, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 920, - "end": 928, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 922, - "end": 928, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 904, - "end": 961, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 930, - "end": 961, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 940, - "end": 955, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 940, - "end": 954, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 940, - "end": 946, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 940, - "end": 944, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 945, - "end": 946, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 949, - "end": 954, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 949, - "end": 950, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 953, - "end": 954, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 628, - "end": 630, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.ts b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.ts deleted file mode 100644 index f8f0b776b80..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers10.ts +++ /dev/null @@ -1,51 +0,0 @@ -// @target: esnext, es2022, es6, es5 -// @experimentalDecorators: true -// @useDefineForClassFields: false - -declare const foo: any; - -@foo -class C { - static a = 1; - static b = this.a + 1; -} - -@foo -class D extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = () => this.c + 1; - static ff = function () { this.c + 1 } - static foo () { - return this.c + 1; - } - static get fa () { - return this.c + 1; - } - static set fa (v: number) { - this.c = v + 1; - } -} - -class CC { - static a = 1; - static b = this.a + 1; -} - -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = () => this.c + 1; - static ff = function () { this.c + 1 } - static foo () { - return this.c + 1; - } - static get fa () { - return this.c + 1; - } - static set fa (v: number) { - this.c = v + 1; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.json b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.json deleted file mode 100644 index 60cb5086db5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.json +++ /dev/null @@ -1,1980 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 106, - "end": 962, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 106, - "end": 129, - "ctxt": 0 - }, - "kind": "const", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 120, - "end": 128, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 120, - "end": 123, - "ctxt": 0 - }, - "value": "foo", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 123, - "end": 128, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 125, - "end": 128, - "ctxt": 0 - }, - "kind": "any" - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 142, - "end": 143, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 131, - "end": 192, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 131, - "end": 135, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 150, - "end": 163, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 157, - "end": 158, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 161, - "end": 162, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 168, - "end": 190, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 175, - "end": 176, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 179, - "end": 189, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 179, - "end": 185, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 179, - "end": 183, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 184, - "end": 185, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 188, - "end": 189, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 205, - "end": 206, - "ctxt": 0 - }, - "value": "D", - "optional": false - }, - "declare": false, - "span": { - "start": 194, - "end": 549, - "ctxt": 0 - }, - "decorators": [ - { - "type": "Decorator", - "span": { - "start": 194, - "end": 198, - "ctxt": 0 - }, - "expression": { - "type": "Identifier", - "span": { - "start": 195, - "end": 198, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - } - ], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 223, - "end": 236, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 230, - "end": 231, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 234, - "end": 235, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 241, - "end": 263, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 248, - "end": 249, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 252, - "end": 262, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 252, - "end": 258, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 252, - "end": 256, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 257, - "end": 258, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 261, - "end": 262, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 268, - "end": 300, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 275, - "end": 276, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 279, - "end": 299, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 279, - "end": 295, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "SuperPropExpression", - "span": { - "start": 279, - "end": 286, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 279, - "end": 284, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 289, - "end": 295, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 289, - "end": 293, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 294, - "end": 295, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 298, - "end": 299, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 305, - "end": 333, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 316, - "end": 332, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BinaryExpression", - "span": { - "start": 322, - "end": 332, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 322, - "end": 328, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 322, - "end": 326, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 327, - "end": 328, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 331, - "end": 332, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 338, - "end": 376, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 345, - "end": 347, - "ctxt": 0 - }, - "value": "ff", - "optional": false - }, - "value": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 350, - "end": 376, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 362, - "end": 376, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 364, - "end": 374, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 364, - "end": 374, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 364, - "end": 368, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 369, - "end": 370, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 373, - "end": 374, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 381, - "end": 429, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 388, - "end": 391, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 381, - "end": 429, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 395, - "end": 429, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 405, - "end": 423, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 412, - "end": 422, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 412, - "end": 418, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 412, - "end": 416, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 417, - "end": 418, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 421, - "end": 422, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 434, - "end": 485, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 445, - "end": 447, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 434, - "end": 485, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 451, - "end": 485, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 461, - "end": 479, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 468, - "end": 478, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 468, - "end": 474, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 468, - "end": 472, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 473, - "end": 474, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 490, - "end": 547, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 501, - "end": 503, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 505, - "end": 514, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 505, - "end": 514, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 506, - "end": 514, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 508, - "end": 514, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 490, - "end": 547, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 516, - "end": 547, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 526, - "end": 541, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 526, - "end": 540, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 526, - "end": 532, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 526, - "end": 530, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 531, - "end": 532, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 535, - "end": 540, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 535, - "end": 536, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 539, - "end": 540, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 215, - "end": 216, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 557, - "end": 559, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "declare": false, - "span": { - "start": 551, - "end": 608, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 566, - "end": 579, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 573, - "end": 574, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 577, - "end": 578, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 584, - "end": 606, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 591, - "end": 592, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 595, - "end": 605, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 595, - "end": 601, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 595, - "end": 599, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 600, - "end": 601, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 604, - "end": 605, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 616, - "end": 618, - "ctxt": 0 - }, - "value": "DD", - "optional": false - }, - "declare": false, - "span": { - "start": 610, - "end": 962, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 636, - "end": 649, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 643, - "end": 644, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 647, - "end": 648, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 654, - "end": 676, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 661, - "end": 662, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 665, - "end": 675, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 665, - "end": 671, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 665, - "end": 669, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 670, - "end": 671, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 674, - "end": 675, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 681, - "end": 713, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 688, - "end": 689, - "ctxt": 0 - }, - "value": "e", - "optional": false - }, - "value": { - "type": "BinaryExpression", - "span": { - "start": 692, - "end": 712, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "BinaryExpression", - "span": { - "start": 692, - "end": 708, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "SuperPropExpression", - "span": { - "start": 692, - "end": 699, - "ctxt": 0 - }, - "obj": { - "type": "Super", - "span": { - "start": 692, - "end": 697, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 698, - "end": 699, - "ctxt": 0 - }, - "value": "a", - "optional": false - } - }, - "right": { - "type": "MemberExpression", - "span": { - "start": 702, - "end": 708, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 702, - "end": 706, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 707, - "end": 708, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 711, - "end": 712, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 718, - "end": 746, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 725, - "end": 726, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "ArrowFunctionExpression", - "span": { - "start": 729, - "end": 745, - "ctxt": 0 - }, - "params": [], - "body": { - "type": "BinaryExpression", - "span": { - "start": 735, - "end": 745, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 735, - "end": 741, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 735, - "end": 739, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 740, - "end": 741, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 744, - "end": 745, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 751, - "end": 789, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 758, - "end": 760, - "ctxt": 0 - }, - "value": "ff", - "optional": false - }, - "value": { - "type": "FunctionExpression", - "identifier": null, - "params": [], - "decorators": [], - "span": { - "start": 763, - "end": 789, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 775, - "end": 789, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 777, - "end": 787, - "ctxt": 0 - }, - "expression": { - "type": "BinaryExpression", - "span": { - "start": 777, - "end": 787, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 777, - "end": 783, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 777, - "end": 781, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 782, - "end": 783, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 786, - "end": 787, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassMethod", - "span": { - "start": 794, - "end": 842, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 801, - "end": 804, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 794, - "end": 842, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 808, - "end": 842, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 818, - "end": 836, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 825, - "end": 835, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 825, - "end": 831, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 825, - "end": 829, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 830, - "end": 831, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 834, - "end": 835, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "method", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 847, - "end": 898, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 858, - "end": 860, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [], - "decorators": [], - "span": { - "start": 847, - "end": 898, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 864, - "end": 898, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 874, - "end": 892, - "ctxt": 0 - }, - "argument": { - "type": "BinaryExpression", - "span": { - "start": 881, - "end": 891, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "MemberExpression", - "span": { - "start": 881, - "end": 887, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 881, - "end": 885, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 886, - "end": 887, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 890, - "end": 891, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "getter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - }, - { - "type": "ClassMethod", - "span": { - "start": 903, - "end": 960, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 914, - "end": 916, - "ctxt": 0 - }, - "value": "fa", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 918, - "end": 927, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 918, - "end": 927, - "ctxt": 0 - }, - "value": "v", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 919, - "end": 927, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 921, - "end": 927, - "ctxt": 0 - }, - "kind": "number" - } - } - } - } - ], - "decorators": [], - "span": { - "start": 903, - "end": 960, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 929, - "end": 960, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ExpressionStatement", - "span": { - "start": 939, - "end": 954, - "ctxt": 0 - }, - "expression": { - "type": "AssignmentExpression", - "span": { - "start": 939, - "end": 953, - "ctxt": 0 - }, - "operator": "=", - "left": { - "type": "MemberExpression", - "span": { - "start": 939, - "end": 945, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 939, - "end": 943, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 944, - "end": 945, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - }, - "right": { - "type": "BinaryExpression", - "span": { - "start": 948, - "end": 953, - "ctxt": 0 - }, - "operator": "+", - "left": { - "type": "Identifier", - "span": { - "start": 948, - "end": 949, - "ctxt": 0 - }, - "value": "v", - "optional": false - }, - "right": { - "type": "NumericLiteral", - "span": { - "start": 952, - "end": 953, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": null, - "returnType": null - }, - "kind": "setter", - "isStatic": true, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": { - "type": "Identifier", - "span": { - "start": 627, - "end": 629, - "ctxt": 0 - }, - "value": "CC", - "optional": false - }, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.ts b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.ts deleted file mode 100644 index 938407c1505..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers11.ts +++ /dev/null @@ -1,51 +0,0 @@ -// @target: esnext, es2022, es6, es5 -// @experimentalDecorators: true -// @useDefineForClassFields: true - -declare const foo: any; - -@foo -class C { - static a = 1; - static b = this.a + 1; -} - -@foo -class D extends C { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = () => this.c + 1; - static ff = function () { this.c + 1 } - static foo () { - return this.c + 1; - } - static get fa () { - return this.c + 1; - } - static set fa (v: number) { - this.c = v + 1; - } -} - -class CC { - static a = 1; - static b = this.a + 1; -} - -class DD extends CC { - static c = 2; - static d = this.c + 1; - static e = super.a + this.c + 1; - static f = () => this.c + 1; - static ff = function () { this.c + 1 } - static foo () { - return this.c + 1; - } - static get fa () { - return this.c + 1; - } - static set fa (v: number) { - this.c = v + 1; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.json b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.json deleted file mode 100644 index 6d7dbeb835f..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 74, - "end": 215, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 80, - "end": 81, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 74, - "end": 215, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 88, - "end": 120, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 104, - "end": 105, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 115, - "end": 120, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 105, - "end": 112, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 107, - "end": 112, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 107, - "end": 112, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": true, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 125, - "end": 213, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 132, - "end": 135, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 145, - "end": 150, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "span": { - "start": 139, - "end": 213, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 161, - "end": 183, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 168, - "end": 176, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 169, - "end": 175, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 169, - "end": 173, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 174, - "end": 175, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 179, - "end": 182, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 192, - "end": 207, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 192, - "end": 200, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 193, - "end": 199, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 193, - "end": 197, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 198, - "end": 199, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 203, - "end": 206, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.ts b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.ts deleted file mode 100644 index 401d582f57a..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers12.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: esnext, es2022, es6, es5 -// @useDefineForClassFields: false - -class C { - static readonly c: "foo" = "foo" - static bar = class Inner { - static [this.c] = 123; - [this.c] = 123; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.json b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.json deleted file mode 100644 index 897b033390c..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 73, - "end": 214, - "ctxt": 0 - }, - "body": [ - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 79, - "end": 80, - "ctxt": 0 - }, - "value": "C", - "optional": false - }, - "declare": false, - "span": { - "start": 73, - "end": 214, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 87, - "end": 119, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 103, - "end": 104, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 114, - "end": 119, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 104, - "end": 111, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 106, - "end": 111, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 106, - "end": 111, - "ctxt": 0 - }, - "value": "foo", - "raw": "\"foo\"" - } - } - }, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": true, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 124, - "end": 212, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 131, - "end": 134, - "ctxt": 0 - }, - "value": "bar", - "optional": false - }, - "value": { - "type": "ClassExpression", - "identifier": { - "type": "Identifier", - "span": { - "start": 144, - "end": 149, - "ctxt": 0 - }, - "value": "Inner", - "optional": false - }, - "span": { - "start": 138, - "end": 212, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "ClassProperty", - "span": { - "start": 160, - "end": 182, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 167, - "end": 175, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 168, - "end": 174, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 168, - "end": 172, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 173, - "end": 174, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 178, - "end": 181, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - }, - { - "type": "ClassProperty", - "span": { - "start": 191, - "end": 206, - "ctxt": 0 - }, - "key": { - "type": "Computed", - "span": { - "start": 191, - "end": 199, - "ctxt": 0 - }, - "expression": { - "type": "MemberExpression", - "span": { - "start": 192, - "end": 198, - "ctxt": 0 - }, - "object": { - "type": "ThisExpression", - "span": { - "start": 192, - "end": 196, - "ctxt": 0 - } - }, - "property": { - "type": "Identifier", - "span": { - "start": 197, - "end": 198, - "ctxt": 0 - }, - "value": "c", - "optional": false - } - } - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 202, - "end": 205, - "ctxt": 0 - }, - "value": 123.0, - "raw": "123" - }, - "typeAnnotation": null, - "isStatic": false, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - }, - "typeAnnotation": null, - "isStatic": true, - "decorators": [], - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false, - "readonly": false, - "declare": false, - "definite": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": null, - "superTypeParams": null, - "implements": [] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.ts b/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.ts deleted file mode 100644 index 252d195eaaf..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeOfThisInStaticMembers13.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @target: esnext, es2022, es6, es5 -// @useDefineForClassFields: true - -class C { - static readonly c: "foo" = "foo" - static bar = class Inner { - static [this.c] = 123; - [this.c] = 123; - } -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.json b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.json new file mode 100644 index 00000000000..13e1aabb349 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.json @@ -0,0 +1,251 @@ +{ + "type": "Module", + "span": { + "start": 20, + "end": 173, + "ctxt": 0 + }, + "body": [ + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 20, + "end": 34, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 30, + "end": 31, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 32, + "end": 34, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 35, + "end": 53, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 49, + "end": 50, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 49, + "end": 50, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 74, + "end": 98, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 83, + "end": 84, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 83, + "end": 84, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 92, + "end": 97, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "VariableDeclaration", + "span": { + "start": 99, + "end": 111, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 105, + "end": 110, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 105, + "end": 106, + "ctxt": 0 + }, + "value": "A", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 109, + "end": 110, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 112, + "end": 125, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 121, + "end": 122, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 121, + "end": 122, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 146, + "end": 170, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 155, + "end": 156, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 155, + "end": 156, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 164, + "end": 169, + "ctxt": 0 + }, + "value": "./b", + "raw": "\"./b\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 171, + "end": 173, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 171, + "end": 172, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.ts b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.ts new file mode 100644 index 00000000000..59e77388deb --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge1.ts @@ -0,0 +1,12 @@ +// @Filename: a.ts +interface A {} +export type { A }; + +// @Filename: b.ts +import { A } from "./a"; +const A = 0; +export { A }; + +// @Filename: c.ts +import { A } from "./b"; +A; diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.json b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.json new file mode 100644 index 00000000000..8451ca7bc4c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.json @@ -0,0 +1,353 @@ +{ + "type": "Module", + "span": { + "start": 20, + "end": 246, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 20, + "end": 32, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 26, + "end": 32, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 26, + "end": 27, + "ctxt": 0 + }, + "value": "A", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 30, + "end": 32, + "ctxt": 0 + }, + "properties": [] + }, + "definite": false + } + ] + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 33, + "end": 46, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 42, + "end": 43, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 42, + "end": 43, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 67, + "end": 91, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 76, + "end": 77, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 76, + "end": 77, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 85, + "end": 90, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 92, + "end": 105, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 97, + "end": 98, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 101, + "end": 104, + "ctxt": 0 + }, + "kind": "any" + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 106, + "end": 124, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 120, + "end": 121, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 120, + "end": 121, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 145, + "end": 169, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 154, + "end": 155, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 154, + "end": 155, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 163, + "end": 168, + "ctxt": 0 + }, + "value": "./b", + "raw": "\"./b\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 170, + "end": 184, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 180, + "end": 181, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 182, + "end": 184, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 185, + "end": 198, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 194, + "end": 195, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 194, + "end": 195, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 219, + "end": 243, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 228, + "end": 229, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 228, + "end": 229, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 237, + "end": 242, + "ctxt": 0 + }, + "value": "./c", + "raw": "\"./c\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 244, + "end": 246, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 244, + "end": 245, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.ts b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.ts new file mode 100644 index 00000000000..54d69f7d2c3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge2.ts @@ -0,0 +1,17 @@ +// @Filename: a.ts +const A = {} +export { A }; + +// @Filename: b.ts +import { A } from "./a"; +type A = any; +export type { A }; + +// @Filename: c.ts +import { A } from "./b"; +namespace A {} +export { A }; + +// @Filename: d.ts +import { A } from "./c"; +A; diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.json b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.json new file mode 100644 index 00000000000..1c6fc24a381 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.json @@ -0,0 +1,357 @@ +{ + "type": "Module", + "span": { + "start": 20, + "end": 231, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 29, + "end": 30, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 20, + "end": 35, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 33, + "end": 35, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 36, + "end": 54, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 50, + "end": 51, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 50, + "end": 51, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 75, + "end": 99, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 84, + "end": 85, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 84, + "end": 85, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 93, + "end": 98, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 100, + "end": 149, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 110, + "end": 111, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 112, + "end": 149, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 116, + "end": 147, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 123, + "end": 147, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 129, + "end": 146, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 129, + "end": 140, + "ctxt": 0 + }, + "value": "displayName", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 143, + "end": 146, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + }, + "definite": false + } + ] + } + } + ] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 150, + "end": 163, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 159, + "end": 160, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 159, + "end": 160, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 184, + "end": 208, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 193, + "end": 194, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 193, + "end": 194, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 202, + "end": 207, + "ctxt": 0 + }, + "value": "./b", + "raw": "\"./b\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 209, + "end": 211, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 209, + "end": 210, + "ctxt": 0 + }, + "value": "A", + "optional": false + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 212, + "end": 226, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 212, + "end": 225, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 212, + "end": 213, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 214, + "end": 225, + "ctxt": 0 + }, + "value": "displayName", + "optional": false + } + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 227, + "end": 231, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 227, + "end": 230, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 227, + "end": 228, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.ts b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.ts new file mode 100644 index 00000000000..d5085b05d86 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeOnlyMerge3.ts @@ -0,0 +1,16 @@ +// @Filename: a.ts +function A() {} +export type { A }; + +// @Filename: b.ts +import { A } from "./a"; +namespace A { + export const displayName = "A"; +} +export { A }; + +// @Filename: c.ts +import { A } from "./b"; +A; +A.displayName; +A(); diff --git a/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.json b/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.json deleted file mode 100644 index 031130d1777..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.json +++ /dev/null @@ -1,5609 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 19, - "end": 1796, - "ctxt": 0 - }, - "body": [ - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 36, - "end": 38, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 48, - "end": 52, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 48, - "end": 52, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 49, - "end": 52, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 51, - "end": 52, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 19, - "end": 57, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 38, - "end": 47, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 39, - "end": 46, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 45, - "end": 46, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 55, - "end": 56, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 59, - "end": 79, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 65, - "end": 78, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 65, - "end": 68, - "ctxt": 0 - }, - "value": "x11", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 71, - "end": 78, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 71, - "end": 73, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 74, - "end": 77, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 80, - "end": 114, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 86, - "end": 113, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 86, - "end": 89, - "ctxt": 0 - }, - "value": "x12", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 92, - "end": 113, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 92, - "end": 94, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 95, - "end": 112, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 96, - "end": 99, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 101, - "end": 111, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 102, - "end": 105, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 107, - "end": 110, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 115, - "end": 179, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 121, - "end": 178, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 121, - "end": 124, - "ctxt": 0 - }, - "value": "x13", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 127, - "end": 178, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 127, - "end": 129, - "ctxt": 0 - }, - "value": "f1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 130, - "end": 177, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 132, - "end": 133, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 135, - "end": 136, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 138, - "end": 139, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 141, - "end": 144, - "ctxt": 0 - }, - "value": "c", - "raw": "\"c\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 146, - "end": 147, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 149, - "end": 175, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 150, - "end": 153, - "ctxt": 0 - }, - "value": "e", - "raw": "\"e\"" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 155, - "end": 156, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 158, - "end": 162, - "ctxt": 0 - }, - "value": true - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 164, - "end": 174, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 166, - "end": 167, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 169, - "end": 172, - "ctxt": 0 - }, - "value": "g", - "raw": "\"g\"" - } - } - ] - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 198, - "end": 200, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 213, - "end": 229, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 213, - "end": 229, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 214, - "end": 229, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 216, - "end": 229, - "ctxt": 0 - }, - "types": [ - { - "type": "TsTypeReference", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 216, - "end": 217, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsKeywordType", - "span": { - "start": 220, - "end": 229, - "ctxt": 0 - }, - "kind": "undefined" - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 181, - "end": 234, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 200, - "end": 212, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 201, - "end": 208, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 207, - "end": 208, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 210, - "end": 211, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 230, - "end": 233, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 232, - "end": 233, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 236, - "end": 256, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 242, - "end": 255, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 242, - "end": 245, - "ctxt": 0 - }, - "value": "x21", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 248, - "end": 255, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 248, - "end": 250, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 251, - "end": 254, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 257, - "end": 291, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 263, - "end": 290, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 263, - "end": 266, - "ctxt": 0 - }, - "value": "x22", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 269, - "end": 290, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 269, - "end": 271, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 272, - "end": 289, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 273, - "end": 276, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 278, - "end": 288, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 279, - "end": 282, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 284, - "end": 287, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 292, - "end": 356, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 298, - "end": 355, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 298, - "end": 301, - "ctxt": 0 - }, - "value": "x23", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 304, - "end": 355, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 304, - "end": 306, - "ctxt": 0 - }, - "value": "f2", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 307, - "end": 354, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 309, - "end": 310, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 312, - "end": 313, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 315, - "end": 316, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 318, - "end": 321, - "ctxt": 0 - }, - "value": "c", - "raw": "\"c\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 323, - "end": 324, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 326, - "end": 352, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 327, - "end": 330, - "ctxt": 0 - }, - "value": "e", - "raw": "\"e\"" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 332, - "end": 333, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 335, - "end": 339, - "ctxt": 0 - }, - "value": true - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 341, - "end": 351, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 343, - "end": 344, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 346, - "end": 349, - "ctxt": 0 - }, - "value": "g", - "raw": "\"g\"" - } - } - ] - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 375, - "end": 377, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 387, - "end": 391, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 387, - "end": 391, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 388, - "end": 391, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 390, - "end": 391, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 358, - "end": 398, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 377, - "end": 386, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 378, - "end": 385, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 384, - "end": 385, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 392, - "end": 397, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 394, - "end": 397, - "ctxt": 0 - }, - "elemType": { - "type": "TsTypeReference", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 394, - "end": 395, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 400, - "end": 424, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 406, - "end": 423, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 406, - "end": 409, - "ctxt": 0 - }, - "value": "x31", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 412, - "end": 423, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 412, - "end": 414, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 415, - "end": 422, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 425, - "end": 449, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 431, - "end": 448, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 431, - "end": 434, - "ctxt": 0 - }, - "value": "x32", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 437, - "end": 448, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 437, - "end": 439, - "ctxt": 0 - }, - "value": "f3", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 440, - "end": 447, - "ctxt": 0 - }, - "value": "hello", - "raw": "\"hello\"" - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 468, - "end": 470, - "ctxt": 0 - }, - "value": "f4", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 480, - "end": 491, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 480, - "end": 491, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 483, - "end": 491, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 485, - "end": 491, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 486, - "end": 487, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeReference", - "span": { - "start": 486, - "end": 487, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 486, - "end": 487, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTupleElement", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsTypeReference", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 489, - "end": 490, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 451, - "end": 496, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 470, - "end": 479, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 471, - "end": 478, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 477, - "end": 478, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 492, - "end": 495, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 494, - "end": 495, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 498, - "end": 535, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 504, - "end": 534, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 504, - "end": 507, - "ctxt": 0 - }, - "value": "x41", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 510, - "end": 534, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 510, - "end": 512, - "ctxt": 0 - }, - "value": "f4", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 513, - "end": 533, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 514, - "end": 522, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 515, - "end": 516, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 518, - "end": 521, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 524, - "end": 532, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 525, - "end": 526, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 528, - "end": 531, - "ctxt": 0 - }, - "value": "y", - "raw": "'y'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 536, - "end": 589, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 542, - "end": 588, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 542, - "end": 545, - "ctxt": 0 - }, - "value": "x42", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 548, - "end": 588, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 548, - "end": 550, - "ctxt": 0 - }, - "value": "f4", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 551, - "end": 587, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 552, - "end": 568, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 554, - "end": 555, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 557, - "end": 558, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 560, - "end": 561, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 563, - "end": 566, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 570, - "end": 586, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 572, - "end": 573, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 575, - "end": 576, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 578, - "end": 579, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 581, - "end": 584, - "ctxt": 0 - }, - "value": "y", - "raw": "'y'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 608, - "end": 610, - "ctxt": 0 - }, - "value": "f5", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 620, - "end": 639, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 620, - "end": 639, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 623, - "end": 639, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 625, - "end": 639, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 627, - "end": 632, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 627, - "end": 628, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 628, - "end": 631, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 630, - "end": 631, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 630, - "end": 631, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - }, - { - "type": "TsPropertySignature", - "span": { - "start": 633, - "end": 637, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 633, - "end": 634, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 634, - "end": 637, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 636, - "end": 637, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 636, - "end": 637, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - } - } - } - ], - "decorators": [], - "span": { - "start": 591, - "end": 644, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 610, - "end": 619, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 611, - "end": 618, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 617, - "end": 618, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 640, - "end": 643, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 642, - "end": 643, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 646, - "end": 691, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 652, - "end": 690, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 652, - "end": 655, - "ctxt": 0 - }, - "value": "x51", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 658, - "end": 690, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 658, - "end": 660, - "ctxt": 0 - }, - "value": "f5", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 661, - "end": 689, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 663, - "end": 664, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 666, - "end": 674, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 667, - "end": 668, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 670, - "end": 673, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 676, - "end": 677, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 679, - "end": 687, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 680, - "end": 681, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 683, - "end": 686, - "ctxt": 0 - }, - "value": "y", - "raw": "'y'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 692, - "end": 753, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 698, - "end": 752, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 698, - "end": 701, - "ctxt": 0 - }, - "value": "x52", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 704, - "end": 752, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 704, - "end": 706, - "ctxt": 0 - }, - "value": "f5", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 707, - "end": 751, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 709, - "end": 710, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 712, - "end": 728, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 714, - "end": 715, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 717, - "end": 718, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 720, - "end": 721, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 723, - "end": 726, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ] - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 730, - "end": 731, - "ctxt": 0 - }, - "value": "y", - "optional": false - }, - "value": { - "type": "ObjectExpression", - "span": { - "start": 733, - "end": 749, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 735, - "end": 736, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 738, - "end": 739, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 741, - "end": 742, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 744, - "end": 747, - "ctxt": 0 - }, - "value": "y", - "raw": "'y'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 772, - "end": 774, - "ctxt": 0 - }, - "value": "f6", - "optional": false - }, - "declare": true, - "params": [ - { - "type": "Parameter", - "span": { - "start": 811, - "end": 821, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "RestElement", - "span": { - "start": 811, - "end": 821, - "ctxt": 0 - }, - "rest": { - "start": 811, - "end": 814, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 814, - "end": 818, - "ctxt": 0 - }, - "value": "args", - "optional": false, - "typeAnnotation": null - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 818, - "end": 821, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 820, - "end": 821, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 820, - "end": 821, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 755, - "end": 826, - "ctxt": 0 - }, - "body": null, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 774, - "end": 810, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 775, - "end": 809, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 781, - "end": 782, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": { - "type": "TsTypeOperator", - "span": { - "start": 791, - "end": 809, - "ctxt": 0 - }, - "op": "readonly", - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 800, - "end": 809, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 800, - "end": 807, - "ctxt": 0 - }, - "kind": "unknown" - } - } - }, - "default": null - } - ] - }, - "returnType": { - "type": "TsTypeAnnotation", - "span": { - "start": 822, - "end": 825, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 824, - "end": 825, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 824, - "end": 825, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 828, - "end": 869, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 834, - "end": 868, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 834, - "end": 837, - "ctxt": 0 - }, - "value": "x61", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 840, - "end": 868, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 840, - "end": 842, - "ctxt": 0 - }, - "value": "f6", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 843, - "end": 844, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 846, - "end": 849, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 851, - "end": 867, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 853, - "end": 854, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 856, - "end": 857, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 859, - "end": 860, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 862, - "end": 865, - "ctxt": 0 - }, - "value": "x", - "raw": "'x'" - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "ClassDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 877, - "end": 879, - "ctxt": 0 - }, - "value": "C1", - "optional": false - }, - "declare": false, - "span": { - "start": 871, - "end": 954, - "ctxt": 0 - }, - "decorators": [], - "body": [ - { - "type": "Constructor", - "span": { - "start": 895, - "end": 915, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 895, - "end": 906, - "ctxt": 0 - }, - "value": "constructor", - "optional": false - }, - "params": [ - { - "type": "Parameter", - "span": { - "start": 907, - "end": 911, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 907, - "end": 911, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 908, - "end": 911, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 910, - "end": 911, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 910, - "end": 911, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "body": { - "type": "BlockStatement", - "span": { - "start": 913, - "end": 915, - "ctxt": 0 - }, - "stmts": [] - }, - "accessibility": null, - "isOptional": false - }, - { - "type": "ClassMethod", - "span": { - "start": 920, - "end": 952, - "ctxt": 0 - }, - "key": { - "type": "Identifier", - "span": { - "start": 920, - "end": 923, - "ctxt": 0 - }, - "value": "foo", - "optional": false - }, - "function": { - "params": [ - { - "type": "Parameter", - "span": { - "start": 933, - "end": 937, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 933, - "end": 937, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 934, - "end": 937, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 936, - "end": 937, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 936, - "end": 937, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "typeParams": null - } - } - } - } - ], - "decorators": [], - "span": { - "start": 920, - "end": 952, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 939, - "end": 952, - "ctxt": 0 - }, - "stmts": [ - { - "type": "ReturnStatement", - "span": { - "start": 941, - "end": 950, - "ctxt": 0 - }, - "argument": { - "type": "Identifier", - "span": { - "start": 948, - "end": 949, - "ctxt": 0 - }, - "value": "x", - "optional": false - } - } - ] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 923, - "end": 932, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 924, - "end": 931, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 930, - "end": 931, - "ctxt": 0 - }, - "value": "U", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "kind": "method", - "isStatic": false, - "accessibility": null, - "isAbstract": false, - "isOptional": false, - "isOverride": false - } - ], - "superClass": null, - "isAbstract": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 879, - "end": 888, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 880, - "end": 887, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 886, - "end": 887, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "superTypeParams": null, - "implements": [] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 956, - "end": 1024, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 962, - "end": 1023, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 962, - "end": 965, - "ctxt": 0 - }, - "value": "c71", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "NewExpression", - "span": { - "start": 968, - "end": 1023, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 972, - "end": 974, - "ctxt": 0 - }, - "value": "C1", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 975, - "end": 1022, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 977, - "end": 978, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 980, - "end": 981, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 983, - "end": 984, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 986, - "end": 989, - "ctxt": 0 - }, - "value": "c", - "raw": "\"c\"" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 991, - "end": 992, - "ctxt": 0 - }, - "value": "d", - "optional": false - }, - "value": { - "type": "ArrayExpression", - "span": { - "start": 994, - "end": 1020, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 995, - "end": 998, - "ctxt": 0 - }, - "value": "e", - "raw": "\"e\"" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 1000, - "end": 1001, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - }, - { - "spread": null, - "expression": { - "type": "BooleanLiteral", - "span": { - "start": 1003, - "end": 1007, - "ctxt": 0 - }, - "value": true - } - }, - { - "spread": null, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 1009, - "end": 1019, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 1011, - "end": 1012, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 1014, - "end": 1017, - "ctxt": 0 - }, - "value": "g", - "raw": "\"g\"" - } - } - ] - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1025, - "end": 1064, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1031, - "end": 1063, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1031, - "end": 1034, - "ctxt": 0 - }, - "value": "c72", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "CallExpression", - "span": { - "start": 1037, - "end": 1063, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 1037, - "end": 1044, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 1037, - "end": 1040, - "ctxt": 0 - }, - "value": "c71", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 1041, - "end": 1044, - "ctxt": 0 - }, - "value": "foo", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1045, - "end": 1062, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1046, - "end": 1049, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1051, - "end": 1061, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1052, - "end": 1055, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1057, - "end": 1060, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - } - ] - } - } - ], - "typeArguments": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1066, - "end": 1099, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1072, - "end": 1098, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1072, - "end": 1075, - "ctxt": 0 - }, - "value": "fx1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1078, - "end": 1098, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1088, - "end": 1092, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1089, - "end": 1092, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1091, - "end": 1092, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1091, - "end": 1092, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 1097, - "end": 1098, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1078, - "end": 1087, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1079, - "end": 1086, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1085, - "end": 1086, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1100, - "end": 1134, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1106, - "end": 1133, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1106, - "end": 1109, - "ctxt": 0 - }, - "value": "fx2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "ArrowFunctionExpression", - "span": { - "start": 1112, - "end": 1133, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1123, - "end": 1127, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1124, - "end": 1127, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1126, - "end": 1127, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1126, - "end": 1127, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "body": { - "type": "Identifier", - "span": { - "start": 1132, - "end": 1133, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "async": false, - "generator": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1112, - "end": 1122, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1113, - "end": 1120, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1119, - "end": 1120, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "returnType": null - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1136, - "end": 1166, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1146, - "end": 1148, - "ctxt": 0 - }, - "value": "I1", - "optional": false - }, - "declare": false, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1148, - "end": 1157, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1149, - "end": 1156, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1155, - "end": 1156, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1158, - "end": 1166, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1160, - "end": 1164, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1160, - "end": 1161, - "ctxt": 0 - }, - "value": "x", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1161, - "end": 1164, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1163, - "end": 1164, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1163, - "end": 1164, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1178, - "end": 1219, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1188, - "end": 1190, - "ctxt": 0 - }, - "value": "I2", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 1191, - "end": 1219, - "ctxt": 0 - }, - "body": [ - { - "type": "TsMethodSignature", - "span": { - "start": 1197, - "end": 1217, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1197, - "end": 1198, - "ctxt": 0 - }, - "value": "f", - "optional": false - }, - "computed": false, - "optional": false, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1208, - "end": 1212, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1209, - "end": 1212, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1211, - "end": 1212, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1211, - "end": 1212, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeAnn": { - "type": "TsTypeAnnotation", - "span": { - "start": 1213, - "end": 1216, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1215, - "end": 1216, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1215, - "end": 1216, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1198, - "end": 1207, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1199, - "end": 1206, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1205, - "end": 1206, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1221, - "end": 1242, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1226, - "end": 1228, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1228, - "end": 1237, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1229, - "end": 1236, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1235, - "end": 1236, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1240, - "end": 1241, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1240, - "end": 1241, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1254, - "end": 1285, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1259, - "end": 1261, - "ctxt": 0 - }, - "value": "T2", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 1264, - "end": 1284, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1274, - "end": 1278, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1275, - "end": 1278, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1277, - "end": 1278, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1277, - "end": 1278, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1264, - "end": 1273, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1265, - "end": 1272, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1271, - "end": 1272, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1280, - "end": 1284, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1283, - "end": 1284, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1283, - "end": 1284, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1286, - "end": 1319, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1291, - "end": 1293, - "ctxt": 0 - }, - "value": "T3", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1296, - "end": 1318, - "ctxt": 0 - }, - "members": [ - { - "type": "TsCallSignatureDeclaration", - "span": { - "start": 1298, - "end": 1316, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1308, - "end": 1312, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1309, - "end": 1312, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1311, - "end": 1312, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1311, - "end": 1312, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1313, - "end": 1316, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1315, - "end": 1316, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1315, - "end": 1316, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1298, - "end": 1307, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1299, - "end": 1306, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1305, - "end": 1306, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1320, - "end": 1355, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1325, - "end": 1327, - "ctxt": 0 - }, - "value": "T4", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsConstructorType", - "span": { - "start": 1330, - "end": 1354, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1344, - "end": 1348, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1345, - "end": 1348, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1347, - "end": 1348, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1347, - "end": 1348, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1334, - "end": 1343, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1335, - "end": 1342, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1341, - "end": 1342, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1350, - "end": 1354, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1353, - "end": 1354, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1353, - "end": 1354, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "isAbstract": false - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1356, - "end": 1393, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1361, - "end": 1363, - "ctxt": 0 - }, - "value": "T5", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1366, - "end": 1392, - "ctxt": 0 - }, - "members": [ - { - "type": "TsConstructSignatureDeclaration", - "span": { - "start": 1368, - "end": 1390, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 1382, - "end": 1386, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1383, - "end": 1386, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1385, - "end": 1386, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1385, - "end": 1386, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - ], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1387, - "end": 1390, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1389, - "end": 1390, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1389, - "end": 1390, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1372, - "end": 1381, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1373, - "end": 1380, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1379, - "end": 1380, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": null, - "default": null - } - ] - } - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1427, - "end": 1465, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1432, - "end": 1435, - "ctxt": 0 - }, - "value": "Obj", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1438, - "end": 1464, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1440, - "end": 1462, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1440, - "end": 1441, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1441, - "end": 1462, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1443, - "end": 1462, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1445, - "end": 1460, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1445, - "end": 1446, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1446, - "end": 1460, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 1448, - "end": 1460, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 1450, - "end": 1458, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 1450, - "end": 1451, - "ctxt": 0 - }, - "value": "c", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1451, - "end": 1458, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1453, - "end": 1458, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1453, - "end": 1458, - "ctxt": 0 - }, - "value": "123", - "raw": "\"123\"" - } - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 1467, - "end": 1618, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 1472, - "end": 1479, - "ctxt": 0 - }, - "value": "GetPath", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1479, - "end": 1485, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1480, - "end": 1481, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1480, - "end": 1481, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 1483, - "end": 1484, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1483, - "end": 1484, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - ] - }, - "typeAnnotation": { - "type": "TsConditionalType", - "span": { - "start": 1492, - "end": 1617, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1492, - "end": 1493, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1492, - "end": 1493, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsTypeOperator", - "span": { - "start": 1502, - "end": 1513, - "ctxt": 0 - }, - "op": "readonly", - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 1511, - "end": 1513, - "ctxt": 0 - }, - "elemTypes": [] - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 1516, - "end": 1517, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1516, - "end": 1517, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "falseType": { - "type": "TsConditionalType", - "span": { - "start": 1524, - "end": 1617, - "ctxt": 0 - }, - "checkType": { - "type": "TsTypeReference", - "span": { - "start": 1524, - "end": 1525, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1524, - "end": 1525, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - }, - "extendsType": { - "type": "TsTypeOperator", - "span": { - "start": 1534, - "end": 1583, - "ctxt": 0 - }, - "op": "readonly", - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 1543, - "end": 1583, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 1544, - "end": 1567, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsInferType", - "span": { - "start": 1544, - "end": 1567, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1550, - "end": 1551, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1550, - "end": 1551, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": { - "type": "TsTypeOperator", - "span": { - "start": 1560, - "end": 1567, - "ctxt": 0 - }, - "op": "keyof", - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1566, - "end": 1567, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1566, - "end": 1567, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - }, - "default": null - } - } - }, - { - "type": "TsTupleElement", - "span": { - "start": 1569, - "end": 1582, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsRestType", - "span": { - "start": 1569, - "end": 1582, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsInferType", - "span": { - "start": 1572, - "end": 1582, - "ctxt": 0 - }, - "typeParam": { - "type": "TsTypeParameter", - "span": { - "start": 1578, - "end": 1582, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1578, - "end": 1582, - "ctxt": 0 - }, - "value": "Rest", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - } - } - } - } - ] - } - }, - "trueType": { - "type": "TsTypeReference", - "span": { - "start": 1586, - "end": 1605, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1586, - "end": 1593, - "ctxt": 0 - }, - "value": "GetPath", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1593, - "end": 1605, - "ctxt": 0 - }, - "params": [ - { - "type": "TsIndexedAccessType", - "span": { - "start": 1594, - "end": 1598, - "ctxt": 0 - }, - "readonly": false, - "objectType": { - "type": "TsTypeReference", - "span": { - "start": 1594, - "end": 1595, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1594, - "end": 1595, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - "indexType": { - "type": "TsTypeReference", - "span": { - "start": 1596, - "end": 1597, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1596, - "end": 1597, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - { - "type": "TsTypeReference", - "span": { - "start": 1600, - "end": 1604, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1600, - "end": 1604, - "ctxt": 0 - }, - "value": "Rest", - "optional": false - }, - "typeParams": null - } - ] - } - }, - "falseType": { - "type": "TsKeywordType", - "span": { - "start": 1612, - "end": 1617, - "ctxt": 0 - }, - "kind": "never" - } - } - } - }, - { - "type": "FunctionDeclaration", - "identifier": { - "type": "Identifier", - "span": { - "start": 1629, - "end": 1632, - "ctxt": 0 - }, - "value": "set", - "optional": false - }, - "declare": false, - "params": [ - { - "type": "Parameter", - "span": { - "start": 1671, - "end": 1677, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1671, - "end": 1677, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1674, - "end": 1677, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1676, - "end": 1677, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1676, - "end": 1677, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1679, - "end": 1686, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1679, - "end": 1686, - "ctxt": 0 - }, - "value": "path", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1683, - "end": 1686, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1685, - "end": 1686, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1685, - "end": 1686, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - } - } - }, - { - "type": "Parameter", - "span": { - "start": 1688, - "end": 1708, - "ctxt": 0 - }, - "decorators": [], - "pat": { - "type": "Identifier", - "span": { - "start": 1688, - "end": 1708, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1693, - "end": 1708, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1695, - "end": 1708, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1695, - "end": 1702, - "ctxt": 0 - }, - "value": "GetPath", - "optional": false - }, - "typeParams": { - "type": "TsTypeParameterInstantiation", - "span": { - "start": 1702, - "end": 1708, - "ctxt": 0 - }, - "params": [ - { - "type": "TsTypeReference", - "span": { - "start": 1703, - "end": 1704, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1703, - "end": 1704, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "typeParams": null - }, - { - "type": "TsTypeReference", - "span": { - "start": 1706, - "end": 1707, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1706, - "end": 1707, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "typeParams": null - } - ] - } - } - } - } - } - ], - "decorators": [], - "span": { - "start": 1620, - "end": 1712, - "ctxt": 0 - }, - "body": { - "type": "BlockStatement", - "span": { - "start": 1710, - "end": 1712, - "ctxt": 0 - }, - "stmts": [] - }, - "generator": false, - "async": false, - "typeParameters": { - "type": "TsTypeParameterDeclaration", - "span": { - "start": 1632, - "end": 1670, - "ctxt": 0 - }, - "parameters": [ - { - "type": "TsTypeParameter", - "span": { - "start": 1633, - "end": 1634, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1633, - "end": 1634, - "ctxt": 0 - }, - "value": "T", - "optional": false - }, - "in": false, - "out": false, - "const": false, - "constraint": null, - "default": null - }, - { - "type": "TsTypeParameter", - "span": { - "start": 1636, - "end": 1669, - "ctxt": 0 - }, - "name": { - "type": "Identifier", - "span": { - "start": 1642, - "end": 1643, - "ctxt": 0 - }, - "value": "P", - "optional": false - }, - "in": false, - "out": false, - "const": true, - "constraint": { - "type": "TsTypeOperator", - "span": { - "start": 1652, - "end": 1669, - "ctxt": 0 - }, - "op": "readonly", - "typeAnnotation": { - "type": "TsArrayType", - "span": { - "start": 1661, - "end": 1669, - "ctxt": 0 - }, - "elemType": { - "type": "TsKeywordType", - "span": { - "start": 1661, - "end": 1667, - "ctxt": 0 - }, - "kind": "string" - } - } - }, - "default": null - } - ] - }, - "returnType": null - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1714, - "end": 1735, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1726, - "end": 1734, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1726, - "end": 1729, - "ctxt": 0 - }, - "value": "obj", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1729, - "end": 1734, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 1731, - "end": 1734, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 1731, - "end": 1734, - "ctxt": 0 - }, - "value": "Obj", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 1736, - "end": 1761, - "ctxt": 0 - }, - "kind": "let", - "declare": true, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 1748, - "end": 1760, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 1748, - "end": 1753, - "ctxt": 0 - }, - "value": "value", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 1753, - "end": 1760, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsLiteralType", - "span": { - "start": 1755, - "end": 1760, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 1755, - "end": 1760, - "ctxt": 0 - }, - "value": "123", - "raw": "\"123\"" - } - } - } - }, - "init": null, - "definite": false - } - ] - }, - { - "type": "ExpressionStatement", - "span": { - "start": 1763, - "end": 1796, - "ctxt": 0 - }, - "expression": { - "type": "CallExpression", - "span": { - "start": 1763, - "end": 1795, - "ctxt": 0 - }, - "callee": { - "type": "Identifier", - "span": { - "start": 1763, - "end": 1766, - "ctxt": 0 - }, - "value": "set", - "optional": false - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1767, - "end": 1770, - "ctxt": 0 - }, - "value": "obj", - "optional": false - } - }, - { - "spread": null, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 1772, - "end": 1787, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1773, - "end": 1776, - "ctxt": 0 - }, - "value": "a", - "raw": "'a'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1778, - "end": 1781, - "ctxt": 0 - }, - "value": "b", - "raw": "'b'" - } - }, - { - "spread": null, - "expression": { - "type": "StringLiteral", - "span": { - "start": 1783, - "end": 1786, - "ctxt": 0 - }, - "value": "c", - "raw": "'c'" - } - } - ] - } - }, - { - "spread": null, - "expression": { - "type": "Identifier", - "span": { - "start": 1789, - "end": 1794, - "ctxt": 0 - }, - "value": "value", - "optional": false - } - } - ], - "typeArguments": null - } - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.ts b/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.ts deleted file mode 100644 index 4a3b3bf5954..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeParameterConstModifiers.ts +++ /dev/null @@ -1,72 +0,0 @@ -// @strict: true - -declare function f1(x: T): T; - -const x11 = f1('a'); -const x12 = f1(['a', ['b', 'c']]); -const x13 = f1({ a: 1, b: "c", d: ["e", 2, true, { f: "g" }] }); - -declare function f2(x: T | undefined): T; - -const x21 = f2('a'); -const x22 = f2(['a', ['b', 'c']]); -const x23 = f2({ a: 1, b: "c", d: ["e", 2, true, { f: "g" }] }); - -declare function f3(x: T): T[]; - -const x31 = f3("hello"); -const x32 = f3("hello"); - -declare function f4(obj: [T, T]): T; - -const x41 = f4([[1, 'x'], [2, 'y']]); -const x42 = f4([{ a: 1, b: 'x' }, { a: 2, b: 'y' }]); - -declare function f5(obj: { x: T, y: T }): T; - -const x51 = f5({ x: [1, 'x'], y: [2, 'y'] }); -const x52 = f5({ x: { a: 1, b: 'x' }, y: { a: 2, b: 'y' } }); - -declare function f6(...args: T): T; - -const x61 = f6(1, 'b', { a: 1, b: 'x' }); - -class C1 { - constructor(x: T) {} - foo(x: U) { return x; } -} - -const c71 = new C1({ a: 1, b: "c", d: ["e", 2, true, { f: "g" }] }); -const c72 = c71.foo(['a', ['b', 'c']]); - -const fx1 = (x: T) => x; -const fx2 = (x: T) => x; - -interface I1 { x: T } // Error - -interface I2 { - f(x: T): T; -} - -type T1 = T; // Error - -type T2 = (x: T) => T; -type T3 = { (x: T): T }; -type T4 = new (x: T) => T; -type T5 = { new (x: T): T }; - -// Corrected repro from #51745 - -type Obj = { a: { b: { c: "123" } } }; - -type GetPath = - P extends readonly [] ? T : - P extends readonly [infer A extends keyof T, ...infer Rest] ? GetPath : - never; - -function set(obj: T, path: P, value: GetPath) {} - -declare let obj: Obj; -declare let value: "123"; - -set(obj, ['a', 'b', 'c'], value); diff --git a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.json b/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.json deleted file mode 100644 index 5ca1e7c12e0..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 24, - "end": 46, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 24, - "end": 46, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 28, - "end": 45, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 29, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypePredicate", - "span": { - "start": 31, - "end": 45, - "ctxt": 0 - }, - "asserts": false, - "paramName": { - "type": "TsThisType", - "span": { - "start": 31, - "end": 35, - "ctxt": 0 - } - }, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 39, - "end": 45, - "ctxt": 0 - }, - "kind": "string" - } - } - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.ts b/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.ts deleted file mode 100644 index 57f811fb4f5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration01.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @declaration: true - -var x: this is string; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.json b/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.json deleted file mode 100644 index 460a4cba028..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 24, - "end": 43, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 24, - "end": 43, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 28, - "end": 32, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 28, - "end": 29, - "ctxt": 0 - }, - "value": "y", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 29, - "end": 32, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 31, - "end": 32, - "ctxt": 0 - }, - "value": "z", - "optional": false - }, - "typeParams": null - } - } - }, - "init": null, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.ts b/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.ts deleted file mode 100644 index c7d3ce52202..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typePredicateOnVariableDeclaration02.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @declaration: true - -var y: z is number; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.json b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.json deleted file mode 100644 index e3ea08a9467..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.json +++ /dev/null @@ -1,1204 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 1, - "end": 486, - "ctxt": 0 - }, - "body": [ - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 1, - "end": 32, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 11, - "end": 13, - "ctxt": 0 - }, - "value": "I1", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 14, - "end": 32, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 20, - "end": 30, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 20, - "end": 21, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 21, - "end": 29, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 23, - "end": 29, - "ctxt": 0 - }, - "kind": "number" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 34, - "end": 65, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 39, - "end": 41, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeLiteral", - "span": { - "start": 44, - "end": 65, - "ctxt": 0 - }, - "members": [ - { - "type": "TsPropertySignature", - "span": { - "start": 50, - "end": 63, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 50, - "end": 51, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 51, - "end": 62, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsUnionType", - "span": { - "start": 53, - "end": 62, - "ctxt": 0 - }, - "types": [ - { - "type": "TsLiteralType", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 53, - "end": 56, - "ctxt": 0 - }, - "value": "a", - "raw": "\"a\"" - } - }, - { - "type": "TsLiteralType", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "literal": { - "type": "StringLiteral", - "span": { - "start": 59, - "end": 62, - "ctxt": 0 - }, - "value": "b", - "raw": "\"b\"" - } - } - ] - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "TsTypeAliasDeclaration", - "span": { - "start": 67, - "end": 97, - "ctxt": 0 - }, - "declare": false, - "id": { - "type": "Identifier", - "span": { - "start": 72, - "end": 74, - "ctxt": 0 - }, - "value": "T2", - "optional": false - }, - "typeParams": null, - "typeAnnotation": { - "type": "TsFunctionType", - "span": { - "start": 77, - "end": 96, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 78, - "end": 87, - "ctxt": 0 - }, - "value": "x", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 79, - "end": 87, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 81, - "end": 87, - "ctxt": 0 - }, - "kind": "string" - } - } - } - ], - "typeParams": null, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 89, - "end": 96, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 92, - "end": 96, - "ctxt": 0 - }, - "kind": "void" - } - } - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 99, - "end": 132, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 105, - "end": 131, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 105, - "end": 107, - "ctxt": 0 - }, - "value": "t1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 110, - "end": 131, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 110, - "end": 118, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 112, - "end": 113, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 115, - "end": 116, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 129, - "end": 131, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 129, - "end": 131, - "ctxt": 0 - }, - "value": "I1", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 139, - "end": 178, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 145, - "end": 177, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 145, - "end": 147, - "ctxt": 0 - }, - "value": "t2", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 150, - "end": 177, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 150, - "end": 164, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 152, - "end": 153, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 155, - "end": 156, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 158, - "end": 159, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "NumericLiteral", - "span": { - "start": 161, - "end": 162, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 175, - "end": 177, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 175, - "end": 177, - "ctxt": 0 - }, - "value": "I1", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 188, - "end": 216, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 194, - "end": 215, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 194, - "end": 196, - "ctxt": 0 - }, - "value": "t3", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 199, - "end": 215, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 199, - "end": 202, - "ctxt": 0 - }, - "properties": [] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 213, - "end": 215, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 213, - "end": 215, - "ctxt": 0 - }, - "value": "I1", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 227, - "end": 266, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 233, - "end": 265, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 233, - "end": 235, - "ctxt": 0 - }, - "value": "t4", - "optional": false, - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 235, - "end": 239, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 237, - "end": 239, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 237, - "end": 239, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "typeParams": null - } - } - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 242, - "end": 265, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 242, - "end": 252, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 244, - "end": 245, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 247, - "end": 250, - "ctxt": 0 - }, - "value": "a", - "raw": "\"a\"" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 263, - "end": 265, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 263, - "end": 265, - "ctxt": 0 - }, - "value": "T1", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 273, - "end": 319, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 279, - "end": 318, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 279, - "end": 281, - "ctxt": 0 - }, - "value": "t5", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 284, - "end": 318, - "ctxt": 0 - }, - "expression": { - "type": "ParenthesisExpression", - "span": { - "start": 284, - "end": 305, - "ctxt": 0 - }, - "expression": { - "type": "ArrowFunctionExpression", - "span": { - "start": 285, - "end": 304, - "ctxt": 0 - }, - "params": [ - { - "type": "Identifier", - "span": { - "start": 285, - "end": 286, - "ctxt": 0 - }, - "value": "m", - "optional": false, - "typeAnnotation": null - } - ], - "body": { - "type": "CallExpression", - "span": { - "start": 290, - "end": 304, - "ctxt": 0 - }, - "callee": { - "type": "MemberExpression", - "span": { - "start": 290, - "end": 301, - "ctxt": 0 - }, - "object": { - "type": "Identifier", - "span": { - "start": 290, - "end": 291, - "ctxt": 0 - }, - "value": "m", - "optional": false - }, - "property": { - "type": "Identifier", - "span": { - "start": 292, - "end": 301, - "ctxt": 0 - }, - "value": "substring", - "optional": false - } - }, - "arguments": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 302, - "end": 303, - "ctxt": 0 - }, - "value": 0.0, - "raw": "0" - } - } - ], - "typeArguments": null - }, - "async": false, - "generator": false, - "typeParameters": null, - "returnType": null - } - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 316, - "end": 318, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 316, - "end": 318, - "ctxt": 0 - }, - "value": "T2", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 327, - "end": 372, - "ctxt": 0 - }, - "kind": "const", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 333, - "end": 371, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 333, - "end": 335, - "ctxt": 0 - }, - "value": "t6", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 338, - "end": 371, - "ctxt": 0 - }, - "expression": { - "type": "ArrayExpression", - "span": { - "start": 338, - "end": 344, - "ctxt": 0 - }, - "elements": [ - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 339, - "end": 340, - "ctxt": 0 - }, - "value": 1.0, - "raw": "1" - } - }, - { - "spread": null, - "expression": { - "type": "NumericLiteral", - "span": { - "start": 342, - "end": 343, - "ctxt": 0 - }, - "value": 2.0, - "raw": "2" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTupleType", - "span": { - "start": 355, - "end": 371, - "ctxt": 0 - }, - "elemTypes": [ - { - "type": "TsTupleElement", - "span": { - "start": 356, - "end": 362, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsKeywordType", - "span": { - "start": 356, - "end": 362, - "ctxt": 0 - }, - "kind": "number" - } - }, - { - "type": "TsTupleElement", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "label": null, - "ty": { - "type": "TsKeywordType", - "span": { - "start": 364, - "end": 370, - "ctxt": 0 - }, - "kind": "number" - } - } - ] - } - }, - "definite": false - } - ] - }, - { - "type": "TsInterfaceDeclaration", - "span": { - "start": 374, - "end": 403, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 384, - "end": 385, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "declare": false, - "typeParams": null, - "extends": [], - "body": { - "type": "TsInterfaceBody", - "span": { - "start": 386, - "end": 403, - "ctxt": 0 - }, - "body": [ - { - "type": "TsPropertySignature", - "span": { - "start": 392, - "end": 401, - "ctxt": 0 - }, - "readonly": false, - "key": { - "type": "Identifier", - "span": { - "start": 392, - "end": 393, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "computed": false, - "optional": false, - "init": null, - "params": [], - "typeAnnotation": { - "type": "TsTypeAnnotation", - "span": { - "start": 393, - "end": 401, - "ctxt": 0 - }, - "typeAnnotation": { - "type": "TsKeywordType", - "span": { - "start": 395, - "end": 401, - "ctxt": 0 - }, - "kind": "string" - } - }, - "typeParams": null - } - ] - } - }, - { - "type": "VariableDeclaration", - "span": { - "start": 404, - "end": 439, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 408, - "end": 438, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 408, - "end": 410, - "ctxt": 0 - }, - "value": "t7", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 413, - "end": 438, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 413, - "end": 426, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 415, - "end": 416, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 418, - "end": 424, - "ctxt": 0 - }, - "value": "test", - "raw": "'test'" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 437, - "end": 438, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 437, - "end": 438, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 440, - "end": 486, - "ctxt": 0 - }, - "kind": "let", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 444, - "end": 485, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 444, - "end": 446, - "ctxt": 0 - }, - "value": "t8", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "TsSatisfiesExpression", - "span": { - "start": 449, - "end": 485, - "ctxt": 0 - }, - "expression": { - "type": "ObjectExpression", - "span": { - "start": 449, - "end": 473, - "ctxt": 0 - }, - "properties": [ - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 451, - "end": 452, - "ctxt": 0 - }, - "value": "a", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 454, - "end": 460, - "ctxt": 0 - }, - "value": "test", - "raw": "'test'" - } - }, - { - "type": "KeyValueProperty", - "key": { - "type": "Identifier", - "span": { - "start": 462, - "end": 463, - "ctxt": 0 - }, - "value": "b", - "optional": false - }, - "value": { - "type": "StringLiteral", - "span": { - "start": 465, - "end": 471, - "ctxt": 0 - }, - "value": "test", - "raw": "'test'" - } - } - ] - }, - "typeAnnotation": { - "type": "TsTypeReference", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 - }, - "typeName": { - "type": "Identifier", - "span": { - "start": 484, - "end": 485, - "ctxt": 0 - }, - "value": "A", - "optional": false - }, - "typeParams": null - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.ts b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.ts deleted file mode 100644 index 5e268ffb1e1..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction.ts +++ /dev/null @@ -1,24 +0,0 @@ -interface I1 { - a: number; -} - -type T1 = { - a: "a" | "b"; -} - -type T2 = (x: string) => void; - -const t1 = { a: 1 } satisfies I1; // Ok -const t2 = { a: 1, b: 1 } satisfies I1; // Error -const t3 = { } satisfies I1; // Error - -const t4: T1 = { a: "a" } satisfies T1; // Ok -const t5 = (m => m.substring(0)) satisfies T2; // Ok - -const t6 = [1, 2] satisfies [number, number]; - -interface A { - a: string -} -let t7 = { a: 'test' } satisfies A; -let t8 = { a: 'test', b: 'test' } satisfies A; diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.json b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.json new file mode 100644 index 00000000000..932dbaf1bee --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.json @@ -0,0 +1,610 @@ +{ + "type": "Script", + "span": { + "start": 19, + "end": 312, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 19, + "end": 204, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 23, + "end": 203, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 23, + "end": 26, + "ctxt": 0 + }, + "value": "obj", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 26, + "end": 76, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 28, + "end": 76, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 28, + "end": 50, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 30, + "end": 48, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 30, + "end": 31, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 32, + "end": 41, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 33, + "end": 41, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 35, + "end": 41, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 42, + "end": 48, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 44, + "end": 48, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": null + } + ] + }, + { + "type": "TsTypeReference", + "span": { + "start": 53, + "end": 76, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 53, + "end": 59, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 59, + "end": 76, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 60, + "end": 66, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 68, + "end": 75, + "ctxt": 0 + }, + "kind": "unknown" + } + ] + } + } + ] + } + } + }, + "init": { + "type": "TsSatisfiesExpression", + "span": { + "start": 79, + "end": 203, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 79, + "end": 144, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 85, + "end": 86, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 87, + "end": 88, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 87, + "end": 88, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 85, + "end": 93, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 90, + "end": 93, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 134, + "end": 135, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 136, + "end": 137, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 136, + "end": 137, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 134, + "end": 142, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 139, + "end": 142, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 155, + "end": 203, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 155, + "end": 177, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 157, + "end": 175, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 157, + "end": 158, + "ctxt": 0 + }, + "value": "g", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 159, + "end": 168, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 160, + "end": 168, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 162, + "end": 168, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 169, + "end": 175, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 171, + "end": 175, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": null + } + ] + }, + { + "type": "TsTypeReference", + "span": { + "start": 180, + "end": 203, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 180, + "end": 186, + "ctxt": 0 + }, + "value": "Record", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 186, + "end": 203, + "ctxt": 0 + }, + "params": [ + { + "type": "TsKeywordType", + "span": { + "start": 187, + "end": 193, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 195, + "end": 202, + "ctxt": 0 + }, + "kind": "unknown" + } + ] + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 264, + "end": 312, + "ctxt": 0 + }, + "expression": { + "type": "TsSatisfiesExpression", + "span": { + "start": 264, + "end": 311, + "ctxt": 0 + }, + "expression": { + "type": "ParenthesisExpression", + "span": { + "start": 264, + "end": 278, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 265, + "end": 277, + "ctxt": 0 + }, + "properties": [ + { + "type": "MethodProperty", + "key": { + "type": "Identifier", + "span": { + "start": 267, + "end": 268, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "params": [ + { + "type": "Parameter", + "span": { + "start": 269, + "end": 270, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 269, + "end": 270, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + } + } + ], + "decorators": [], + "span": { + "start": 267, + "end": 275, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 272, + "end": 275, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ] + } + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 289, + "end": 311, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 291, + "end": 309, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 291, + "end": 292, + "ctxt": 0 + }, + "value": "f", + "optional": false + }, + "computed": false, + "optional": false, + "params": [ + { + "type": "Identifier", + "span": { + "start": 293, + "end": 302, + "ctxt": 0 + }, + "value": "s", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 294, + "end": 302, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 296, + "end": 302, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 303, + "end": 309, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 305, + "end": 309, + "ctxt": 0 + }, + "kind": "void" + } + }, + "typeParams": null + } + ] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.ts b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.ts new file mode 100644 index 00000000000..597a1eed2bd --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_contextualTyping2.ts @@ -0,0 +1,9 @@ +// @strict: true + +let obj: { f(s: string): void } & Record = { + f(s) { }, // "incorrect" implicit any on 's' + g(s) { } +} satisfies { g(s: string): void } & Record; + +// This needs to not crash (outer node is not expression) +({ f(x) { } }) satisfies { f(s: string): void }; diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.json b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.json new file mode 100644 index 00000000000..e79a28f1fd8 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.json @@ -0,0 +1,360 @@ +{ + "type": "Script", + "span": { + "start": 1, + "end": 123, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 1, + "end": 48, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 7, + "end": 47, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 7, + "end": 8, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8, + "end": 15, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 10, + "end": 15, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 10, + "end": 15, + "ctxt": 0 + }, + "value": "baz", + "raw": "\"baz\"" + } + } + } + }, + "init": { + "type": "TsSatisfiesExpression", + "span": { + "start": 18, + "end": 47, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 18, + "end": 23, + "ctxt": 0 + }, + "value": "foo", + "raw": "\"foo\"" + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 34, + "end": 47, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 34, + "end": 39, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 34, + "end": 39, + "ctxt": 0 + }, + "value": "foo", + "raw": "\"foo\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 42, + "end": 47, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 42, + "end": 47, + "ctxt": 0 + }, + "value": "bar", + "raw": "\"bar\"" + } + } + ] + } + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 49, + "end": 123, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 55, + "end": 122, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 55, + "end": 56, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 56, + "end": 72, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 58, + "end": 72, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 60, + "end": 70, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 60, + "end": 63, + "ctxt": 0 + }, + "value": "xyz", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 63, + "end": 70, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 65, + "end": 70, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 65, + "end": 70, + "ctxt": 0 + }, + "value": "baz", + "raw": "\"baz\"" + } + } + }, + "typeParams": null + } + ] + } + } + }, + "init": { + "type": "TsSatisfiesExpression", + "span": { + "start": 75, + "end": 122, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 75, + "end": 89, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 77, + "end": 80, + "ctxt": 0 + }, + "value": "xyz", + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 82, + "end": 87, + "ctxt": 0 + }, + "value": "foo", + "raw": "\"foo\"" + } + } + ] + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 100, + "end": 122, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 102, + "end": 120, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 102, + "end": 105, + "ctxt": 0 + }, + "value": "xyz", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 105, + "end": 120, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 107, + "end": 120, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 107, + "end": 112, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 107, + "end": 112, + "ctxt": 0 + }, + "value": "foo", + "raw": "\"foo\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 115, + "end": 120, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 115, + "end": 120, + "ctxt": 0 + }, + "value": "bar", + "raw": "\"bar\"" + } + } + ] + } + }, + "typeParams": null + } + ] + } + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.ts b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.ts new file mode 100644 index 00000000000..92af1c521b2 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeSatisfaction_vacuousIntersectionOfContextualTypes.ts @@ -0,0 +1,2 @@ +const a: "baz" = "foo" satisfies "foo" | "bar"; +const b: { xyz: "baz" } = { xyz: "foo" } satisfies { xyz: "foo" | "bar" }; diff --git a/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.json b/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.json new file mode 100644 index 00000000000..61ef7995c3c --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.json @@ -0,0 +1,423 @@ +{ + "type": "Module", + "span": { + "start": 48, + "end": 335, + "ctxt": 0 + }, + "body": [ + { + "type": "ImportDeclaration", + "span": { + "start": 48, + "end": 82, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 56, + "end": 64, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 56, + "end": 64, + "ctxt": 0 + }, + "value": "classMap", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 71, + "end": 81, + "ctxt": 0 + }, + "value": "./lit.js", + "raw": "'./lit.js'" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 83, + "end": 111, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 90, + "end": 111, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 96, + "end": 110, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 96, + "end": 97, + "ctxt": 0 + }, + "value": "c", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 100, + "end": 110, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 100, + "end": 108, + "ctxt": 0 + }, + "value": "classMap", + "optional": false + }, + "arguments": [], + "typeArguments": null + }, + "definite": false + } + ] + } + }, + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 140, + "end": 157, + "ctxt": 0 + }, + "value": "ClassMapDirective", + "optional": false + }, + "declare": false, + "span": { + "start": 134, + "end": 160, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 162, + "end": 194, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 175, + "end": 192, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 175, + "end": 192, + "ctxt": 0 + }, + "value": "ClassMapDirective", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 196, + "end": 280, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 203, + "end": 280, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 209, + "end": 279, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 209, + "end": 218, + "ctxt": 0 + }, + "value": "directive", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 223, + "end": 279, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 227, + "end": 236, + "ctxt": 0 + }, + "value": "class_", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 233, + "end": 236, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 235, + "end": 236, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 235, + "end": 236, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "ArrowFunctionExpression", + "span": { + "start": 243, + "end": 279, + "ctxt": 0 + }, + "params": [], + "body": { + "type": "ParenthesisExpression", + "span": { + "start": 249, + "end": 279, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 250, + "end": 278, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 256, + "end": 265, + "ctxt": 0 + }, + "value": "directive", + "optional": false + }, + "value": { + "type": "Identifier", + "span": { + "start": 267, + "end": 273, + "ctxt": 0 + }, + "value": "class_", + "optional": false + } + } + ] + } + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "async": false, + "generator": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 223, + "end": 226, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 224, + "end": 225, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 224, + "end": 225, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 282, + "end": 335, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 289, + "end": 335, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 295, + "end": 334, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 295, + "end": 303, + "ctxt": 0 + }, + "value": "classMap", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 306, + "end": 334, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 306, + "end": 315, + "ctxt": 0 + }, + "value": "directive", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 316, + "end": 333, + "ctxt": 0 + }, + "value": "ClassMapDirective", + "optional": false + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.ts b/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.ts new file mode 100644 index 00000000000..aabf57bcc01 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/typeofImportTypeOnlyExport.ts @@ -0,0 +1,18 @@ +// @declaration: true + +// @Filename: button.ts +import {classMap} from './lit.js'; +export const c = classMap(); + +// @Filename: lit.ts +class ClassMapDirective {} + +export type {ClassMapDirective}; + +export const directive = + (class_: C) => + () => ({ + directive: class_, + }); + +export const classMap = directive(ClassMapDirective); diff --git a/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.json deleted file mode 100644 index 61d2a39c1f4..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 52, - "end": 132, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 52, - "end": 74, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 56, - "end": 65, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 56, - "end": 59, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 62, - "end": 65, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 113, - "end": 132, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 117, - "end": 130, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 117, - "end": 121, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 124, - "end": 130, - "ctxt": 0 - }, - "operator": "typeof", - "argument": { - "type": "Invalid", - "span": { - "start": 130, - "end": 130, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.ts deleted file mode 100644 index 63cb2f2c05b..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/typeofOperatorInvalidOperations.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Unary operator typeof - -// opreand before typeof -var ANY = ANY typeof ; //expect error - -// miss an operand -var ANY1 = typeof ; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES5.ts index 7e65b0e4dc9..fb17d4fe174 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{0}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES6.ts index 789fe4e49a8..2cc08c64d0e 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions01_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{0}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES5.ts index 2713741622a..c0646ebfd9b 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{00}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES6.ts index 987167f6bb0..49a978be18a 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{00}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES5.ts index 7ff057a3ff2..fa7591beaf3 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{0000}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES6.ts index 86108cabc1f..bbbb0d82347 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions03_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{0000}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES5.ts index 9b35bb8b115..691561e0b37 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{00000000}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES6.ts index 5f19d384733..5d71bd47491 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions04_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{00000000}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES5.ts index 5f94235cca1..3168a31bc3c 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES6.ts index 1de2d60f1c1..8923d3a30ca 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions05_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES5.ts index a6d6c8dea15..5df04b66c5b 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES6.ts index 6e12ac83d1d..43356dc1ac7 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions06_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES5.ts index 623a468ce3b..3dd44799055 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES6.ts index bbec45a8fa2..c81b234120f 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions07_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES5.ts index 5d009c09fe8..efdce6111a2 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES6.ts index 4b070ddf6b9..dac6b989d27 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions08_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES5.ts index 27cec15841e..9bc156bfbad 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES6.ts index 620ea370902..7a3e8476332 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions09_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES5.ts index 09bcbbb45bf..951d069dbfb 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES6.ts index 6b0f052b3c2..d06679d91e5 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions10_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES5.ts index 438cc43439b..bef89da13e0 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES6.ts index c94777f5ec4..5d3b12cba90 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions11_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES5.ts index ed9725f0d38..794de1064bb 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{FFFFFFFF}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES6.ts index 9fc189aab8c..9cdddc654db 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions12_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{FFFFFFFF}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES5.ts index 36ff1d3236f..87b79ef8282 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{DDDDD}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES6.ts index be635499d30..84ab3f40861 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions13_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{DDDDD}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES5.ts index c6a50a017de..9723ef442b1 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // Shouldn't work, negatives are not allowed. var x = /\u{-DDDD}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES6.ts index f3191cf29db..3c71f531896 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions14_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // Shouldn't work, negatives are not allowed. var x = /\u{-DDDD}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES5.ts index 20312b0684f..7f693ef2e9a 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{abcd}\u{ef12}\u{3456}\u{7890}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES6.ts index 70dfba82d9c..cd2691b8b66 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions15_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{abcd}\u{ef12}\u{3456}\u{7890}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES5.ts index 7ef9ab56fcc..770da6d897f 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{ABCD}\u{EF12}\u{3456}\u{7890}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES6.ts index 39d0392dcb7..5131821d533 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions16_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{ABCD}\u{EF12}\u{3456}\u{7890}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES5.ts index 137e837a964..6577a19639d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{r}\u{n}\u{t}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES6.ts index a60dbc83e7e..fd446d279f0 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions17_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{r}\u{n}\u{t}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES5.ts index f0b5ae760ce..5712dbd5b5f 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{65}\u{65}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES6.ts index e7be6de755a..eb6fb91403e 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions18_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{65}\u{65}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES5.ts index e654d01491f..2faf29cc5aa 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = /\u{}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES6.ts index 97213843572..e4b3e54e4b7 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInRegularExpressions19_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = /\u{}/g; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES5.ts index def5191e123..72149ae42e2 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{0}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES6.ts index 47c50782c23..9ee0864f2fe 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings01_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{0}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES5.ts index 29843144382..1516bd8f541 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{00}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES6.ts index 86276af078c..4594b128d9e 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{00}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES5.ts index 6dd1bf24fcc..eee357a6524 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{0000}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES6.ts index 82a82fe2b6b..38b349c9f57 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings03_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{0000}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES5.ts index 9174872f04f..aa9d4a62b10 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{00000000}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES6.ts index 1455d14d254..6a6cd166c9a 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings04_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{00000000}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES5.ts index e18a2f3efa5..c761518bcee 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES6.ts index 282f0394719..f7252f8e3dc 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings05_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES5.ts index ad076430c50..510e72c0985 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES6.ts index f1c475175f7..827f0d7ed59 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings06_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES5.ts index fe1c6363fa1..e20f00e3626 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES6.ts index 4caeaa59673..b8e8767eb65 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings08_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES5.ts index 520dd9ad066..3a3314721a7 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES6.ts index ccfd89fec2f..2cd0f1427b2 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings09_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES5.ts index 5e6f327d887..3e4d8431c13 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES6.ts index 93a1ecf89cd..95588cceec9 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings10_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES5.ts index 6669abf2e95..ab074d6aaac 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES6.ts index 1159bee5bf5..7f0a7a120b6 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings11_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES5.ts index 99de55a02b5..ecdd6acfdd6 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{DDDDD}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES6.ts index 19ea2aaf496..5d87e74e411 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings13_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{DDDDD}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES5.ts index a1207851524..7ef68b3b9a3 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{abcd}\u{ef12}\u{3456}\u{7890}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES6.ts index 22d8ad56bcd..0e67bc06bf5 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings15_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{abcd}\u{ef12}\u{3456}\u{7890}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES5.ts index 03798ea593b..23477a809e3 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{ABCD}\u{EF12}\u{3456}\u{7890}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES6.ts index f1cbbbec460..20922f61122 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings16_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{ABCD}\u{EF12}\u{3456}\u{7890}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES5.ts index ee2fec1c2a1..a6626df1870 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{65}\u{65}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES6.ts index 54124b9f588..e331524f741 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings18_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{65}\u{65}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES5.ts index 6c81941acc5..e682f6cd57d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = "\u{00000000000067}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES6.ts index c810e34fd19..0ad6292ec3d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInStrings23_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = "\u{00000000000067}"; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES5.ts index 826cc11adcd..98673c72b48 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{0}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES6.ts index b68f40b092e..fbec597cf00 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates01_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{0}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES5.ts index fafd1946af8..620851000d6 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{00}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES6.ts index 2923bf73a57..33b48990e72 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates02_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{00}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES5.ts index 4706db60ece..0dbc8a6e028 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{0000}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES6.ts index c0239bc6403..7693ef2a45f 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates03_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{0000}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES5.ts index 2387d517b3e..261c19ff82a 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{00000000}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES6.ts index ae2302af4a5..78d58d582e5 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates04_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{00000000}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES5.ts index a0a863cdfa3..4e5401609de 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES6.ts index 64273ab59ee..18a922d7d8d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates05_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}\u{20}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES5.ts index 0f98f4d69d8..71a19aa87d8 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES6.ts index 760554e0668..8f1acca18b9 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates06_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 1. Assert: 0 ≤ cp ≤ 0x10FFFF. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES5.ts index 16899fe5083..b684279913c 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES6.ts index f796b35c1bd..4a45a1a4302 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates08_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES5.ts index ae646ae8187..e94af846600 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES6.ts index 1bf4e2b6fc4..ce0b03ce13a 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates09_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. If cp ≤ 65535, return cp. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES5.ts index 6d702ae84a1..048b09ec220 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES6.ts index d01e9c78461..10e637ba9dc 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates10_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES5.ts index e21b8e6008a..4bcecbec325 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES5.ts @@ -1,4 +1,4 @@ -// @target: es5 +// @target: es5 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES6.ts index 2f30b9923f2..db8a92da612 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates11_ES6.ts @@ -1,4 +1,4 @@ -// @target: es6 +// @target: es6 // ES6 Spec - 10.1.1 Static Semantics: UTF16Encoding (cp) // 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00. diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES5.ts index 0126a605fc8..22ffa0db60d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{DDDDD}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES6.ts index 8fb2fa4f73f..05306e9bffb 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates13_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{DDDDD}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES5.ts index 04b53cbc809..484d5c38492 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{abcd}\u{ef12}\u{3456}\u{7890}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES6.ts index 8bb65e99f5f..37ec40af2e1 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates15_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{abcd}\u{ef12}\u{3456}\u{7890}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES5.ts index ad4cf0ff97a..16a6915d434 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{ABCD}\u{EF12}\u{3456}\u{7890}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES6.ts index 7e337fca579..0281625bc4f 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates16_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{ABCD}\u{EF12}\u{3456}\u{7890}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES5.ts index f9762de1a6d..57f2b47708c 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{65}\u{65}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES6.ts index e7efce43e4d..e8fad7a9110 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates18_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{65}\u{65}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES5.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES5.ts index 5e119e4897a..0b16b144004 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES5.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES5.ts @@ -1,3 +1,3 @@ -// @target: es5 +// @target: es5 var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES6.ts b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES6.ts index 6d8f05fc72f..7f2b9cac5ea 100644 --- a/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES6.ts +++ b/crates/swc_ecma_parser/tests/tsc/unicodeExtendedEscapesInTemplates20_ES6.ts @@ -1,3 +1,3 @@ -// @target: es6 +// @target: es6 var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; diff --git a/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json b/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json index 13785c1320f..37c36206a9c 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json +++ b/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.json @@ -2,7 +2,7 @@ "type": "Module", "span": { "start": 60, - "end": 2093, + "end": 2282, "ctxt": 0 }, "body": [ @@ -5703,6 +5703,434 @@ "definite": false } ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 2142, + "end": 2208, + "ctxt": 0 + }, + "kind": "let", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 2154, + "end": 2207, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2154, + "end": 2155, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2155, + "end": 2207, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2157, + "end": 2207, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2157, + "end": 2160, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2158, + "end": 2159, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2158, + "end": 2159, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2163, + "end": 2207, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 2166, + "end": 2207, + "ctxt": 0 + }, + "types": [ + { + "type": "TsParenthesizedType", + "span": { + "start": 2166, + "end": 2197, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2167, + "end": 2196, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2167, + "end": 2168, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2167, + "end": 2168, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2177, + "end": 2181, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2177, + "end": 2181, + "ctxt": 0 + }, + "value": true + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 2184, + "end": 2188, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2184, + "end": 2188, + "ctxt": 0 + }, + "value": true + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 2191, + "end": 2196, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2191, + "end": 2196, + "ctxt": 0 + }, + "value": false + } + } + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 2200, + "end": 2207, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 2209, + "end": 2275, + "ctxt": 0 + }, + "kind": "let", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 2221, + "end": 2274, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 2221, + "end": 2222, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2222, + "end": 2274, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsFunctionType", + "span": { + "start": 2224, + "end": 2274, + "ctxt": 0 + }, + "params": [], + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2224, + "end": 2227, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2225, + "end": 2226, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2225, + "end": 2226, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2230, + "end": 2274, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 2233, + "end": 2274, + "ctxt": 0 + }, + "types": [ + { + "type": "TsParenthesizedType", + "span": { + "start": 2233, + "end": 2264, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 2234, + "end": 2263, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 2234, + "end": 2235, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2234, + "end": 2235, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsLiteralType", + "span": { + "start": 2244, + "end": 2248, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2244, + "end": 2248, + "ctxt": 0 + }, + "value": true + } + }, + "trueType": { + "type": "TsLiteralType", + "span": { + "start": 2251, + "end": 2255, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2251, + "end": 2255, + "ctxt": 0 + }, + "value": true + } + }, + "falseType": { + "type": "TsLiteralType", + "span": { + "start": 2258, + "end": 2263, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 2258, + "end": 2263, + "ctxt": 0 + }, + "value": false + } + } + } + }, + { + "type": "TsKeywordType", + "span": { + "start": 2267, + "end": 2274, + "ctxt": 0 + }, + "kind": "boolean" + } + ] + } + } + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExpressionStatement", + "span": { + "start": 2276, + "end": 2282, + "ctxt": 0 + }, + "expression": { + "type": "AssignmentExpression", + "span": { + "start": 2276, + "end": 2281, + "ctxt": 0 + }, + "operator": "=", + "left": { + "type": "Identifier", + "span": { + "start": 2276, + "end": 2277, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "right": { + "type": "Identifier", + "span": { + "start": 2280, + "end": 2281, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } } ], "interpreter": null diff --git a/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.ts b/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.ts index 5aea6843c84..e5e36219369 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionAndIntersectionInference3.ts @@ -88,3 +88,9 @@ declare function foo(obj: T & AB): [T, U]; declare let ab: AB; let z = foo(ab); // [AB, string] + +// Repro from #51399 + +declare let a: () => (T extends true ? true : false) & boolean; +declare let b: () => (T extends true ? true : false) & boolean; +a = b; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures.ts index e2ce8959e9e..5aea75a80dd 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures.ts @@ -1,4 +1,4 @@ -var numOrDate: number | Date; +var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures2.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures2.ts index 089529955fb..cd68a7fd915 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures2.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures2.ts @@ -1,4 +1,4 @@ -interface A { +interface A { (x: number): number; (x: string, y?: string): boolean; (x: Date): void; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures3.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures3.ts index 139509f8af5..56339f5d3d7 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures3.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures3.ts @@ -1,4 +1,4 @@ -function f1(s: string) { } +function f1(s: string) { } function f2(s?: string) { } function f3(...s: string[]) { } function f4(s: string, s2?: string) { } diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures4.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures4.ts index c65c3f96033..63d55761301 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures4.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeCallSignatures4.ts @@ -1,4 +1,4 @@ -type F1 = (a: string, b?: string) => void; +type F1 = (a: string, b?: string) => void; type F2 = (a: string, b?: string, c?: string) => void; type F3 = (a: string, ...rest: string[]) => void; type F4 = (a: string, b?: string, ...rest: string[]) => void; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeConstructSignatures.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeConstructSignatures.ts index af0ec598dfe..6bf630bf423 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeConstructSignatures.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeConstructSignatures.ts @@ -1,4 +1,4 @@ -var numOrDate: number | Date; +var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeEquivalence.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeEquivalence.ts index 3dfe3dad42c..821eb35d6d4 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeEquivalence.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeEquivalence.ts @@ -1,4 +1,4 @@ -// A | B is equivalent to A if B is a subtype of A +// A | B is equivalent to A if B is a subtype of A class C { } class D extends C { foo() { } } var x: C; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeFromArrayLiteral.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeFromArrayLiteral.ts index 794d7630e00..83089f767dd 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeFromArrayLiteral.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeFromArrayLiteral.ts @@ -1,4 +1,4 @@ -// The resulting type an array literal expression is determined as follows: +// The resulting type an array literal expression is determined as follows: // If the array literal is empty, the resulting type is an array type with the element type Undefined. // Otherwise, if the array literal is contextually typed by a type that has a property with the numeric name ‘0’, the resulting type is a tuple type constructed from the types of the element expressions. // Otherwise, the resulting type is an array type with an element type that is the union of the types of the element expressions. diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeIndexSignature.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeIndexSignature.ts index 37940a6b8f7..8cf78122d5c 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeIndexSignature.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeIndexSignature.ts @@ -1,4 +1,4 @@ -var numOrDate: number | Date; +var numOrDate: number | Date; var anyVar: number; // If each type in U has a string index signature, diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypeMembers.ts b/crates/swc_ecma_parser/tests/tsc/unionTypeMembers.ts index 631540de61c..b447fd1eec6 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypeMembers.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypeMembers.ts @@ -1,4 +1,4 @@ -interface I1 { +interface I1 { commonMethodType(a: string): string; commonPropertyType: string; diff --git a/crates/swc_ecma_parser/tests/tsc/unionTypesAssignability.ts b/crates/swc_ecma_parser/tests/tsc/unionTypesAssignability.ts index 99dfc627617..90f16b6d15d 100644 --- a/crates/swc_ecma_parser/tests/tsc/unionTypesAssignability.ts +++ b/crates/swc_ecma_parser/tests/tsc/unionTypesAssignability.ts @@ -1,4 +1,4 @@ -var unionNumberString: number | string; +var unionNumberString: number | string; class C { } class D extends C { foo1() { } } class E extends C { foo2() { } } diff --git a/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.json b/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.json new file mode 100644 index 00000000000..09997ef6926 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.json @@ -0,0 +1,14277 @@ +{ + "type": "Script", + "span": { + "start": 41, + "end": 9005, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 41, + "end": 64, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 46, + "end": 49, + "ctxt": 0 + }, + "value": "T01", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 52, + "end": 63, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 52, + "end": 54, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 57, + "end": 63, + "ctxt": 0 + }, + "kind": "string" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 76, + "end": 96, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 81, + "end": 84, + "ctxt": 0 + }, + "value": "T02", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 87, + "end": 95, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 87, + "end": 89, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsLiteralType", + "span": { + "start": 92, + "end": 95, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 92, + "end": 95, + "ctxt": 0 + }, + "value": "a", + "raw": "'a'" + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 105, + "end": 128, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 110, + "end": 113, + "ctxt": 0 + }, + "value": "T03", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 116, + "end": 127, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 116, + "end": 118, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 121, + "end": 127, + "ctxt": 0 + }, + "kind": "object" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 140, + "end": 170, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 145, + "end": 148, + "ctxt": 0 + }, + "value": "T04", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 151, + "end": 169, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 151, + "end": 153, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 156, + "end": 169, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 158, + "end": 167, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 158, + "end": 159, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 159, + "end": 167, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 161, + "end": 167, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + } + ] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 189, + "end": 210, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 194, + "end": 197, + "ctxt": 0 + }, + "value": "T05", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 200, + "end": 209, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 200, + "end": 202, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 205, + "end": 209, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 221, + "end": 247, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 226, + "end": 229, + "ctxt": 0 + }, + "value": "T06", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 232, + "end": 246, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 232, + "end": 234, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 237, + "end": 246, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 258, + "end": 286, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 263, + "end": 266, + "ctxt": 0 + }, + "value": "T07", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 269, + "end": 285, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 269, + "end": 278, + "ctxt": 0 + }, + "kind": "undefined" + }, + { + "type": "TsKeywordType", + "span": { + "start": 281, + "end": 285, + "ctxt": 0 + }, + "kind": "void" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 302, + "end": 325, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 307, + "end": 310, + "ctxt": 0 + }, + "value": "T10", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 313, + "end": 324, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 313, + "end": 319, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 322, + "end": 324, + "ctxt": 0 + }, + "members": [] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 350, + "end": 373, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 355, + "end": 358, + "ctxt": 0 + }, + "value": "T11", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 361, + "end": 372, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 361, + "end": 367, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 370, + "end": 372, + "ctxt": 0 + }, + "members": [] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 398, + "end": 421, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 403, + "end": 406, + "ctxt": 0 + }, + "value": "T12", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 409, + "end": 420, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 409, + "end": 415, + "ctxt": 0 + }, + "kind": "bigint" + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 418, + "end": 420, + "ctxt": 0 + }, + "members": [] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 447, + "end": 466, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 452, + "end": 460, + "ctxt": 0 + }, + "value": "ThisNode", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 463, + "end": 465, + "ctxt": 0 + }, + "members": [] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 467, + "end": 486, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 472, + "end": 480, + "ctxt": 0 + }, + "value": "ThatNode", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 483, + "end": 485, + "ctxt": 0 + }, + "members": [] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 487, + "end": 529, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 492, + "end": 506, + "ctxt": 0 + }, + "value": "ThisOrThatNode", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 509, + "end": 528, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 509, + "end": 517, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 509, + "end": 517, + "ctxt": 0 + }, + "value": "ThisNode", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 520, + "end": 528, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 520, + "end": 528, + "ctxt": 0 + }, + "value": "ThatNode", + "optional": false + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 540, + "end": 543, + "ctxt": 0 + }, + "value": "f01", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 544, + "end": 554, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 544, + "end": 554, + "ctxt": 0 + }, + "value": "u", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 545, + "end": 554, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 547, + "end": 554, + "ctxt": 0 + }, + "kind": "unknown" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 531, + "end": 734, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 556, + "end": 734, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 562, + "end": 577, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 566, + "end": 576, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 566, + "end": 568, + "ctxt": 0 + }, + "value": "x1", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 568, + "end": 572, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 570, + "end": 572, + "ctxt": 0 + }, + "members": [] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 575, + "end": 576, + "ctxt": 0 + }, + "value": "u", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 592, + "end": 626, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 596, + "end": 625, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 596, + "end": 598, + "ctxt": 0 + }, + "value": "x2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 598, + "end": 621, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 600, + "end": 621, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 600, + "end": 602, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 605, + "end": 609, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 612, + "end": 621, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 624, + "end": 625, + "ctxt": 0 + }, + "value": "u", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 631, + "end": 681, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 635, + "end": 680, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 635, + "end": 637, + "ctxt": 0 + }, + "value": "x3", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 637, + "end": 676, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 639, + "end": 676, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 639, + "end": 641, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 644, + "end": 657, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 646, + "end": 655, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 646, + "end": 647, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 647, + "end": 655, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 649, + "end": 655, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + }, + { + "type": "TsKeywordType", + "span": { + "start": 660, + "end": 664, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 667, + "end": 676, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 679, + "end": 680, + "ctxt": 0 + }, + "value": "u", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 686, + "end": 732, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 690, + "end": 731, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 690, + "end": 692, + "ctxt": 0 + }, + "value": "x4", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 692, + "end": 727, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 694, + "end": 727, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 694, + "end": 708, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 694, + "end": 708, + "ctxt": 0 + }, + "value": "ThisOrThatNode", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 711, + "end": 715, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 718, + "end": 727, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 730, + "end": 731, + "ctxt": 0 + }, + "value": "u", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 745, + "end": 748, + "ctxt": 0 + }, + "value": "f10", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 749, + "end": 759, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 749, + "end": 759, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 750, + "end": 759, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 752, + "end": 759, + "ctxt": 0 + }, + "kind": "unknown" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 736, + "end": 919, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 761, + "end": 919, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 767, + "end": 839, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 771, + "end": 772, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 774, + "end": 799, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 784, + "end": 786, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 784, + "end": 785, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 809, + "end": 839, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 819, + "end": 821, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 819, + "end": 820, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 844, + "end": 917, + "ctxt": 0 + }, + "test": { + "type": "UnaryExpression", + "span": { + "start": 848, + "end": 850, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "Identifier", + "span": { + "start": 849, + "end": 850, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 852, + "end": 882, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 862, + "end": 864, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 862, + "end": 863, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 892, + "end": 917, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 902, + "end": 904, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 902, + "end": 903, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 930, + "end": 933, + "ctxt": 0 + }, + "value": "f11", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 937, + "end": 941, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 937, + "end": 941, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 938, + "end": 941, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 940, + "end": 941, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 940, + "end": 941, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 921, + "end": 1097, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 943, + "end": 1097, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 949, + "end": 1019, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 953, + "end": 954, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 956, + "end": 985, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 966, + "end": 968, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 966, + "end": 967, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 995, + "end": 1019, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1005, + "end": 1007, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1005, + "end": 1006, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1024, + "end": 1095, + "ctxt": 0 + }, + "test": { + "type": "UnaryExpression", + "span": { + "start": 1028, + "end": 1030, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "Identifier", + "span": { + "start": 1029, + "end": 1030, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1032, + "end": 1056, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1042, + "end": 1044, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1042, + "end": 1043, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1066, + "end": 1095, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1076, + "end": 1078, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1076, + "end": 1077, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 933, + "end": 936, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 934, + "end": 935, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 934, + "end": 935, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1108, + "end": 1111, + "ctxt": 0 + }, + "value": "f12", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1126, + "end": 1130, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1126, + "end": 1130, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1127, + "end": 1130, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1129, + "end": 1130, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1129, + "end": 1130, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1099, + "end": 1205, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1132, + "end": 1205, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 1138, + "end": 1203, + "ctxt": 0 + }, + "test": { + "type": "Identifier", + "span": { + "start": 1142, + "end": 1143, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1145, + "end": 1169, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1155, + "end": 1157, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1155, + "end": 1156, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1179, + "end": 1203, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1189, + "end": 1191, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1189, + "end": 1190, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1111, + "end": 1125, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1112, + "end": 1124, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1112, + "end": 1113, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeLiteral", + "span": { + "start": 1122, + "end": 1124, + "ctxt": 0 + }, + "members": [] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1216, + "end": 1219, + "ctxt": 0 + }, + "value": "f20", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1220, + "end": 1230, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1220, + "end": 1230, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1221, + "end": 1230, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 1223, + "end": 1230, + "ctxt": 0 + }, + "kind": "unknown" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1207, + "end": 1737, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1232, + "end": 1737, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 1238, + "end": 1333, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1242, + "end": 1257, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1242, + "end": 1243, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1248, + "end": 1257, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1259, + "end": 1291, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1269, + "end": 1271, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1269, + "end": 1270, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1301, + "end": 1333, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1311, + "end": 1313, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1311, + "end": 1312, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1338, + "end": 1428, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1342, + "end": 1352, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1342, + "end": 1343, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 1348, + "end": 1352, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1354, + "end": 1391, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1364, + "end": 1366, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1364, + "end": 1365, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1401, + "end": 1428, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1411, + "end": 1413, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1411, + "end": 1412, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1433, + "end": 1542, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1437, + "end": 1466, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1437, + "end": 1452, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1437, + "end": 1438, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1443, + "end": 1452, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1456, + "end": 1466, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1456, + "end": 1457, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 1462, + "end": 1466, + "ctxt": 0 + } + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1468, + "end": 1493, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1478, + "end": 1480, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1478, + "end": 1479, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1503, + "end": 1542, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1513, + "end": 1515, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1513, + "end": 1514, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1547, + "end": 1641, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1551, + "end": 1565, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 1551, + "end": 1552, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1556, + "end": 1565, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1567, + "end": 1592, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1577, + "end": 1579, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1577, + "end": 1578, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1602, + "end": 1641, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1612, + "end": 1614, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1612, + "end": 1613, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1646, + "end": 1735, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1650, + "end": 1659, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 1650, + "end": 1651, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 1655, + "end": 1659, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1661, + "end": 1686, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1671, + "end": 1673, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1671, + "end": 1672, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1696, + "end": 1735, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1706, + "end": 1708, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1706, + "end": 1707, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 1748, + "end": 1751, + "ctxt": 0 + }, + "value": "f21", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 1755, + "end": 1759, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 1755, + "end": 1759, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 1756, + "end": 1759, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 1758, + "end": 1759, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 1758, + "end": 1759, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 1739, + "end": 2234, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 1761, + "end": 2234, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 1767, + "end": 1860, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1771, + "end": 1786, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1771, + "end": 1772, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1777, + "end": 1786, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1788, + "end": 1826, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1798, + "end": 1800, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1798, + "end": 1799, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1836, + "end": 1860, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1846, + "end": 1848, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1846, + "end": 1847, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1865, + "end": 1958, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1869, + "end": 1879, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1869, + "end": 1870, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 1875, + "end": 1879, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1881, + "end": 1924, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1891, + "end": 1893, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1891, + "end": 1892, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 1934, + "end": 1958, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 1944, + "end": 1946, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1944, + "end": 1945, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 1963, + "end": 2061, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 1967, + "end": 1996, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 1967, + "end": 1982, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1967, + "end": 1968, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 1973, + "end": 1982, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 1986, + "end": 1996, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 1986, + "end": 1987, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 1992, + "end": 1996, + "ctxt": 0 + } + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 1998, + "end": 2027, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2008, + "end": 2010, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2008, + "end": 2009, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2037, + "end": 2061, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2047, + "end": 2049, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2047, + "end": 2048, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2066, + "end": 2149, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2070, + "end": 2084, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2070, + "end": 2071, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2075, + "end": 2084, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2086, + "end": 2115, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2096, + "end": 2098, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2096, + "end": 2097, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2125, + "end": 2149, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2135, + "end": 2137, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2135, + "end": 2136, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2154, + "end": 2232, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2158, + "end": 2167, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2158, + "end": 2159, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2163, + "end": 2167, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2169, + "end": 2198, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2179, + "end": 2181, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2179, + "end": 2180, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2208, + "end": 2232, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2218, + "end": 2220, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2218, + "end": 2219, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 1751, + "end": 1754, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 1752, + "end": 1753, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 1752, + "end": 1753, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2245, + "end": 2248, + "ctxt": 0 + }, + "value": "f22", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2275, + "end": 2279, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2275, + "end": 2279, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2276, + "end": 2279, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 2278, + "end": 2279, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2278, + "end": 2279, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2236, + "end": 2726, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2281, + "end": 2726, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 2287, + "end": 2371, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2291, + "end": 2306, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2291, + "end": 2292, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2297, + "end": 2306, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2308, + "end": 2337, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2318, + "end": 2320, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2318, + "end": 2319, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2347, + "end": 2371, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2357, + "end": 2359, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2357, + "end": 2358, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2376, + "end": 2450, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2380, + "end": 2390, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2380, + "end": 2381, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2386, + "end": 2390, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2392, + "end": 2416, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2402, + "end": 2404, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2402, + "end": 2403, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2426, + "end": 2450, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2436, + "end": 2438, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2436, + "end": 2437, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2455, + "end": 2553, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2459, + "end": 2488, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 2459, + "end": 2474, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2459, + "end": 2460, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2465, + "end": 2474, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 2478, + "end": 2488, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2478, + "end": 2479, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2484, + "end": 2488, + "ctxt": 0 + } + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2490, + "end": 2519, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2500, + "end": 2502, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2500, + "end": 2501, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2529, + "end": 2553, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2539, + "end": 2541, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2539, + "end": 2540, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2558, + "end": 2641, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2562, + "end": 2576, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2562, + "end": 2563, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2567, + "end": 2576, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2578, + "end": 2607, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2588, + "end": 2590, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2588, + "end": 2589, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2617, + "end": 2641, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2627, + "end": 2629, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2627, + "end": 2628, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 2646, + "end": 2724, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2650, + "end": 2659, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2650, + "end": 2651, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2655, + "end": 2659, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2661, + "end": 2690, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2671, + "end": 2673, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2671, + "end": 2672, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 2700, + "end": 2724, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2710, + "end": 2712, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2710, + "end": 2711, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2248, + "end": 2274, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2249, + "end": 2273, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2249, + "end": 2250, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 2259, + "end": 2273, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 2259, + "end": 2261, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 2264, + "end": 2273, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 2737, + "end": 2740, + "ctxt": 0 + }, + "value": "f23", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 2744, + "end": 2767, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 2744, + "end": 2767, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 2745, + "end": 2767, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 2747, + "end": 2767, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 2747, + "end": 2748, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 2747, + "end": 2748, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 2751, + "end": 2760, + "ctxt": 0 + }, + "kind": "undefined" + }, + { + "type": "TsKeywordType", + "span": { + "start": 2763, + "end": 2767, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 2728, + "end": 2999, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 2769, + "end": 2999, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 2775, + "end": 2832, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2779, + "end": 2794, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2779, + "end": 2780, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2785, + "end": 2794, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2796, + "end": 2832, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2806, + "end": 2808, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2806, + "end": 2807, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 2837, + "end": 2894, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2841, + "end": 2851, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 2841, + "end": 2842, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2847, + "end": 2851, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2853, + "end": 2894, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2863, + "end": 2865, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2863, + "end": 2864, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 2899, + "end": 2948, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2903, + "end": 2917, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2903, + "end": 2904, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 2908, + "end": 2917, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2919, + "end": 2948, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2929, + "end": 2931, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2929, + "end": 2930, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 2953, + "end": 2997, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 2957, + "end": 2966, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 2957, + "end": 2958, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 2962, + "end": 2966, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 2968, + "end": 2997, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 2978, + "end": 2980, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 2978, + "end": 2979, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 2740, + "end": 2743, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 2741, + "end": 2742, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 2741, + "end": 2742, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3010, + "end": 3013, + "ctxt": 0 + }, + "value": "f30", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3014, + "end": 3019, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3014, + "end": 3019, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3015, + "end": 3019, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 3017, + "end": 3019, + "ctxt": 0 + }, + "members": [] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3001, + "end": 3085, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3021, + "end": 3085, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 3027, + "end": 3083, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3031, + "end": 3052, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 3031, + "end": 3039, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 3038, + "end": 3039, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3044, + "end": 3052, + "ctxt": 0 + }, + "value": "object", + "raw": "\"object\"" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 3054, + "end": 3083, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3064, + "end": 3066, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3064, + "end": 3065, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3096, + "end": 3099, + "ctxt": 0 + }, + "value": "f31", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3103, + "end": 3107, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3103, + "end": 3107, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3104, + "end": 3107, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3106, + "end": 3107, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3106, + "end": 3107, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3087, + "end": 3328, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3109, + "end": 3328, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 3115, + "end": 3186, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3119, + "end": 3140, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 3119, + "end": 3127, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 3126, + "end": 3127, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3132, + "end": 3140, + "ctxt": 0 + }, + "value": "object", + "raw": "\"object\"" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 3142, + "end": 3186, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3152, + "end": 3154, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3152, + "end": 3153, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 3191, + "end": 3256, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3195, + "end": 3221, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "Identifier", + "span": { + "start": 3195, + "end": 3196, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 3200, + "end": 3221, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 3200, + "end": 3208, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 3207, + "end": 3208, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3213, + "end": 3221, + "ctxt": 0 + }, + "value": "object", + "raw": "\"object\"" + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 3223, + "end": 3256, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3233, + "end": 3235, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3233, + "end": 3234, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 3261, + "end": 3326, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3265, + "end": 3291, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 3265, + "end": 3286, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 3265, + "end": 3273, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 3272, + "end": 3273, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3278, + "end": 3286, + "ctxt": 0 + }, + "value": "object", + "raw": "\"object\"" + } + }, + "right": { + "type": "Identifier", + "span": { + "start": 3290, + "end": 3291, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 3293, + "end": 3326, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3303, + "end": 3305, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3303, + "end": 3304, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3099, + "end": 3102, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3100, + "end": 3101, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3100, + "end": 3101, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3339, + "end": 3342, + "ctxt": 0 + }, + "value": "f32", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3369, + "end": 3373, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3369, + "end": 3373, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3370, + "end": 3373, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3372, + "end": 3373, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3372, + "end": 3373, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3330, + "end": 3443, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3375, + "end": 3443, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 3381, + "end": 3441, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3385, + "end": 3406, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "UnaryExpression", + "span": { + "start": 3385, + "end": 3393, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 3392, + "end": 3393, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 3398, + "end": 3406, + "ctxt": 0 + }, + "value": "object", + "raw": "\"object\"" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 3408, + "end": 3441, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 3418, + "end": 3420, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 3418, + "end": 3419, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3342, + "end": 3368, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3343, + "end": 3367, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3343, + "end": 3344, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 3353, + "end": 3367, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 3353, + "end": 3355, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 3358, + "end": 3367, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3454, + "end": 3466, + "ctxt": 0 + }, + "value": "possiblyNull", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3470, + "end": 3474, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3470, + "end": 3474, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3471, + "end": 3474, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3473, + "end": 3474, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3473, + "end": 3474, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3445, + "end": 3522, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3476, + "end": 3522, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 3482, + "end": 3507, + "ctxt": 0 + }, + "argument": { + "type": "ConditionalExpression", + "span": { + "start": 3489, + "end": 3506, + "ctxt": 0 + }, + "test": { + "type": "UnaryExpression", + "span": { + "start": 3489, + "end": 3495, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "UnaryExpression", + "span": { + "start": 3490, + "end": 3495, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 3491, + "end": 3495, + "ctxt": 0 + }, + "value": true + } + } + }, + "consequent": { + "type": "Identifier", + "span": { + "start": 3498, + "end": 3499, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "alternate": { + "type": "NullLiteral", + "span": { + "start": 3502, + "end": 3506, + "ctxt": 0 + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3466, + "end": 3469, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3467, + "end": 3468, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3467, + "end": 3468, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3533, + "end": 3550, + "ctxt": 0 + }, + "value": "possiblyUndefined", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3554, + "end": 3558, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3554, + "end": 3558, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3555, + "end": 3558, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3557, + "end": 3558, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3557, + "end": 3558, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3524, + "end": 3616, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3560, + "end": 3616, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 3566, + "end": 3596, + "ctxt": 0 + }, + "argument": { + "type": "ConditionalExpression", + "span": { + "start": 3573, + "end": 3595, + "ctxt": 0 + }, + "test": { + "type": "UnaryExpression", + "span": { + "start": 3573, + "end": 3579, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "UnaryExpression", + "span": { + "start": 3574, + "end": 3579, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 3575, + "end": 3579, + "ctxt": 0 + }, + "value": true + } + } + }, + "consequent": { + "type": "Identifier", + "span": { + "start": 3582, + "end": 3583, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "alternate": { + "type": "Identifier", + "span": { + "start": 3586, + "end": 3595, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3550, + "end": 3553, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3551, + "end": 3552, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3551, + "end": 3552, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3627, + "end": 3650, + "ctxt": 0 + }, + "value": "possiblyNullOrUndefined", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3654, + "end": 3658, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3654, + "end": 3658, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3655, + "end": 3658, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3657, + "end": 3658, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3657, + "end": 3658, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3618, + "end": 3735, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3660, + "end": 3735, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 3666, + "end": 3708, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 3673, + "end": 3707, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3673, + "end": 3690, + "ctxt": 0 + }, + "value": "possiblyUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 3691, + "end": 3706, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3691, + "end": 3703, + "ctxt": 0 + }, + "value": "possiblyNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 3704, + "end": 3705, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3650, + "end": 3653, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3651, + "end": 3652, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3651, + "end": 3652, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3746, + "end": 3759, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3763, + "end": 3767, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3763, + "end": 3767, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3764, + "end": 3767, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3766, + "end": 3767, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3766, + "end": 3767, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3737, + "end": 3846, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3769, + "end": 3846, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 3775, + "end": 3805, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3779, + "end": 3789, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 3779, + "end": 3780, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 3785, + "end": 3789, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "ThrowStatement", + "span": { + "start": 3791, + "end": 3805, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 3797, + "end": 3804, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3797, + "end": 3802, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "span": { + "start": 3810, + "end": 3819, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 3817, + "end": 3818, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3759, + "end": 3762, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3760, + "end": 3761, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3760, + "end": 3761, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3857, + "end": 3875, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 3879, + "end": 3883, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 3879, + "end": 3883, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 3880, + "end": 3883, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 3882, + "end": 3883, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 3882, + "end": 3883, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3848, + "end": 3962, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 3885, + "end": 3962, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 3891, + "end": 3926, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 3895, + "end": 3910, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 3895, + "end": 3896, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 3901, + "end": 3910, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "ThrowStatement", + "span": { + "start": 3912, + "end": 3926, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 3918, + "end": 3925, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 3918, + "end": 3923, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "span": { + "start": 3931, + "end": 3940, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 3938, + "end": 3939, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3875, + "end": 3878, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3876, + "end": 3877, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3876, + "end": 3877, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 3973, + "end": 3997, + "ctxt": 0 + }, + "value": "ensureNotNullOrUndefined", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 4001, + "end": 4005, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4001, + "end": 4005, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4002, + "end": 4005, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4004, + "end": 4005, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4004, + "end": 4005, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 3964, + "end": 4070, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4007, + "end": 4070, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 4013, + "end": 4057, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 4020, + "end": 4056, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4020, + "end": 4038, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4039, + "end": 4055, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4039, + "end": 4052, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4053, + "end": 4054, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 3997, + "end": 4000, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 3998, + "end": 3999, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 3998, + "end": 3999, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 4081, + "end": 4084, + "ctxt": 0 + }, + "value": "f40", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 4085, + "end": 4106, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4085, + "end": 4106, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4086, + "end": 4106, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 4088, + "end": 4106, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4088, + "end": 4094, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4097, + "end": 4106, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 4108, + "end": 4136, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4108, + "end": 4136, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4109, + "end": 4136, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 4111, + "end": 4136, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 4111, + "end": 4117, + "ctxt": 0 + }, + "kind": "number" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4120, + "end": 4124, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 4127, + "end": 4136, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4072, + "end": 4247, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4138, + "end": 4247, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 4144, + "end": 4181, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4148, + "end": 4180, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4148, + "end": 4150, + "ctxt": 0 + }, + "value": "a1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4153, + "end": 4180, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4153, + "end": 4177, + "ctxt": 0 + }, + "value": "ensureNotNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4178, + "end": 4179, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4197, + "end": 4234, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4201, + "end": 4233, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4201, + "end": 4203, + "ctxt": 0 + }, + "value": "b1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4206, + "end": 4233, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4206, + "end": 4230, + "ctxt": 0 + }, + "value": "ensureNotNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4231, + "end": 4232, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 4249, + "end": 4303, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 4254, + "end": 4256, + "ctxt": 0 + }, + "value": "QQ", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4256, + "end": 4259, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4257, + "end": 4258, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4257, + "end": 4258, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4262, + "end": 4302, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4262, + "end": 4273, + "ctxt": 0 + }, + "value": "NonNullable", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4273, + "end": 4302, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 4274, + "end": 4301, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4274, + "end": 4285, + "ctxt": 0 + }, + "value": "NonNullable", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4285, + "end": 4301, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 4286, + "end": 4300, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4286, + "end": 4297, + "ctxt": 0 + }, + "value": "NonNullable", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 4297, + "end": 4300, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 4298, + "end": 4299, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4298, + "end": 4299, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + } + ] + } + } + ] + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 4314, + "end": 4317, + "ctxt": 0 + }, + "value": "f41", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 4321, + "end": 4325, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 4321, + "end": 4325, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 4322, + "end": 4325, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 4324, + "end": 4325, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 4324, + "end": 4325, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 4305, + "end": 4983, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 4327, + "end": 4983, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 4333, + "end": 4379, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4337, + "end": 4378, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4337, + "end": 4339, + "ctxt": 0 + }, + "value": "a1", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4342, + "end": 4378, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4342, + "end": 4360, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4361, + "end": 4377, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4361, + "end": 4374, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4375, + "end": 4376, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4395, + "end": 4441, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4399, + "end": 4440, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4399, + "end": 4401, + "ctxt": 0 + }, + "value": "a2", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4404, + "end": 4440, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4404, + "end": 4417, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4418, + "end": 4439, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4418, + "end": 4436, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4437, + "end": 4438, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4457, + "end": 4498, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4461, + "end": 4497, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4461, + "end": 4463, + "ctxt": 0 + }, + "value": "a3", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4466, + "end": 4497, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4466, + "end": 4479, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4480, + "end": 4496, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4480, + "end": 4493, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4494, + "end": 4495, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4530, + "end": 4581, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4534, + "end": 4580, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4534, + "end": 4536, + "ctxt": 0 + }, + "value": "a4", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4539, + "end": 4580, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4539, + "end": 4557, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4558, + "end": 4579, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4558, + "end": 4576, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4577, + "end": 4578, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4608, + "end": 4671, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4612, + "end": 4670, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4612, + "end": 4614, + "ctxt": 0 + }, + "value": "a5", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4617, + "end": 4670, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4617, + "end": 4641, + "ctxt": 0 + }, + "value": "ensureNotNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4642, + "end": 4669, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4642, + "end": 4666, + "ctxt": 0 + }, + "value": "ensureNotNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4667, + "end": 4668, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4687, + "end": 4738, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4691, + "end": 4737, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4691, + "end": 4693, + "ctxt": 0 + }, + "value": "a6", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4696, + "end": 4737, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4696, + "end": 4709, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4710, + "end": 4736, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4710, + "end": 4733, + "ctxt": 0 + }, + "value": "possiblyNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4734, + "end": 4735, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4766, + "end": 4822, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4770, + "end": 4821, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4770, + "end": 4772, + "ctxt": 0 + }, + "value": "a7", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4775, + "end": 4821, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4775, + "end": 4793, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4794, + "end": 4820, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4794, + "end": 4817, + "ctxt": 0 + }, + "value": "possiblyNullOrUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4818, + "end": 4819, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4845, + "end": 4890, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4849, + "end": 4889, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4849, + "end": 4851, + "ctxt": 0 + }, + "value": "a8", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4854, + "end": 4889, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4854, + "end": 4867, + "ctxt": 0 + }, + "value": "ensureNotNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4868, + "end": 4888, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4868, + "end": 4885, + "ctxt": 0 + }, + "value": "possiblyUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4886, + "end": 4887, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 4918, + "end": 4963, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 4922, + "end": 4962, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 4922, + "end": 4924, + "ctxt": 0 + }, + "value": "a9", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "CallExpression", + "span": { + "start": 4927, + "end": 4962, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4927, + "end": 4945, + "ctxt": 0 + }, + "value": "ensureNotUndefined", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "CallExpression", + "span": { + "start": 4946, + "end": 4961, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 4946, + "end": 4958, + "ctxt": 0 + }, + "value": "possiblyNull", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 4959, + "end": 4960, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + } + } + ], + "typeArguments": null + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 4317, + "end": 4320, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 4318, + "end": 4319, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 4318, + "end": 4319, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5016, + "end": 5026, + "ctxt": 0 + }, + "value": "deepEquals", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5030, + "end": 5034, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5030, + "end": 5034, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5031, + "end": 5034, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5033, + "end": 5034, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5033, + "end": 5034, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 5036, + "end": 5040, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5036, + "end": 5040, + "ctxt": 0 + }, + "value": "b", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5037, + "end": 5040, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5039, + "end": 5040, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5039, + "end": 5040, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5007, + "end": 5346, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5051, + "end": 5346, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 5057, + "end": 5150, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 5061, + "end": 5119, + "ctxt": 0 + }, + "operator": "||", + "left": { + "type": "BinaryExpression", + "span": { + "start": 5061, + "end": 5113, + "ctxt": 0 + }, + "operator": "||", + "left": { + "type": "BinaryExpression", + "span": { + "start": 5061, + "end": 5107, + "ctxt": 0 + }, + "operator": "||", + "left": { + "type": "BinaryExpression", + "span": { + "start": 5061, + "end": 5082, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "UnaryExpression", + "span": { + "start": 5061, + "end": 5069, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 5068, + "end": 5069, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 5074, + "end": 5082, + "ctxt": 0 + }, + "value": "object", + "raw": "'object'" + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 5086, + "end": 5107, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "UnaryExpression", + "span": { + "start": 5086, + "end": 5094, + "ctxt": 0 + }, + "operator": "typeof", + "argument": { + "type": "Identifier", + "span": { + "start": 5093, + "end": 5094, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 5099, + "end": 5107, + "ctxt": 0 + }, + "value": "object", + "raw": "'object'" + } + } + }, + "right": { + "type": "UnaryExpression", + "span": { + "start": 5111, + "end": 5113, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "Identifier", + "span": { + "start": 5112, + "end": 5113, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + }, + "right": { + "type": "UnaryExpression", + "span": { + "start": 5117, + "end": 5119, + "ctxt": 0 + }, + "operator": "!", + "argument": { + "type": "Identifier", + "span": { + "start": 5118, + "end": 5119, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 5121, + "end": 5150, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5131, + "end": 5144, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 5138, + "end": 5143, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 5155, + "end": 5226, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 5159, + "end": 5195, + "ctxt": 0 + }, + "operator": "||", + "left": { + "type": "CallExpression", + "span": { + "start": 5159, + "end": 5175, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 5159, + "end": 5172, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5159, + "end": 5164, + "ctxt": 0 + }, + "value": "Array", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 5165, + "end": 5172, + "ctxt": 0 + }, + "value": "isArray", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 5173, + "end": 5174, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + }, + "right": { + "type": "CallExpression", + "span": { + "start": 5179, + "end": 5195, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 5179, + "end": 5192, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5179, + "end": 5184, + "ctxt": 0 + }, + "value": "Array", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 5185, + "end": 5192, + "ctxt": 0 + }, + "value": "isArray", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 5193, + "end": 5194, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + ], + "typeArguments": null + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 5197, + "end": 5226, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5207, + "end": 5220, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 5214, + "end": 5219, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 5231, + "end": 5327, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 5235, + "end": 5282, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "MemberExpression", + "span": { + "start": 5235, + "end": 5256, + "ctxt": 0 + }, + "object": { + "type": "CallExpression", + "span": { + "start": 5235, + "end": 5249, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 5235, + "end": 5246, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5235, + "end": 5241, + "ctxt": 0 + }, + "value": "Object", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 5242, + "end": 5246, + "ctxt": 0 + }, + "value": "keys", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 5247, + "end": 5248, + "ctxt": 0 + }, + "value": "a", + "optional": false + } + } + ], + "typeArguments": null + }, + "property": { + "type": "Identifier", + "span": { + "start": 5250, + "end": 5256, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + }, + "right": { + "type": "MemberExpression", + "span": { + "start": 5261, + "end": 5282, + "ctxt": 0 + }, + "object": { + "type": "CallExpression", + "span": { + "start": 5261, + "end": 5275, + "ctxt": 0 + }, + "callee": { + "type": "MemberExpression", + "span": { + "start": 5261, + "end": 5272, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5261, + "end": 5267, + "ctxt": 0 + }, + "value": "Object", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 5268, + "end": 5272, + "ctxt": 0 + }, + "value": "keys", + "optional": false + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 5273, + "end": 5274, + "ctxt": 0 + }, + "value": "b", + "optional": false + } + } + ], + "typeArguments": null + }, + "property": { + "type": "Identifier", + "span": { + "start": 5276, + "end": 5282, + "ctxt": 0 + }, + "value": "length", + "optional": false + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 5284, + "end": 5327, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 5308, + "end": 5321, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 5315, + "end": 5320, + "ctxt": 0 + }, + "value": false + } + } + ] + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "span": { + "start": 5332, + "end": 5344, + "ctxt": 0 + }, + "argument": { + "type": "BooleanLiteral", + "span": { + "start": 5339, + "end": 5343, + "ctxt": 0 + }, + "value": true + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5026, + "end": 5029, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5027, + "end": 5028, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5027, + "end": 5028, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 5041, + "end": 5050, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 5043, + "end": 5050, + "ctxt": 0 + }, + "kind": "boolean" + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5379, + "end": 5382, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5386, + "end": 5397, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5386, + "end": 5397, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5387, + "end": 5397, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 5389, + "end": 5397, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 5389, + "end": 5390, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5389, + "end": 5390, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 5393, + "end": 5397, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5370, + "end": 5456, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5399, + "end": 5456, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 5405, + "end": 5415, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 5409, + "end": 5414, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 5409, + "end": 5410, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "Identifier", + "span": { + "start": 5413, + "end": 5414, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "definite": false + } + ] + }, + { + "type": "IfStatement", + "span": { + "start": 5420, + "end": 5454, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 5424, + "end": 5434, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 5424, + "end": 5425, + "ctxt": 0 + }, + "value": "y", + "optional": false + }, + "right": { + "type": "NullLiteral", + "span": { + "start": 5430, + "end": 5434, + "ctxt": 0 + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 5436, + "end": 5454, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 5446, + "end": 5448, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 5446, + "end": 5447, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5382, + "end": 5385, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5383, + "end": 5384, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5383, + "end": 5384, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5754, + "end": 5757, + "ctxt": 0 + }, + "value": "ff1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5761, + "end": 5765, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5761, + "end": 5765, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5762, + "end": 5765, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5764, + "end": 5765, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5764, + "end": 5765, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 5767, + "end": 5777, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5767, + "end": 5777, + "ctxt": 0 + }, + "value": "k", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5768, + "end": 5777, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 5770, + "end": 5777, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5776, + "end": 5777, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5776, + "end": 5777, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5745, + "end": 5792, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5779, + "end": 5792, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 5785, + "end": 5790, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 5785, + "end": 5789, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5785, + "end": 5786, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 5786, + "end": 5789, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 5787, + "end": 5788, + "ctxt": 0 + }, + "value": "k", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5757, + "end": 5760, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5758, + "end": 5759, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5758, + "end": 5759, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5803, + "end": 5806, + "ctxt": 0 + }, + "value": "ff2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5810, + "end": 5819, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5810, + "end": 5819, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5811, + "end": 5819, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 5813, + "end": 5819, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 5813, + "end": 5814, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5813, + "end": 5814, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 5817, + "end": 5819, + "ctxt": 0 + }, + "members": [] + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 5821, + "end": 5831, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5821, + "end": 5831, + "ctxt": 0 + }, + "value": "k", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5822, + "end": 5831, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 5824, + "end": 5831, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5830, + "end": 5831, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5830, + "end": 5831, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5794, + "end": 5846, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5833, + "end": 5846, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 5839, + "end": 5844, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 5839, + "end": 5843, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5839, + "end": 5840, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 5840, + "end": 5843, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 5841, + "end": 5842, + "ctxt": 0 + }, + "value": "k", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5806, + "end": 5809, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5807, + "end": 5808, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5807, + "end": 5808, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5857, + "end": 5860, + "ctxt": 0 + }, + "value": "ff3", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5864, + "end": 5868, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5864, + "end": 5868, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5865, + "end": 5868, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 5867, + "end": 5868, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5867, + "end": 5868, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 5870, + "end": 5887, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5870, + "end": 5887, + "ctxt": 0 + }, + "value": "k", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5871, + "end": 5887, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 5873, + "end": 5887, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 5879, + "end": 5887, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 5880, + "end": 5886, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 5880, + "end": 5881, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5880, + "end": 5881, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 5884, + "end": 5886, + "ctxt": 0 + }, + "members": [] + } + ] + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5848, + "end": 5912, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5889, + "end": 5912, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 5895, + "end": 5900, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 5895, + "end": 5899, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5895, + "end": 5896, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 5896, + "end": 5899, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 5897, + "end": 5898, + "ctxt": 0 + }, + "value": "k", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5860, + "end": 5863, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5861, + "end": 5862, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5861, + "end": 5862, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 5923, + "end": 5926, + "ctxt": 0 + }, + "value": "ff4", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 5930, + "end": 5939, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5930, + "end": 5939, + "ctxt": 0 + }, + "value": "t", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5931, + "end": 5939, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 5933, + "end": 5939, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 5933, + "end": 5934, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5933, + "end": 5934, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 5937, + "end": 5939, + "ctxt": 0 + }, + "members": [] + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 5941, + "end": 5958, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 5941, + "end": 5958, + "ctxt": 0 + }, + "value": "k", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 5942, + "end": 5958, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeOperator", + "span": { + "start": 5944, + "end": 5958, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsParenthesizedType", + "span": { + "start": 5950, + "end": 5958, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 5951, + "end": 5957, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 5951, + "end": 5952, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 5951, + "end": 5952, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 5955, + "end": 5957, + "ctxt": 0 + }, + "members": [] + } + ] + } + } + } + } + } + } + ], + "decorators": [], + "span": { + "start": 5914, + "end": 5973, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 5960, + "end": 5973, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 5966, + "end": 5971, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 5966, + "end": 5970, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 5966, + "end": 5967, + "ctxt": 0 + }, + "value": "t", + "optional": false + }, + "property": { + "type": "Computed", + "span": { + "start": 5967, + "end": 5970, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 5968, + "end": 5969, + "ctxt": 0 + }, + "value": "k", + "optional": false + } + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 5926, + "end": 5929, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 5927, + "end": 5928, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 5927, + "end": 5928, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 5975, + "end": 5992, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 5975, + "end": 5991, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 5975, + "end": 5978, + "ctxt": 0 + }, + "value": "ff1", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NullLiteral", + "span": { + "start": 5979, + "end": 5983, + "ctxt": 0 + } + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 5985, + "end": 5990, + "ctxt": 0 + }, + "value": "foo", + "raw": "'foo'" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 6003, + "end": 6020, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 6003, + "end": 6019, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 6003, + "end": 6006, + "ctxt": 0 + }, + "value": "ff2", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NullLiteral", + "span": { + "start": 6007, + "end": 6011, + "ctxt": 0 + } + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 6013, + "end": 6018, + "ctxt": 0 + }, + "value": "foo", + "raw": "'foo'" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 6031, + "end": 6048, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 6031, + "end": 6047, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 6031, + "end": 6034, + "ctxt": 0 + }, + "value": "ff3", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NullLiteral", + "span": { + "start": 6035, + "end": 6039, + "ctxt": 0 + } + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 6041, + "end": 6046, + "ctxt": 0 + }, + "value": "foo", + "raw": "'foo'" + } + } + ], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 6049, + "end": 6066, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 6049, + "end": 6065, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 6049, + "end": 6052, + "ctxt": 0 + }, + "value": "ff4", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "NullLiteral", + "span": { + "start": 6053, + "end": 6057, + "ctxt": 0 + } + } + }, + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 6059, + "end": 6064, + "ctxt": 0 + }, + "value": "foo", + "raw": "'foo'" + } + } + ], + "typeArguments": null + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6100, + "end": 6138, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6105, + "end": 6108, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 6111, + "end": 6137, + "ctxt": 0 + }, + "members": [ + { + "type": "TsIndexSignature", + "params": [ + { + "type": "Identifier", + "span": { + "start": 6114, + "end": 6125, + "ctxt": 0 + }, + "value": "key", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6117, + "end": 6125, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 6119, + "end": 6125, + "ctxt": 0 + }, + "kind": "string" + } + } + } + ], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6126, + "end": 6135, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 6128, + "end": 6135, + "ctxt": 0 + }, + "kind": "unknown" + } + }, + "readonly": false, + "static": false, + "span": { + "start": 6113, + "end": 6135, + "ctxt": 0 + } + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6139, + "end": 6174, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6144, + "end": 6155, + "ctxt": 0 + }, + "value": "NullableFoo", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6158, + "end": 6173, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6158, + "end": 6161, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6158, + "end": 6161, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 6164, + "end": 6173, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 6176, + "end": 6233, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 6181, + "end": 6184, + "ctxt": 0 + }, + "value": "Bar", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6184, + "end": 6207, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6185, + "end": 6206, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6185, + "end": 6186, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 6195, + "end": 6206, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6195, + "end": 6206, + "ctxt": 0 + }, + "value": "NullableFoo", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsIndexedAccessType", + "span": { + "start": 6210, + "end": 6232, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 6210, + "end": 6224, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6210, + "end": 6221, + "ctxt": 0 + }, + "value": "NonNullable", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterInstantiation", + "span": { + "start": 6221, + "end": 6224, + "ctxt": 0 + }, + "params": [ + { + "type": "TsTypeReference", + "span": { + "start": 6222, + "end": 6223, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6222, + "end": 6223, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + ] + } + }, + "indexType": { + "type": "TsKeywordType", + "span": { + "start": 6225, + "end": 6231, + "ctxt": 0 + }, + "kind": "string" + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 6283, + "end": 6286, + "ctxt": 0 + }, + "value": "fx0", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 6290, + "end": 6312, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 6290, + "end": 6312, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6295, + "end": 6312, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 6297, + "end": 6312, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6297, + "end": 6298, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6297, + "end": 6298, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 6301, + "end": 6312, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6302, + "end": 6311, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6302, + "end": 6304, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6307, + "end": 6311, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 6274, + "end": 6425, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 6314, + "end": 6425, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 6320, + "end": 6423, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 6324, + "end": 6336, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 6324, + "end": 6329, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 6334, + "end": 6336, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 6338, + "end": 6371, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6348, + "end": 6354, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6348, + "end": 6353, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 6381, + "end": 6423, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6391, + "end": 6397, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6391, + "end": 6396, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6286, + "end": 6289, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6287, + "end": 6288, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6287, + "end": 6288, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": null, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 6436, + "end": 6439, + "ctxt": 0 + }, + "value": "fx1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 6459, + "end": 6481, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 6459, + "end": 6481, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6464, + "end": 6481, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 6466, + "end": 6481, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6466, + "end": 6467, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6466, + "end": 6467, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 6470, + "end": 6481, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6471, + "end": 6480, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6471, + "end": 6473, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6476, + "end": 6480, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 6427, + "end": 6594, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 6483, + "end": 6594, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 6489, + "end": 6592, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 6493, + "end": 6505, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 6493, + "end": 6498, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 6503, + "end": 6505, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 6507, + "end": 6540, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6517, + "end": 6523, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6517, + "end": 6522, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 6550, + "end": 6592, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6560, + "end": 6566, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6560, + "end": 6565, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6439, + "end": 6458, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6440, + "end": 6457, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6440, + "end": 6441, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 6450, + "end": 6457, + "ctxt": 0 + }, + "kind": "unknown" + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 6605, + "end": 6608, + "ctxt": 0 + }, + "value": "fx2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 6623, + "end": 6645, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 6623, + "end": 6645, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6628, + "end": 6645, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 6630, + "end": 6645, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6630, + "end": 6631, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6630, + "end": 6631, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 6634, + "end": 6645, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6635, + "end": 6644, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6635, + "end": 6637, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6640, + "end": 6644, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 6596, + "end": 6758, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 6647, + "end": 6758, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 6653, + "end": 6756, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 6657, + "end": 6669, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 6657, + "end": 6662, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 6667, + "end": 6669, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 6671, + "end": 6704, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6681, + "end": 6687, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6681, + "end": 6686, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 6714, + "end": 6756, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6724, + "end": 6730, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6724, + "end": 6729, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6608, + "end": 6622, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6609, + "end": 6621, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6609, + "end": 6610, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeLiteral", + "span": { + "start": 6619, + "end": 6621, + "ctxt": 0 + }, + "members": [] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 6769, + "end": 6772, + "ctxt": 0 + }, + "value": "fx3", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 6799, + "end": 6821, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 6799, + "end": 6821, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6804, + "end": 6821, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 6806, + "end": 6821, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6806, + "end": 6807, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6806, + "end": 6807, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 6810, + "end": 6821, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6811, + "end": 6820, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6811, + "end": 6813, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6816, + "end": 6820, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 6760, + "end": 6934, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 6823, + "end": 6934, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 6829, + "end": 6932, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 6833, + "end": 6845, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 6833, + "end": 6838, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 6843, + "end": 6845, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 6847, + "end": 6880, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6857, + "end": 6863, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6857, + "end": 6862, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 6890, + "end": 6932, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 6900, + "end": 6906, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 6900, + "end": 6905, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6772, + "end": 6798, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6773, + "end": 6797, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6773, + "end": 6774, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6783, + "end": 6797, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6783, + "end": 6785, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6788, + "end": 6797, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 6945, + "end": 6948, + "ctxt": 0 + }, + "value": "fx4", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 6970, + "end": 6992, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 6970, + "end": 6992, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 6975, + "end": 6992, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 6977, + "end": 6992, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 6977, + "end": 6978, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 6977, + "end": 6978, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 6981, + "end": 6992, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 6982, + "end": 6991, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6982, + "end": 6984, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6987, + "end": 6991, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 6936, + "end": 7105, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 6994, + "end": 7105, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 7000, + "end": 7103, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7004, + "end": 7016, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 7004, + "end": 7009, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 7014, + "end": 7016, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7018, + "end": 7051, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7028, + "end": 7034, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7028, + "end": 7033, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 7061, + "end": 7103, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7071, + "end": 7077, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7071, + "end": 7076, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 6948, + "end": 6969, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 6949, + "end": 6968, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 6949, + "end": 6950, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 6959, + "end": 6968, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 6959, + "end": 6961, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 6964, + "end": 6968, + "ctxt": 0 + }, + "kind": "null" + } + ] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7116, + "end": 7119, + "ctxt": 0 + }, + "value": "fx5", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 7153, + "end": 7175, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7153, + "end": 7175, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7158, + "end": 7175, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 7160, + "end": 7175, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 7160, + "end": 7161, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7160, + "end": 7161, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsParenthesizedType", + "span": { + "start": 7164, + "end": 7175, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 7165, + "end": 7174, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 7165, + "end": 7167, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 7170, + "end": 7174, + "ctxt": 0 + }, + "kind": "null" + } + ] + } + } + ] + } + } + } + } + ], + "decorators": [], + "span": { + "start": 7107, + "end": 7288, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 7177, + "end": 7288, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 7183, + "end": 7286, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7187, + "end": 7199, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 7187, + "end": 7192, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 7197, + "end": 7199, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7201, + "end": 7234, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7211, + "end": 7217, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7211, + "end": 7216, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 7244, + "end": 7286, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7254, + "end": 7260, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7254, + "end": 7259, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 7119, + "end": 7152, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 7120, + "end": 7151, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7120, + "end": 7121, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsUnionType", + "span": { + "start": 7130, + "end": 7151, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 7130, + "end": 7132, + "ctxt": 0 + }, + "members": [] + }, + { + "type": "TsKeywordType", + "span": { + "start": 7135, + "end": 7139, + "ctxt": 0 + }, + "kind": "null" + }, + { + "type": "TsKeywordType", + "span": { + "start": 7142, + "end": 7151, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7327, + "end": 7331, + "ctxt": 0 + }, + "value": "fx10", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 7332, + "end": 7350, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7332, + "end": 7350, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7333, + "end": 7350, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 7335, + "end": 7350, + "ctxt": 0 + }, + "types": [ + { + "type": "TsKeywordType", + "span": { + "start": 7335, + "end": 7341, + "ctxt": 0 + }, + "kind": "string" + }, + { + "type": "TsKeywordType", + "span": { + "start": 7344, + "end": 7350, + "ctxt": 0 + }, + "kind": "number" + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 7352, + "end": 7361, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7352, + "end": 7361, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7353, + "end": 7361, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 7355, + "end": 7361, + "ctxt": 0 + }, + "kind": "number" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 7318, + "end": 7572, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 7363, + "end": 7572, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 7369, + "end": 7467, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7373, + "end": 7379, + "ctxt": 0 + }, + "operator": "==", + "left": { + "type": "Identifier", + "span": { + "start": 7373, + "end": 7374, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 7378, + "end": 7379, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7381, + "end": 7419, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7391, + "end": 7393, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7391, + "end": 7392, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 7429, + "end": 7467, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7439, + "end": 7441, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7439, + "end": 7440, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + }, + { + "type": "IfStatement", + "span": { + "start": 7472, + "end": 7570, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7476, + "end": 7482, + "ctxt": 0 + }, + "operator": "!=", + "left": { + "type": "Identifier", + "span": { + "start": 7476, + "end": 7477, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 7481, + "end": 7482, + "ctxt": 0 + }, + "value": "y", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7484, + "end": 7522, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7494, + "end": 7496, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7494, + "end": 7495, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 7532, + "end": 7570, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 7542, + "end": 7544, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7542, + "end": 7543, + "ctxt": 0 + }, + "value": "x", + "optional": false + } + } + ] + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7606, + "end": 7614, + "ctxt": 0 + }, + "value": "SendBlob", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 7615, + "end": 7632, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7615, + "end": 7632, + "ctxt": 0 + }, + "value": "encoding", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7623, + "end": 7632, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 7625, + "end": 7632, + "ctxt": 0 + }, + "kind": "unknown" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 7597, + "end": 7751, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 7634, + "end": 7751, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 7640, + "end": 7735, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7644, + "end": 7689, + "ctxt": 0 + }, + "operator": "&&", + "left": { + "type": "BinaryExpression", + "span": { + "start": 7644, + "end": 7666, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 7644, + "end": 7652, + "ctxt": 0 + }, + "value": "encoding", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 7657, + "end": 7666, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "right": { + "type": "BinaryExpression", + "span": { + "start": 7670, + "end": 7689, + "ctxt": 0 + }, + "operator": "!==", + "left": { + "type": "Identifier", + "span": { + "start": 7670, + "end": 7678, + "ctxt": 0 + }, + "value": "encoding", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 7683, + "end": 7689, + "ctxt": 0 + }, + "value": "utf8", + "raw": "'utf8'" + } + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7691, + "end": 7735, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 7701, + "end": 7729, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 7707, + "end": 7728, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 7711, + "end": 7716, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 7717, + "end": 7727, + "ctxt": 0 + }, + "value": "encoding", + "raw": "'encoding'" + } + } + ], + "typeArguments": null + } + } + ] + }, + "alternate": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 7740, + "end": 7749, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 7740, + "end": 7748, + "ctxt": 0 + }, + "value": "encoding", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "EmptyStatement", + "span": { + "start": 7751, + "end": 7752, + "ctxt": 0 + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7763, + "end": 7775, + "ctxt": 0 + }, + "value": "doSomething1", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 7795, + "end": 7803, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7795, + "end": 7803, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7800, + "end": 7803, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 7802, + "end": 7803, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7802, + "end": 7803, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 7754, + "end": 7964, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 7808, + "end": 7964, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 7814, + "end": 7868, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7818, + "end": 7837, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 7818, + "end": 7823, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 7828, + "end": 7837, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7839, + "end": 7868, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 7849, + "end": 7862, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 7856, + "end": 7861, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 7873, + "end": 7944, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 7877, + "end": 7889, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 7877, + "end": 7882, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 7887, + "end": 7889, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 7891, + "end": 7944, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 7901, + "end": 7938, + "ctxt": 0 + }, + "argument": { + "type": "CallExpression", + "span": { + "start": 7907, + "end": 7937, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 7907, + "end": 7912, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 7913, + "end": 7936, + "ctxt": 0 + }, + "value": "Meaning of life value", + "raw": "'Meaning of life value'" + } + } + ], + "typeArguments": null + } + } + ] + }, + "alternate": null + }, + { + "type": "ReturnStatement", + "span": { + "start": 7949, + "end": 7962, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 7956, + "end": 7961, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 7775, + "end": 7794, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 7776, + "end": 7793, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 7776, + "end": 7777, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsKeywordType", + "span": { + "start": 7786, + "end": 7793, + "ctxt": 0 + }, + "kind": "unknown" + }, + "default": null + } + ] + }, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 7804, + "end": 7807, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 7806, + "end": 7807, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 7806, + "end": 7807, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 7975, + "end": 7987, + "ctxt": 0 + }, + "value": "doSomething2", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 7988, + "end": 8002, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 7988, + "end": 8002, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 7993, + "end": 8002, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 7995, + "end": 8002, + "ctxt": 0 + }, + "kind": "unknown" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 7966, + "end": 8111, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 8010, + "end": 8111, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 8016, + "end": 8064, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 8020, + "end": 8039, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 8020, + "end": 8025, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 8030, + "end": 8039, + "ctxt": 0 + }, + "value": "undefined", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 8041, + "end": 8064, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 8051, + "end": 8058, + "ctxt": 0 + }, + "argument": null + } + ] + }, + "alternate": null + }, + { + "type": "IfStatement", + "span": { + "start": 8069, + "end": 8109, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 8073, + "end": 8085, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 8073, + "end": 8078, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "NumericLiteral", + "span": { + "start": 8083, + "end": 8085, + "ctxt": 0 + }, + "value": 42.0, + "raw": "42" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 8087, + "end": 8109, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 8097, + "end": 8103, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 8097, + "end": 8102, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ] + }, + "alternate": null + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 8003, + "end": 8009, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8005, + "end": 8009, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8135, + "end": 8175, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8140, + "end": 8145, + "ctxt": 0 + }, + "value": "TypeA", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 8148, + "end": 8175, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 8154, + "end": 8161, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8154, + "end": 8155, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8155, + "end": 8160, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8157, + "end": 8160, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8157, + "end": 8160, + "ctxt": 0 + }, + "value": "A", + "raw": "'A'" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 8166, + "end": 8173, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8166, + "end": 8167, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8167, + "end": 8172, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8169, + "end": 8172, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8169, + "end": 8172, + "ctxt": 0 + }, + "value": "B", + "raw": "'B'" + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8177, + "end": 8229, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8182, + "end": 8187, + "ctxt": 0 + }, + "value": "TypeB", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeLiteral", + "span": { + "start": 8190, + "end": 8229, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 8196, + "end": 8203, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8196, + "end": 8197, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8197, + "end": 8202, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8199, + "end": 8202, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8199, + "end": 8202, + "ctxt": 0 + }, + "value": "A", + "raw": "'A'" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 8208, + "end": 8215, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8208, + "end": 8209, + "ctxt": 0 + }, + "value": "B", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8209, + "end": 8214, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8211, + "end": 8214, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8211, + "end": 8214, + "ctxt": 0 + }, + "value": "B", + "raw": "'B'" + } + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 8220, + "end": 8227, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8220, + "end": 8221, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8221, + "end": 8226, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8223, + "end": 8226, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8223, + "end": 8226, + "ctxt": 0 + }, + "value": "C", + "raw": "'C'" + } + } + }, + "typeParams": null + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8231, + "end": 8320, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8236, + "end": 8237, + "ctxt": 0 + }, + "value": "R", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 8237, + "end": 8260, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 8238, + "end": 8259, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8238, + "end": 8239, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeOperator", + "span": { + "start": 8248, + "end": 8259, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8254, + "end": 8259, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8254, + "end": 8259, + "ctxt": 0 + }, + "value": "TypeA", + "optional": false + }, + "typeParams": null + } + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8267, + "end": 8319, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 8267, + "end": 8268, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8267, + "end": 8268, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeOperator", + "span": { + "start": 8277, + "end": 8288, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8283, + "end": 8288, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8283, + "end": 8288, + "ctxt": 0 + }, + "value": "TypeB", + "optional": false + }, + "typeParams": null + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 8291, + "end": 8311, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 8292, + "end": 8300, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsIndexedAccessType", + "span": { + "start": 8292, + "end": 8300, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 8292, + "end": 8297, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8292, + "end": 8297, + "ctxt": 0 + }, + "value": "TypeA", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 8298, + "end": 8299, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8298, + "end": 8299, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 8302, + "end": 8310, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsIndexedAccessType", + "span": { + "start": 8302, + "end": 8310, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 8302, + "end": 8307, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8302, + "end": 8307, + "ctxt": 0 + }, + "value": "TypeB", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 8308, + "end": 8309, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8308, + "end": 8309, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8314, + "end": 8319, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8322, + "end": 8444, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8327, + "end": 8329, + "ctxt": 0 + }, + "value": "R2", + "optional": false + }, + "typeParams": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 8329, + "end": 8352, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 8330, + "end": 8351, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8330, + "end": 8331, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 8340, + "end": 8351, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8340, + "end": 8351, + "ctxt": 0 + }, + "value": "PropertyKey", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "typeAnnotation": { + "type": "TsConditionalType", + "span": { + "start": 8359, + "end": 8443, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 8359, + "end": 8360, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8359, + "end": 8360, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeOperator", + "span": { + "start": 8369, + "end": 8380, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8375, + "end": 8380, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8375, + "end": 8380, + "ctxt": 0 + }, + "value": "TypeA", + "optional": false + }, + "typeParams": null + } + }, + "trueType": { + "type": "TsConditionalType", + "span": { + "start": 8383, + "end": 8435, + "ctxt": 0 + }, + "checkType": { + "type": "TsTypeReference", + "span": { + "start": 8383, + "end": 8384, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8383, + "end": 8384, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + }, + "extendsType": { + "type": "TsTypeOperator", + "span": { + "start": 8393, + "end": 8404, + "ctxt": 0 + }, + "op": "keyof", + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8399, + "end": 8404, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8399, + "end": 8404, + "ctxt": 0 + }, + "value": "TypeB", + "optional": false + }, + "typeParams": null + } + }, + "trueType": { + "type": "TsTupleType", + "span": { + "start": 8407, + "end": 8427, + "ctxt": 0 + }, + "elemTypes": [ + { + "type": "TsTupleElement", + "span": { + "start": 8408, + "end": 8416, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsIndexedAccessType", + "span": { + "start": 8408, + "end": 8416, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 8408, + "end": 8413, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8408, + "end": 8413, + "ctxt": 0 + }, + "value": "TypeA", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 8414, + "end": 8415, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8414, + "end": 8415, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + }, + { + "type": "TsTupleElement", + "span": { + "start": 8418, + "end": 8426, + "ctxt": 0 + }, + "label": null, + "ty": { + "type": "TsIndexedAccessType", + "span": { + "start": 8418, + "end": 8426, + "ctxt": 0 + }, + "readonly": false, + "objectType": { + "type": "TsTypeReference", + "span": { + "start": 8418, + "end": 8423, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8418, + "end": 8423, + "ctxt": 0 + }, + "value": "TypeB", + "optional": false + }, + "typeParams": null + }, + "indexType": { + "type": "TsTypeReference", + "span": { + "start": 8424, + "end": 8425, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8424, + "end": 8425, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null + } + } + } + ] + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8430, + "end": 8435, + "ctxt": 0 + }, + "kind": "never" + } + }, + "falseType": { + "type": "TsKeywordType", + "span": { + "start": 8438, + "end": 8443, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8468, + "end": 8488, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8473, + "end": 8475, + "ctxt": 0 + }, + "value": "AB", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 8478, + "end": 8487, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 8478, + "end": 8481, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8478, + "end": 8481, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 8484, + "end": 8487, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8484, + "end": 8487, + "ctxt": 0 + }, + "value": "B", + "raw": "\"B\"" + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 8499, + "end": 8500, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 8518, + "end": 8537, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8518, + "end": 8537, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8519, + "end": 8537, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 8521, + "end": 8537, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8521, + "end": 8525, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8521, + "end": 8525, + "ctxt": 0 + }, + "value": "T_AB", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 8528, + "end": 8537, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + } + } + }, + { + "type": "Parameter", + "span": { + "start": 8539, + "end": 8545, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8539, + "end": 8545, + "ctxt": 0 + }, + "value": "y", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8540, + "end": 8545, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8542, + "end": 8545, + "ctxt": 0 + }, + "kind": "any" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 8490, + "end": 8593, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 8547, + "end": 8593, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 8553, + "end": 8591, + "ctxt": 0 + }, + "kind": "let", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 8557, + "end": 8590, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 8557, + "end": 8559, + "ctxt": 0 + }, + "value": "r2", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8559, + "end": 8566, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8561, + "end": 8566, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + "init": { + "type": "TsAsExpression", + "span": { + "start": 8569, + "end": 8590, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 8569, + "end": 8570, + "ctxt": 0 + }, + "value": "y", + "optional": false + }, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 8574, + "end": 8590, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8574, + "end": 8578, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8574, + "end": 8578, + "ctxt": 0 + }, + "value": "T_AB", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsKeywordType", + "span": { + "start": 8581, + "end": 8590, + "ctxt": 0 + }, + "kind": "undefined" + } + ] + } + }, + "definite": false + } + ] + } + ] + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TsTypeParameterDeclaration", + "span": { + "start": 8500, + "end": 8517, + "ctxt": 0 + }, + "parameters": [ + { + "type": "TsTypeParameter", + "span": { + "start": 8501, + "end": 8516, + "ctxt": 0 + }, + "name": { + "type": "Identifier", + "span": { + "start": 8501, + "end": 8505, + "ctxt": 0 + }, + "value": "T_AB", + "optional": false + }, + "in": false, + "out": false, + "const": false, + "constraint": { + "type": "TsTypeReference", + "span": { + "start": 8514, + "end": 8516, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8514, + "end": 8516, + "ctxt": 0 + }, + "value": "AB", + "optional": false + }, + "typeParams": null + }, + "default": null + } + ] + }, + "returnType": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8618, + "end": 8637, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8623, + "end": 8627, + "ctxt": 0 + }, + "value": "Left", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8630, + "end": 8636, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8630, + "end": 8636, + "ctxt": 0 + }, + "value": "left", + "raw": "'left'" + } + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8638, + "end": 8680, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8643, + "end": 8648, + "ctxt": 0 + }, + "value": "Right", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsIntersectionType", + "span": { + "start": 8651, + "end": 8679, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 8651, + "end": 8658, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8651, + "end": 8658, + "ctxt": 0 + }, + "value": "right", + "raw": "'right'" + } + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 8661, + "end": 8679, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 8663, + "end": 8677, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 8663, + "end": 8668, + "ctxt": 0 + }, + "value": "right", + "optional": false + }, + "computed": false, + "optional": false, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8668, + "end": 8677, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8670, + "end": 8677, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8670, + "end": 8677, + "ctxt": 0 + }, + "value": "right", + "raw": "'right'" + } + } + }, + "typeParams": null + } + ] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 8681, + "end": 8708, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 8686, + "end": 8692, + "ctxt": 0 + }, + "value": "Either", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 8695, + "end": 8707, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeReference", + "span": { + "start": 8695, + "end": 8699, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8695, + "end": 8699, + "ctxt": 0 + }, + "value": "Left", + "optional": false + }, + "typeParams": null + }, + { + "type": "TsTypeReference", + "span": { + "start": 8702, + "end": 8707, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8702, + "end": 8707, + "ctxt": 0 + }, + "value": "Right", + "optional": false + }, + "typeParams": null + } + ] + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 8719, + "end": 8730, + "ctxt": 0 + }, + "value": "assertNever", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 8731, + "end": 8739, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8731, + "end": 8739, + "ctxt": 0 + }, + "value": "v", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8732, + "end": 8739, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8734, + "end": 8739, + "ctxt": 0 + }, + "kind": "never" + } + } + } + } + ], + "decorators": [], + "span": { + "start": 8710, + "end": 8781, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 8748, + "end": 8781, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ThrowStatement", + "span": { + "start": 8754, + "end": 8779, + "ctxt": 0 + }, + "argument": { + "type": "NewExpression", + "span": { + "start": 8760, + "end": 8778, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 8764, + "end": 8769, + "ctxt": 0 + }, + "value": "Error", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 8770, + "end": 8777, + "ctxt": 0 + }, + "value": "never", + "raw": "'never'" + } + } + ], + "typeArguments": null + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 8740, + "end": 8747, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 8742, + "end": 8747, + "ctxt": 0 + }, + "kind": "never" + } + } + }, + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 8792, + "end": 8796, + "ctxt": 0 + }, + "value": "fx20", + "optional": false + }, + "declare": false, + "params": [ + { + "type": "Parameter", + "span": { + "start": 8797, + "end": 8810, + "ctxt": 0 + }, + "decorators": [], + "pat": { + "type": "Identifier", + "span": { + "start": 8797, + "end": 8810, + "ctxt": 0 + }, + "value": "value", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8802, + "end": 8810, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 8804, + "end": 8810, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 8804, + "end": 8810, + "ctxt": 0 + }, + "value": "Either", + "optional": false + }, + "typeParams": null + } + } + } + } + ], + "decorators": [], + "span": { + "start": 8783, + "end": 9005, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 8812, + "end": 9005, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 8818, + "end": 9003, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 8822, + "end": 8838, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 8822, + "end": 8827, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 8832, + "end": 8838, + "ctxt": 0 + }, + "value": "left", + "raw": "'left'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 8840, + "end": 8882, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 8850, + "end": 8876, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 8856, + "end": 8875, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 8856, + "end": 8859, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8859, + "end": 8867, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8861, + "end": 8867, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8861, + "end": 8867, + "ctxt": 0 + }, + "value": "left", + "raw": "'left'" + } + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 8870, + "end": 8875, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "alternate": { + "type": "IfStatement", + "span": { + "start": 8892, + "end": 9003, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 8896, + "end": 8913, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 8896, + "end": 8901, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 8906, + "end": 8913, + "ctxt": 0 + }, + "value": "right", + "raw": "'right'" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 8915, + "end": 8958, + "ctxt": 0 + }, + "stmts": [ + { + "type": "VariableDeclaration", + "span": { + "start": 8925, + "end": 8952, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 8931, + "end": 8951, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 8931, + "end": 8934, + "ctxt": 0 + }, + "value": "bar", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 8934, + "end": 8943, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 8936, + "end": 8943, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 8936, + "end": 8943, + "ctxt": 0 + }, + "value": "right", + "raw": "'right'" + } + } + } + }, + "init": { + "type": "Identifier", + "span": { + "start": 8946, + "end": 8951, + "ctxt": 0 + }, + "value": "value", + "optional": false + }, + "definite": false + } + ] + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 8968, + "end": 9003, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ExpressionStatement", + "span": { + "start": 8978, + "end": 8997, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 8978, + "end": 8996, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 8978, + "end": 8989, + "ctxt": 0 + }, + "value": "assertNever", + "optional": false + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "Identifier", + "span": { + "start": 8990, + "end": 8995, + "ctxt": 0 + }, + "value": "value", + "optional": false + } + } + ], + "typeArguments": null + } + } + ] + } + } + } + ] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.ts b/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.ts new file mode 100644 index 00000000000..0bd3a6512f1 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/unknownControlFlow.ts @@ -0,0 +1,453 @@ +// @strict: true +// @declaration: true + +type T01 = {} & string; // string +type T02 = {} & 'a'; // 'a' +type T03 = {} & object; // object +type T04 = {} & { x: number }; // { x: number } +type T05 = {} & null; // never +type T06 = {} & undefined; // never +type T07 = undefined & void; // undefined + +type T10 = string & {}; // Specially preserved +type T11 = number & {}; // Specially preserved +type T12 = bigint & {}; // Specially preserved + +type ThisNode = {}; +type ThatNode = {}; +type ThisOrThatNode = ThisNode | ThatNode; + +function f01(u: unknown) { + let x1: {} = u; // Error + let x2: {} | null | undefined = u; + let x3: {} | { x: string } | null | undefined = u; + let x4: ThisOrThatNode | null | undefined = u; +} + +function f10(x: unknown) { + if (x) { + x; // {} + } + else { + x; // unknown + } + if (!x) { + x; // unknown + } + else { + x; // {} + } +} + +function f11(x: T) { + if (x) { + x; // T & {} + } + else { + x; // T + } + if (!x) { + x; // T + } + else { + x; // T & {} + } +} + +function f12(x: T) { + if (x) { + x; // T + } + else { + x; // T + } +} + +function f20(x: unknown) { + if (x !== undefined) { + x; // {} | null + } + else { + x; // undefined + } + if (x !== null) { + x; // {} | undefined + } + else { + x; // null + } + if (x !== undefined && x !== null) { + x; // {} + } + else { + x; // null | undefined + } + if (x != undefined) { + x; // {} + } + else { + x; // null | undefined + } + if (x != null) { + x; // {} + } + else { + x; // null | undefined + } +} + +function f21(x: T) { + if (x !== undefined) { + x; // T & ({} | null) + } + else { + x; // T + } + if (x !== null) { + x; // T & ({} | undefined) + } + else { + x; // T + } + if (x !== undefined && x !== null) { + x; // T & {} + } + else { + x; // T + } + if (x != undefined) { + x; // T & {} + } + else { + x; // T + } + if (x != null) { + x; // T & {} + } + else { + x; // T + } +} + +function f22(x: T) { + if (x !== undefined) { + x; // T & {} + } + else { + x; // T + } + if (x !== null) { + x; // T + } + else { + x; // T + } + if (x !== undefined && x !== null) { + x; // T & {} + } + else { + x; // T + } + if (x != undefined) { + x; // T & {} + } + else { + x; // T + } + if (x != null) { + x; // T & {} + } + else { + x; // T + } +} + +function f23(x: T | undefined | null) { + if (x !== undefined) { + x; // T & {} | null + } + if (x !== null) { + x; // T & {} | undefined + } + if (x != undefined) { + x; // T & {} + } + if (x != null) { + x; // T & {} + } +} + +function f30(x: {}) { + if (typeof x === "object") { + x; // object + } +} + +function f31(x: T) { + if (typeof x === "object") { + x; // T & object | T & null + } + if (x && typeof x === "object") { + x; // T & object + } + if (typeof x === "object" && x) { + x; // T & object + } +} + +function f32(x: T) { + if (typeof x === "object") { + x; // T & object + } +} + +function possiblyNull(x: T) { + return !!true ? x : null; // T | null +} + +function possiblyUndefined(x: T) { + return !!true ? x : undefined; // T | undefined +} + +function possiblyNullOrUndefined(x: T) { + return possiblyUndefined(possiblyNull(x)); // T | null | undefined +} + +function ensureNotNull(x: T) { + if (x === null) throw Error(); + return x; // T & ({} | undefined) +} + +function ensureNotUndefined(x: T) { + if (x === undefined) throw Error(); + return x; // T & ({} | null) +} + +function ensureNotNullOrUndefined(x: T) { + return ensureNotUndefined(ensureNotNull(x)); // T & {} +} + +function f40(a: string | undefined, b: number | null | undefined) { + let a1 = ensureNotNullOrUndefined(a); // string + let b1 = ensureNotNullOrUndefined(b); // number +} + +type QQ = NonNullable>>; + +function f41(a: T) { + let a1 = ensureNotUndefined(ensureNotNull(a)); // T & {} + let a2 = ensureNotNull(ensureNotUndefined(a)); // T & {} + let a3 = ensureNotNull(ensureNotNull(a)); // T & {} | T & undefined + let a4 = ensureNotUndefined(ensureNotUndefined(a)); // T & {} | T & null + let a5 = ensureNotNullOrUndefined(ensureNotNullOrUndefined(a)); // T & {} + let a6 = ensureNotNull(possiblyNullOrUndefined(a)); // T & {} | undefined + let a7 = ensureNotUndefined(possiblyNullOrUndefined(a)); // T & {} | null + let a8 = ensureNotNull(possiblyUndefined(a)); // T & {} | undefined + let a9 = ensureNotUndefined(possiblyNull(a)); // T & {} | null +} + +// Repro from #48468 + +function deepEquals(a: T, b: T): boolean { + if (typeof a !== 'object' || typeof b !== 'object' || !a || !b) { + return false; + } + if (Array.isArray(a) || Array.isArray(b)) { + return false; + } + if (Object.keys(a).length !== Object.keys(b).length) { // Error here + return false; + } + return true; +} + +// Repro from #49386 + +function foo(x: T | null) { + let y = x; + if (y !== null) { + y; + } +} + +// We allow an unconstrained object of a generic type `T` to be indexed by a key of type `keyof T` +// without a check that the object is non-undefined and non-null. This is safe because `keyof T` +// is `never` (meaning no possible keys) for any `T` that includes `undefined` or `null`. + +function ff1(t: T, k: keyof T) { + t[k]; +} + +function ff2(t: T & {}, k: keyof T) { + t[k]; +} + +function ff3(t: T, k: keyof (T & {})) { + t[k]; // Error +} + +function ff4(t: T & {}, k: keyof (T & {})) { + t[k]; +} + +ff1(null, 'foo'); // Error +ff2(null, 'foo'); // Error +ff3(null, 'foo'); +ff4(null, 'foo'); // Error + +// Repro from #49681 + +type Foo = { [key: string]: unknown }; +type NullableFoo = Foo | undefined; + +type Bar = NonNullable[string]; + +// Generics and intersections with {} + +function fx0(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +function fx1(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +function fx2(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +function fx3(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +function fx4(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +function fx5(value: T & ({} | null)) { + if (value === 42) { + value; // T & {} + } + else { + value; // T & ({} | null) + } +} + +// Double-equals narrowing + +function fx10(x: string | number, y: number) { + if (x == y) { + x; // string | number + } + else { + x; // string | number + } + if (x != y) { + x; // string | number + } + else { + x; // string | number + } +} + +// Repros from #50706 + +function SendBlob(encoding: unknown) { + if (encoding !== undefined && encoding !== 'utf8') { + throw new Error('encoding'); + } + encoding; +}; + +function doSomething1(value: T): T { + if (value === undefined) { + return value; + } + if (value === 42) { + throw Error('Meaning of life value'); + } + return value; +} + +function doSomething2(value: unknown): void { + if (value === undefined) { + return; + } + if (value === 42) { + value; + } +} + +// Repro from #51009 + +type TypeA = { + A: 'A', + B: 'B', +} + +type TypeB = { + A: 'A', + B: 'B', + C: 'C', +} + +type R = + T extends keyof TypeB ? [TypeA[T], TypeB[T]] : never; + +type R2 = + T extends keyof TypeA ? T extends keyof TypeB ? [TypeA[T], TypeB[T]] : never : never; + +// Repro from #51041 + +type AB = "A" | "B"; + +function x(x: T_AB & undefined, y: any) { + let r2: never = y as T_AB & undefined; +} + +// Repro from #51538 + +type Left = 'left'; +type Right = 'right' & { right: 'right' }; +type Either = Left | Right; + +function assertNever(v: never): never { + throw new Error('never'); +} + +function fx20(value: Either) { + if (value === 'left') { + const foo: 'left' = value; + } + else if (value === 'right') { + const bar: 'right' = value; + } + else { + assertNever(value); + } +} diff --git a/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.json b/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.json new file mode 100644 index 00000000000..c2fd0fcb799 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.json @@ -0,0 +1,377 @@ +{ + "type": "Module", + "span": { + "start": 20, + "end": 236, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 29, + "end": 30, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "declare": false, + "params": [], + "decorators": [], + "span": { + "start": 20, + "end": 35, + "ctxt": 0 + }, + "body": { + "type": "BlockStatement", + "span": { + "start": 33, + "end": 35, + "ctxt": 0 + }, + "stmts": [] + }, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 36, + "end": 49, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 45, + "end": 46, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 45, + "end": 46, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 70, + "end": 94, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 79, + "end": 80, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 79, + "end": 80, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 88, + "end": 93, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 95, + "end": 106, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 100, + "end": 101, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 104, + "end": 105, + "ctxt": 0 + }, + "literal": { + "type": "NumericLiteral", + "span": { + "start": 104, + "end": 105, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + } + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 107, + "end": 120, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 116, + "end": 117, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 116, + "end": 117, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 141, + "end": 165, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 150, + "end": 151, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 150, + "end": 151, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 159, + "end": 164, + "ctxt": 0 + }, + "value": "./b", + "raw": "\"./b\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 166, + "end": 215, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 176, + "end": 177, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 178, + "end": 215, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 182, + "end": 213, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 189, + "end": 213, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 195, + "end": 212, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 195, + "end": 206, + "ctxt": 0 + }, + "value": "displayName", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "StringLiteral", + "span": { + "start": 209, + "end": 212, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + }, + "definite": false + } + ] + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 217, + "end": 221, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 217, + "end": 220, + "ctxt": 0 + }, + "callee": { + "type": "Identifier", + "span": { + "start": 217, + "end": 218, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "arguments": [], + "typeArguments": null + } + }, + { + "type": "ExpressionStatement", + "span": { + "start": 222, + "end": 236, + "ctxt": 0 + }, + "expression": { + "type": "MemberExpression", + "span": { + "start": 222, + "end": 235, + "ctxt": 0 + }, + "object": { + "type": "Identifier", + "span": { + "start": 222, + "end": 223, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "property": { + "type": "Identifier", + "span": { + "start": 224, + "end": 235, + "ctxt": 0 + }, + "value": "displayName", + "optional": false + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.ts b/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.ts new file mode 100644 index 00000000000..00ae4f8fa63 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/valuesMergingAcrossModules.ts @@ -0,0 +1,17 @@ +// @Filename: a.ts +function A() {} +export { A }; + +// @Filename: b.ts +import { A } from "./a"; +type A = 0; +export { A }; + +// @Filename: c.ts +import { A } from "./b"; +namespace A { + export const displayName = "A"; +} + +A(); +A.displayName; diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.json new file mode 100644 index 00000000000..4ca2e62f2ed --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.json @@ -0,0 +1,23 @@ +{ + "type": "Module", + "span": { + "start": 188, + "end": 198, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 188, + "end": 198, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.ts new file mode 100644 index 00000000000..0c280a26530 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxCompat.ts @@ -0,0 +1,9 @@ +// @verbatimModuleSyntax: true +// @isolatedModules: true +// @preserveValueImports: true +// @importsNotUsedAsValues: error +// @module: system +// @noEmit: true +// @noTypesAndSymbols: true + +export {}; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.json new file mode 100644 index 00000000000..50e76c38565 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.json @@ -0,0 +1,69 @@ +{ + "type": "Module", + "span": { + "start": 52, + "end": 86, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 52, + "end": 86, + "ctxt": 0 + }, + "declaration": { + "type": "TsEnumDeclaration", + "span": { + "start": 59, + "end": 86, + "ctxt": 0 + }, + "declare": false, + "isConst": true, + "id": { + "type": "Identifier", + "span": { + "start": 70, + "end": 71, + "ctxt": 0 + }, + "value": "E", + "optional": false + }, + "members": [ + { + "type": "TsEnumMember", + "span": { + "start": 78, + "end": 83, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 78, + "end": 79, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 82, + "end": 83, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.ts new file mode 100644 index 00000000000..610cb071aa6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxConstEnum.ts @@ -0,0 +1,6 @@ +// @verbatimModuleSyntax: true +// @module: esnext + +export const enum E { + A = 1, +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.json new file mode 100644 index 00000000000..639b5cd2044 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.json @@ -0,0 +1,259 @@ +{ + "type": "Module", + "span": { + "start": 52, + "end": 198, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 52, + "end": 62, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 63, + "end": 87, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 70, + "end": 72, + "ctxt": 0 + }, + "value": "f1", + "optional": false + }, + "moduleRef": { + "type": "Identifier", + "span": { + "start": 75, + "end": 86, + "ctxt": 0 + }, + "value": "NonExistent", + "optional": false + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 89, + "end": 157, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 99, + "end": 102, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 103, + "end": 157, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 109, + "end": 130, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 116, + "end": 130, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 122, + "end": 129, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 122, + "end": 125, + "ctxt": 0 + }, + "value": "foo", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 128, + "end": 129, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 135, + "end": 155, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 142, + "end": 155, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 147, + "end": 148, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 151, + "end": 154, + "ctxt": 0 + }, + "kind": "any" + } + } + } + ] + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 159, + "end": 179, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 166, + "end": 168, + "ctxt": 0 + }, + "value": "f2", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 171, + "end": 174, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 175, + "end": 178, + "ctxt": 0 + }, + "value": "foo", + "optional": false + } + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 180, + "end": 198, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 187, + "end": 189, + "ctxt": 0 + }, + "value": "f3", + "optional": false + }, + "moduleRef": { + "type": "TsQualifiedName", + "left": { + "type": "Identifier", + "span": { + "start": 192, + "end": 195, + "ctxt": 0 + }, + "value": "Foo", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 196, + "end": 197, + "ctxt": 0 + }, + "value": "T", + "optional": false + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.ts new file mode 100644 index 00000000000..a15b27cd2d3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxInternalImportEquals.ts @@ -0,0 +1,13 @@ +// @verbatimModuleSyntax: true +// @module: esnext + +export {}; +import f1 = NonExistent; + +namespace Foo { + export const foo = 1; + export type T = any; +} + +import f2 = Foo.foo; +import f3 = Foo.T; diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.json new file mode 100644 index 00000000000..16ef5a5a005 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.json @@ -0,0 +1,468 @@ +{ + "type": "Module", + "span": { + "start": 120, + "end": 503, + "ctxt": 0 + }, + "body": [ + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 120, + "end": 134, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 130, + "end": 131, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 132, + "end": 134, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 135, + "end": 146, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 144, + "end": 145, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 168, + "end": 194, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 175, + "end": 176, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 179, + "end": 193, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 187, + "end": 192, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + } + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 216, + "end": 230, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 226, + "end": 227, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 228, + "end": 230, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 231, + "end": 270, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 241, + "end": 242, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 243, + "end": 270, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 249, + "end": 268, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 256, + "end": 268, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 262, + "end": 267, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 262, + "end": 263, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 266, + "end": 267, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + } + ] + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 271, + "end": 282, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 280, + "end": 281, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 304, + "end": 330, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 311, + "end": 312, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 315, + "end": 329, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 323, + "end": 328, + "ctxt": 0 + }, + "value": "./c", + "raw": "\"./c\"" + } + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 331, + "end": 362, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": true, + "id": { + "type": "Identifier", + "span": { + "start": 343, + "end": 344, + "ctxt": 0 + }, + "value": "J", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 347, + "end": 361, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 355, + "end": 360, + "ctxt": 0 + }, + "value": "./c", + "raw": "\"./c\"" + } + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 363, + "end": 374, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 372, + "end": 373, + "ctxt": 0 + }, + "value": "J", + "optional": false + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 398, + "end": 412, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 408, + "end": 409, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 410, + "end": 412, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 413, + "end": 424, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 422, + "end": 423, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 446, + "end": 477, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": true, + "id": { + "type": "Identifier", + "span": { + "start": 458, + "end": 459, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 462, + "end": 476, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 470, + "end": 475, + "ctxt": 0 + }, + "value": "./e", + "raw": "\"./e\"" + } + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 478, + "end": 491, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 484, + "end": 490, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 484, + "end": 485, + "ctxt": 0 + }, + "value": "I", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ObjectExpression", + "span": { + "start": 488, + "end": 490, + "ctxt": 0 + }, + "properties": [] + }, + "definite": false + } + ] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 492, + "end": 503, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 501, + "end": 502, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.ts new file mode 100644 index 00000000000..989d14d20d6 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionCJS.ts @@ -0,0 +1,35 @@ +// @verbatimModuleSyntax: true +// @target: esnext +// @module: commonjs +// @moduleResolution: node + +// @Filename: /a.ts +interface I {} +export = I; + +// @Filename: /b.ts +import I = require("./a"); + +// @Filename: /c.ts +interface I {} +namespace I { + export const x = 1; +} +export = I; + +// @Filename: /d.ts +import I = require("./c"); +import type J = require("./c"); +export = J; + +// @Filename: /e.d.ts +interface I {} +export = I; + +// @Filename: /f.ts +import type I = require("./e"); +const I = {}; +export = I; + +// @Filename: /z.ts +// test harness is weird if the last file includs a require >:( \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.json new file mode 100644 index 00000000000..7dcbc106055 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.json @@ -0,0 +1,782 @@ +{ + "type": "Module", + "span": { + "start": 99, + "end": 766, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 99, + "end": 118, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 106, + "end": 118, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 112, + "end": 117, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 112, + "end": 113, + "ctxt": 0 + }, + "value": "a", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 116, + "end": 117, + "ctxt": 0 + }, + "value": 0.0, + "raw": "0" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 119, + "end": 144, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 126, + "end": 144, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 131, + "end": 132, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 135, + "end": 143, + "ctxt": 0 + }, + "exprName": { + "type": "Identifier", + "span": { + "start": 142, + "end": 143, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "typeArguments": null + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 145, + "end": 167, + "ctxt": 0 + }, + "declaration": { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 158, + "end": 164, + "ctxt": 0 + }, + "value": "AClass", + "optional": false + }, + "declare": false, + "span": { + "start": 152, + "end": 167, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 189, + "end": 224, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 198, + "end": 199, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 198, + "end": 199, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 201, + "end": 202, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 201, + "end": 202, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "imported": null, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 204, + "end": 210, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 204, + "end": 210, + "ctxt": 0 + }, + "value": "AClass", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 218, + "end": 223, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 225, + "end": 276, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 239, + "end": 250, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 244, + "end": 250, + "ctxt": 0 + }, + "value": "aValue", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 239, + "end": 240, + "ctxt": 0 + }, + "value": "a", + "optional": false + }, + "isTypeOnly": false + }, + { + "type": "ImportSpecifier", + "span": { + "start": 252, + "end": 262, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 257, + "end": 262, + "ctxt": 0 + }, + "value": "AType", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 252, + "end": 253, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 270, + "end": 275, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 277, + "end": 316, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 286, + "end": 302, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 296, + "end": 302, + "ctxt": 0 + }, + "value": "AType2", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 291, + "end": 292, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 310, + "end": 315, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 318, + "end": 331, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 327, + "end": 328, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 327, + "end": 328, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 332, + "end": 362, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 341, + "end": 348, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 341, + "end": 342, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 346, + "end": 348, + "ctxt": 0 + }, + "value": "A2", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 356, + "end": 361, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 363, + "end": 398, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 377, + "end": 384, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 377, + "end": 378, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 382, + "end": 384, + "ctxt": 0 + }, + "value": "A3", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 392, + "end": 397, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 399, + "end": 434, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 408, + "end": 420, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 413, + "end": 414, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 418, + "end": 420, + "ctxt": 0 + }, + "value": "A4", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 428, + "end": 433, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 435, + "end": 469, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 449, + "end": 455, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 449, + "end": 455, + "ctxt": 0 + }, + "value": "AClass", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 463, + "end": 468, + "ctxt": 0 + }, + "value": "./a", + "raw": "\"./a\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 491, + "end": 520, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 500, + "end": 506, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 500, + "end": 506, + "ctxt": 0 + }, + "value": "AClass", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 514, + "end": 519, + "ctxt": 0 + }, + "value": "./b", + "raw": "\"./b\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 546, + "end": 563, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 561, + "end": 562, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "ExportDefaultDeclaration", + "span": { + "start": 595, + "end": 620, + "ctxt": 0 + }, + "decl": { + "type": "ClassExpression", + "identifier": { + "type": "Identifier", + "span": { + "start": 616, + "end": 617, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "span": { + "start": 610, + "end": 620, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 652, + "end": 666, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 662, + "end": 663, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 664, + "end": 666, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 667, + "end": 684, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 682, + "end": 683, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 719, + "end": 748, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 731, + "end": 732, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 731, + "end": 732, + "ctxt": 0 + }, + "value": "C", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 738, + "end": 747, + "ctxt": 0 + }, + "value": "./main5", + "raw": "\"./main5\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 749, + "end": 766, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 764, + "end": 765, + "ctxt": 0 + }, + "value": "C", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.ts new file mode 100644 index 00000000000..71a3ee277bb --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxNoElisionESM.ts @@ -0,0 +1,36 @@ +// @verbatimModuleSyntax: true +// @module: esnext +// @moduleResolution: node + +// @Filename: /a.ts +export const a = 0; +export type A = typeof a; +export class AClass {} + +// @Filename: /b.ts +import { a, A, AClass } from "./a"; +import type { a as aValue, A as AType } from "./a"; +import { type A as AType2 } from "./a"; + +export { A }; +export { A as A2 } from "./a"; +export type { A as A3 } from "./a"; +export { type A as A4 } from "./a"; +export type { AClass } from "./a"; + +// @Filename: /c.ts +import { AClass } from "./b"; + +// @Filename: /main4.ts +export default 1; // ok + +// @Filename: /main5.ts +export default class C {} // ok + +// @Filename: /main6.ts +interface I {} +export default I; // error + +// @Filename: /main7.ts +import type C from "./main5"; +export default C; // error diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.json new file mode 100644 index 00000000000..cb487f81eb4 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.json @@ -0,0 +1,1186 @@ +{ + "type": "Module", + "span": { + "start": 151, + "end": 1345, + "ctxt": 0 + }, + "body": [ + { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 168, + "end": 172, + "ctxt": 0 + }, + "value": "esmy", + "optional": false + }, + "declare": true, + "params": [], + "decorators": [], + "span": { + "start": 151, + "end": 181, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 174, + "end": 180, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 176, + "end": 180, + "ctxt": 0 + }, + "kind": "void" + } + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 182, + "end": 202, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 197, + "end": 201, + "ctxt": 0 + }, + "value": "esmy", + "optional": false + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 203, + "end": 244, + "ctxt": 0 + }, + "declaration": { + "type": "FunctionDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 227, + "end": 235, + "ctxt": 0 + }, + "value": "funciton", + "optional": false + }, + "declare": true, + "params": [], + "decorators": [], + "span": { + "start": 210, + "end": 244, + "ctxt": 0 + }, + "body": null, + "generator": false, + "async": false, + "typeParameters": null, + "returnType": { + "type": "TsTypeAnnotation", + "span": { + "start": 237, + "end": 243, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 239, + "end": 243, + "ctxt": 0 + }, + "kind": "void" + } + } + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 274, + "end": 359, + "ctxt": 0 + }, + "declare": true, + "global": false, + "id": { + "type": "StringLiteral", + "span": { + "start": 289, + "end": 298, + "ctxt": 0 + }, + "value": "ambient", + "raw": "\"ambient\"" + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 299, + "end": 359, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 305, + "end": 328, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 311, + "end": 327, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 311, + "end": 319, + "ctxt": 0 + }, + "value": "_default", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 319, + "end": 327, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 321, + "end": 327, + "ctxt": 0 + }, + "kind": "number" + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 333, + "end": 357, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 348, + "end": 356, + "ctxt": 0 + }, + "value": "_default", + "optional": false + } + } + ] + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 384, + "end": 410, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 391, + "end": 395, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 391, + "end": 395, + "ctxt": 0 + }, + "value": "esmy", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 401, + "end": 409, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 420, + "end": 452, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "span": { + "start": 427, + "end": 437, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 432, + "end": 437, + "ctxt": 0 + }, + "value": "esmy2", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 443, + "end": 451, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 462, + "end": 496, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 471, + "end": 479, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 471, + "end": 479, + "ctxt": 0 + }, + "value": "funciton", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 487, + "end": 495, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 506, + "end": 558, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 520, + "end": 541, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 532, + "end": 541, + "ctxt": 0 + }, + "value": "funciton2", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 520, + "end": 528, + "ctxt": 0 + }, + "value": "funciton", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 549, + "end": 557, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 574, + "end": 591, + "ctxt": 0 + }, + "expression": { + "type": "CallExpression", + "span": { + "start": 574, + "end": 590, + "ctxt": 0 + }, + "callee": { + "type": "Import", + "span": { + "start": 574, + "end": 580, + "ctxt": 0 + } + }, + "arguments": [ + { + "spread": null, + "expression": { + "type": "StringLiteral", + "span": { + "start": 581, + "end": 589, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + } + } + ], + "typeArguments": null + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 601, + "end": 634, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 606, + "end": 607, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsTypeQuery", + "span": { + "start": 610, + "end": 633, + "ctxt": 0 + }, + "exprName": { + "type": "TsImportType", + "span": { + "start": 617, + "end": 633, + "ctxt": 0 + }, + "argument": { + "type": "StringLiteral", + "span": { + "start": 624, + "end": 632, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "qualifier": null, + "typeArguments": null + }, + "typeArguments": null + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 641, + "end": 651, + "ctxt": 0 + }, + "specifiers": [], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 661, + "end": 680, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 668, + "end": 680, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 674, + "end": 679, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 674, + "end": 675, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 678, + "end": 679, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 690, + "end": 711, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 697, + "end": 711, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 707, + "end": 708, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 709, + "end": 711, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 718, + "end": 736, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 732, + "end": 733, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 732, + "end": 733, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDeclaration", + "span": { + "start": 743, + "end": 801, + "ctxt": 0 + }, + "declaration": { + "type": "TsModuleDeclaration", + "span": { + "start": 750, + "end": 801, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 760, + "end": 769, + "ctxt": 0 + }, + "value": "JustTypes", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 770, + "end": 801, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 776, + "end": 799, + "ctxt": 0 + }, + "declaration": { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 783, + "end": 799, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 788, + "end": 789, + "ctxt": 0 + }, + "value": "T", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 792, + "end": 798, + "ctxt": 0 + }, + "kind": "number" + } + } + } + ] + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 802, + "end": 862, + "ctxt": 0 + }, + "declaration": { + "type": "TsModuleDeclaration", + "span": { + "start": 809, + "end": 862, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 819, + "end": 825, + "ctxt": 0 + }, + "value": "Values", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 826, + "end": 862, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 841, + "end": 860, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 848, + "end": 860, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 854, + "end": 859, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 854, + "end": 855, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 858, + "end": 859, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + } + ] + } + } + }, + { + "type": "ExportDefaultDeclaration", + "span": { + "start": 863, + "end": 898, + "ctxt": 0 + }, + "decl": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 878, + "end": 898, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 888, + "end": 895, + "ctxt": 0 + }, + "value": "Default", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 896, + "end": 898, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 943, + "end": 964, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 950, + "end": 964, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 960, + "end": 961, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 962, + "end": 964, + "ctxt": 0 + }, + "body": [] + } + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 965, + "end": 983, + "ctxt": 0 + }, + "expression": { + "type": "ObjectExpression", + "span": { + "start": 974, + "end": 982, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 976, + "end": 977, + "ctxt": 0 + }, + "value": "x", + "optional": false + }, + "value": { + "type": "NumericLiteral", + "span": { + "start": 979, + "end": 980, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + } + ] + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 1009, + "end": 1075, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 1019, + "end": 1021, + "ctxt": 0 + }, + "value": "ns", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 1022, + "end": 1075, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 1028, + "end": 1047, + "ctxt": 0 + }, + "declaration": { + "type": "VariableDeclaration", + "span": { + "start": 1035, + "end": 1047, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 1041, + "end": 1046, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1041, + "end": 1042, + "ctxt": 0 + }, + "value": "x", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "NumericLiteral", + "span": { + "start": 1045, + "end": 1046, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + }, + "definite": false + } + ] + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 1052, + "end": 1073, + "ctxt": 0 + }, + "declaration": { + "type": "TsInterfaceDeclaration", + "span": { + "start": 1059, + "end": 1073, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1069, + "end": 1070, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 1071, + "end": 1073, + "ctxt": 0 + }, + "body": [] + } + } + } + ] + } + }, + { + "type": "TsExportAssignment", + "span": { + "start": 1076, + "end": 1088, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1085, + "end": 1087, + "ctxt": 0 + }, + "value": "ns", + "optional": false + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 1114, + "end": 1131, + "ctxt": 0 + }, + "expression": { + "type": "NumericLiteral", + "span": { + "start": 1129, + "end": 1130, + "ctxt": 0 + }, + "value": 1.0, + "raw": "1" + } + }, + { + "type": "ExportDefaultDeclaration", + "span": { + "start": 1166, + "end": 1191, + "ctxt": 0 + }, + "decl": { + "type": "ClassExpression", + "identifier": { + "type": "Identifier", + "span": { + "start": 1187, + "end": 1188, + "ctxt": 0 + }, + "value": "C", + "optional": false + }, + "span": { + "start": 1181, + "end": 1191, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 1226, + "end": 1240, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 1236, + "end": 1237, + "ctxt": 0 + }, + "value": "I", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 1238, + "end": 1240, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 1241, + "end": 1258, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1256, + "end": 1257, + "ctxt": 0 + }, + "value": "I", + "optional": false + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 1293, + "end": 1324, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 1305, + "end": 1309, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 1305, + "end": 1309, + "ctxt": 0 + }, + "value": "esmy", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 1315, + "end": 1323, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportDefaultExpression", + "span": { + "start": 1325, + "end": 1345, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 1340, + "end": 1344, + "ctxt": 0 + }, + "value": "esmy", + "optional": false + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.ts new file mode 100644 index 00000000000..c01dde661fd --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsCJS.ts @@ -0,0 +1,60 @@ +// @verbatimModuleSyntax: true +// @target: esnext +// @module: commonjs +// @moduleResolution: node +// @esModuleInterop: true + +// @Filename: /decl.d.ts +declare function esmy(): void; +export default esmy; +export declare function funciton(): void; + +// @Filename: /ambient.d.ts +declare module "ambient" { + const _default: number; + export default _default; +} + +// @Filename: /main.ts +import esmy from "./decl"; // error +import * as esmy2 from "./decl"; // error +import { funciton } from "./decl"; // error +import type { funciton as funciton2 } from "./decl"; // ok I guess? +import("./decl"); // error +type T = typeof import("./decl"); // ok +export {}; // error +export const x = 1; // error +export interface I {} // ok +export type { T }; // ok +export namespace JustTypes { + export type T = number; +} +export namespace Values { // error + export const x = 1; +} +export default interface Default {} // sketchy, but ok + +// @Filename: /main2.ts +export interface I {} +export = { x: 1 }; + +// @Filename: /main3.ts +namespace ns { + export const x = 1; + export interface I {} +} +export = ns; + +// @Filename: /main4.ts +export default 1; // error + +// @Filename: /main5.ts +export default class C {} // error + +// @Filename: /main6.ts +interface I {} +export default I; // error + +// @Filename: /main7.ts +import type esmy from "./decl"; +export default esmy; // error diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.json b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.json new file mode 100644 index 00000000000..29192234da3 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.json @@ -0,0 +1,458 @@ +{ + "type": "Module", + "span": { + "start": 156, + "end": 652, + "ctxt": 0 + }, + "body": [ + { + "type": "ClassDeclaration", + "identifier": { + "type": "Identifier", + "span": { + "start": 170, + "end": 174, + "ctxt": 0 + }, + "value": "CJSy", + "optional": false + }, + "declare": true, + "span": { + "start": 156, + "end": 177, + "ctxt": 0 + }, + "decorators": [], + "body": [], + "superClass": null, + "isAbstract": false, + "typeParams": null, + "superTypeParams": null, + "implements": [] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 178, + "end": 192, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 187, + "end": 191, + "ctxt": 0 + }, + "value": "CJSy", + "optional": false + } + }, + { + "type": "TsModuleDeclaration", + "span": { + "start": 222, + "end": 299, + "ctxt": 0 + }, + "declare": true, + "global": false, + "id": { + "type": "StringLiteral", + "span": { + "start": 237, + "end": 246, + "ctxt": 0 + }, + "value": "ambient", + "raw": "\"ambient\"" + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 247, + "end": 299, + "ctxt": 0 + }, + "body": [ + { + "type": "VariableDeclaration", + "span": { + "start": 253, + "end": 275, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 259, + "end": 274, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 259, + "end": 266, + "ctxt": 0 + }, + "value": "_export", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 266, + "end": 274, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 268, + "end": 274, + "ctxt": 0 + }, + "kind": "number" + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "TsExportAssignment", + "span": { + "start": 280, + "end": 297, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 289, + "end": 296, + "ctxt": 0 + }, + "value": "_export", + "optional": false + } + } + ] + } + }, + { + "type": "TsInterfaceDeclaration", + "span": { + "start": 325, + "end": 343, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 335, + "end": 340, + "ctxt": 0 + }, + "value": "Typey", + "optional": false + }, + "declare": false, + "typeParams": null, + "extends": [], + "body": { + "type": "TsInterfaceBody", + "span": { + "start": 341, + "end": 343, + "ctxt": 0 + }, + "body": [] + } + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 344, + "end": 366, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 358, + "end": 363, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 358, + "end": 363, + "ctxt": 0 + }, + "value": "Typey", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 391, + "end": 423, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": false, + "id": { + "type": "Identifier", + "span": { + "start": 398, + "end": 402, + "ctxt": 0 + }, + "value": "CJSy", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 405, + "end": 422, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 413, + "end": 421, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + } + } + }, + { + "type": "TsImportEqualsDeclaration", + "span": { + "start": 433, + "end": 471, + "ctxt": 0 + }, + "declare": false, + "isExport": false, + "isTypeOnly": true, + "id": { + "type": "Identifier", + "span": { + "start": 445, + "end": 450, + "ctxt": 0 + }, + "value": "CJSy2", + "optional": false + }, + "moduleRef": { + "type": "TsExternalModuleReference", + "span": { + "start": 453, + "end": 470, + "ctxt": 0 + }, + "expression": { + "type": "StringLiteral", + "span": { + "start": 461, + "end": 469, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + } + } + }, + { + "type": "ImportDeclaration", + "span": { + "start": 487, + "end": 514, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "span": { + "start": 494, + "end": 499, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 494, + "end": 499, + "ctxt": 0 + }, + "value": "CJSy3", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 505, + "end": 513, + "ctxt": 0 + }, + "value": "./decl", + "raw": "\"./decl\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 540, + "end": 573, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "span": { + "start": 547, + "end": 557, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 552, + "end": 557, + "ctxt": 0 + }, + "value": "types", + "optional": false + } + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 563, + "end": 572, + "ctxt": 0 + }, + "value": "./types", + "raw": "\"./types\"" + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExpressionStatement", + "span": { + "start": 580, + "end": 585, + "ctxt": 0 + }, + "expression": { + "type": "Identifier", + "span": { + "start": 580, + "end": 584, + "ctxt": 0 + }, + "value": "CJSy", + "optional": false + } + }, + { + "type": "ExportDeclaration", + "span": { + "start": 608, + "end": 652, + "ctxt": 0 + }, + "declaration": { + "type": "TsModuleDeclaration", + "span": { + "start": 615, + "end": 652, + "ctxt": 0 + }, + "declare": false, + "global": false, + "id": { + "type": "Identifier", + "span": { + "start": 625, + "end": 627, + "ctxt": 0 + }, + "value": "ns", + "optional": false + }, + "body": { + "type": "TsModuleBlock", + "span": { + "start": 628, + "end": 652, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportDeclaration", + "span": { + "start": 634, + "end": 650, + "ctxt": 0 + }, + "declaration": { + "type": "TsEnumDeclaration", + "span": { + "start": 641, + "end": 650, + "ctxt": 0 + }, + "declare": false, + "isConst": false, + "id": { + "type": "Identifier", + "span": { + "start": 646, + "end": 647, + "ctxt": 0 + }, + "value": "A", + "optional": false + }, + "members": [] + } + } + ] + } + } + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.ts b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.ts new file mode 100644 index 00000000000..bdcfe1f5b09 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/verbatimModuleSyntaxRestrictionsESM.ts @@ -0,0 +1,31 @@ +// @verbatimModuleSyntax: true +// @target: esnext +// @module: esnext +// @moduleResolution: node +// @esModuleInterop: true, false + +// @Filename: /decl.d.ts +declare class CJSy {} +export = CJSy; + +// @Filename: /ambient.d.ts +declare module "ambient" { + const _export: number; + export = _export; +} + +// @Filename: /types.ts +interface Typey {} +export type { Typey }; + +// @Filename: /main.ts +import CJSy = require("./decl"); // error +import type CJSy2 = require("./decl"); // ok I guess? +import CJSy3 from "./decl"; // ok in esModuleInterop +import * as types from "./types"; // ok +CJSy; + +// @Filename: /ns.ts +export namespace ns { + export enum A {} +} diff --git a/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.json b/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.json deleted file mode 100644 index 5666428e4f5..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "type": "Script", - "span": { - "start": 48, - "end": 124, - "ctxt": 0 - }, - "body": [ - { - "type": "VariableDeclaration", - "span": { - "start": 48, - "end": 68, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 52, - "end": 61, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 52, - "end": 55, - "ctxt": 0 - }, - "value": "ANY", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "Identifier", - "span": { - "start": 58, - "end": 61, - "ctxt": 0 - }, - "value": "ANY", - "optional": false - }, - "definite": false - } - ] - }, - { - "type": "VariableDeclaration", - "span": { - "start": 107, - "end": 124, - "ctxt": 0 - }, - "kind": "var", - "declare": false, - "declarations": [ - { - "type": "VariableDeclarator", - "span": { - "start": 111, - "end": 122, - "ctxt": 0 - }, - "id": { - "type": "Identifier", - "span": { - "start": 111, - "end": 115, - "ctxt": 0 - }, - "value": "ANY1", - "optional": false, - "typeAnnotation": null - }, - "init": { - "type": "UnaryExpression", - "span": { - "start": 118, - "end": 122, - "ctxt": 0 - }, - "operator": "void", - "argument": { - "type": "Invalid", - "span": { - "start": 122, - "end": 122, - "ctxt": 0 - } - } - }, - "definite": false - } - ] - } - ], - "interpreter": null -} diff --git a/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.ts b/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.ts deleted file mode 100644 index 7eb4b20abe8..00000000000 --- a/crates/swc_ecma_parser/tests/tsc/voidOperatorInvalidOperations.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Unary operator void - -// operand before void -var ANY = ANY void ; //expect error - -// miss an operand -var ANY1 = void ; \ No newline at end of file diff --git a/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.json b/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.json new file mode 100644 index 00000000000..7fadcb899ec --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.json @@ -0,0 +1,1156 @@ +{ + "type": "Script", + "span": { + "start": 71, + "end": 810, + "ctxt": 0 + }, + "body": [ + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 71, + "end": 209, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 76, + "end": 85, + "ctxt": 0 + }, + "value": "WeakTypes", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 92, + "end": 208, + "ctxt": 0 + }, + "types": [ + { + "type": "TsTypeLiteral", + "span": { + "start": 94, + "end": 114, + "ctxt": 0 + }, + "members": [ + { + "type": "TsPropertySignature", + "span": { + "start": 96, + "end": 112, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 96, + "end": 104, + "ctxt": 0 + }, + "value": "optional", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 105, + "end": 111, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsLiteralType", + "span": { + "start": 107, + "end": 111, + "ctxt": 0 + }, + "literal": { + "type": "BooleanLiteral", + "span": { + "start": 107, + "end": 111, + "ctxt": 0 + }, + "value": true + } + } + }, + "typeParams": null + } + ] + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 121, + "end": 147, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 123, + "end": 145, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 123, + "end": 134, + "ctxt": 0 + }, + "value": "toLowerCase", + "optional": false + }, + "computed": false, + "optional": true, + "params": [], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 137, + "end": 145, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 139, + "end": 145, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + } + ] + }, + { + "type": "TsTypeLiteral", + "span": { + "start": 154, + "end": 208, + "ctxt": 0 + }, + "members": [ + { + "type": "TsMethodSignature", + "span": { + "start": 156, + "end": 179, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 156, + "end": 167, + "ctxt": 0 + }, + "value": "toUpperCase", + "optional": false + }, + "computed": false, + "optional": true, + "params": [], + "typeAnn": { + "type": "TsTypeAnnotation", + "span": { + "start": 170, + "end": 178, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 172, + "end": 178, + "ctxt": 0 + }, + "kind": "string" + } + }, + "typeParams": null + }, + { + "type": "TsPropertySignature", + "span": { + "start": 180, + "end": 206, + "ctxt": 0 + }, + "readonly": false, + "key": { + "type": "Identifier", + "span": { + "start": 180, + "end": 197, + "ctxt": 0 + }, + "value": "otherOptionalProp", + "optional": false + }, + "computed": false, + "optional": true, + "init": null, + "params": [], + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 198, + "end": 206, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsKeywordType", + "span": { + "start": 200, + "end": 206, + "ctxt": 0 + }, + "kind": "number" + } + }, + "typeParams": null + } + ] + } + ] + } + }, + { + "type": "TsTypeAliasDeclaration", + "span": { + "start": 211, + "end": 274, + "ctxt": 0 + }, + "declare": false, + "id": { + "type": "Identifier", + "span": { + "start": 216, + "end": 235, + "ctxt": 0 + }, + "value": "LiteralsOrWeakTypes", + "optional": false + }, + "typeParams": null, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 242, + "end": 273, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 244, + "end": 247, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 244, + "end": 247, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 254, + "end": 257, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 254, + "end": 257, + "ctxt": 0 + }, + "value": "B", + "raw": "\"B\"" + } + }, + { + "type": "TsTypeReference", + "span": { + "start": 264, + "end": 273, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 264, + "end": 273, + "ctxt": 0 + }, + "value": "WeakTypes", + "optional": false + }, + "typeParams": null + } + ] + } + }, + { + "type": "VariableDeclaration", + "span": { + "start": 276, + "end": 304, + "ctxt": 0 + }, + "kind": "let", + "declare": true, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 288, + "end": 303, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 288, + "end": 292, + "ctxt": 0 + }, + "value": "aOrB", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 292, + "end": 303, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsUnionType", + "span": { + "start": 294, + "end": 303, + "ctxt": 0 + }, + "types": [ + { + "type": "TsLiteralType", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 294, + "end": 297, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + { + "type": "TsLiteralType", + "span": { + "start": 300, + "end": 303, + "ctxt": 0 + }, + "literal": { + "type": "StringLiteral", + "span": { + "start": 300, + "end": 303, + "ctxt": 0 + }, + "value": "B", + "raw": "\"B\"" + } + } + ] + } + } + }, + "init": null, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 306, + "end": 435, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 312, + "end": 435, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 312, + "end": 313, + "ctxt": 0 + }, + "value": "f", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 316, + "end": 435, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 317, + "end": 341, + "ctxt": 0 + }, + "value": "arg", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 320, + "end": 341, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 322, + "end": 341, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 322, + "end": 341, + "ctxt": 0 + }, + "value": "LiteralsOrWeakTypes", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 346, + "end": 435, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 352, + "end": 433, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 356, + "end": 367, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 356, + "end": 359, + "ctxt": 0 + }, + "value": "arg", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 364, + "end": 367, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 369, + "end": 396, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 379, + "end": 390, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 386, + "end": 389, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 406, + "end": 433, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 416, + "end": 427, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 423, + "end": 426, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 437, + "end": 556, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 443, + "end": 556, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 443, + "end": 444, + "ctxt": 0 + }, + "value": "g", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 447, + "end": 556, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 448, + "end": 462, + "ctxt": 0 + }, + "value": "arg", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 451, + "end": 462, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 453, + "end": 462, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 453, + "end": 462, + "ctxt": 0 + }, + "value": "WeakTypes", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 467, + "end": 556, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 473, + "end": 554, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 477, + "end": 488, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 477, + "end": 480, + "ctxt": 0 + }, + "value": "arg", + "optional": false + }, + "right": { + "type": "StringLiteral", + "span": { + "start": 485, + "end": 488, + "ctxt": 0 + }, + "value": "A", + "raw": "\"A\"" + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 490, + "end": 517, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 500, + "end": 511, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 507, + "end": 510, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 527, + "end": 554, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 537, + "end": 548, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 544, + "end": 547, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 558, + "end": 688, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 564, + "end": 688, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 564, + "end": 565, + "ctxt": 0 + }, + "value": "h", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 568, + "end": 688, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 569, + "end": 593, + "ctxt": 0 + }, + "value": "arg", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 572, + "end": 593, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 574, + "end": 593, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 574, + "end": 593, + "ctxt": 0 + }, + "value": "LiteralsOrWeakTypes", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 598, + "end": 688, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 604, + "end": 686, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 608, + "end": 620, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 608, + "end": 611, + "ctxt": 0 + }, + "value": "arg", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 616, + "end": 620, + "ctxt": 0 + }, + "value": "aOrB", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 622, + "end": 649, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 632, + "end": 643, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 639, + "end": 642, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 659, + "end": 686, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 669, + "end": 680, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 676, + "end": 679, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + }, + { + "type": "VariableDeclaration", + "span": { + "start": 690, + "end": 810, + "ctxt": 0 + }, + "kind": "const", + "declare": false, + "declarations": [ + { + "type": "VariableDeclarator", + "span": { + "start": 696, + "end": 810, + "ctxt": 0 + }, + "id": { + "type": "Identifier", + "span": { + "start": 696, + "end": 697, + "ctxt": 0 + }, + "value": "i", + "optional": false, + "typeAnnotation": null + }, + "init": { + "type": "ArrowFunctionExpression", + "span": { + "start": 700, + "end": 810, + "ctxt": 0 + }, + "params": [ + { + "type": "Identifier", + "span": { + "start": 701, + "end": 715, + "ctxt": 0 + }, + "value": "arg", + "optional": false, + "typeAnnotation": { + "type": "TsTypeAnnotation", + "span": { + "start": 704, + "end": 715, + "ctxt": 0 + }, + "typeAnnotation": { + "type": "TsTypeReference", + "span": { + "start": 706, + "end": 715, + "ctxt": 0 + }, + "typeName": { + "type": "Identifier", + "span": { + "start": 706, + "end": 715, + "ctxt": 0 + }, + "value": "WeakTypes", + "optional": false + }, + "typeParams": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "span": { + "start": 720, + "end": 810, + "ctxt": 0 + }, + "stmts": [ + { + "type": "IfStatement", + "span": { + "start": 726, + "end": 808, + "ctxt": 0 + }, + "test": { + "type": "BinaryExpression", + "span": { + "start": 730, + "end": 742, + "ctxt": 0 + }, + "operator": "===", + "left": { + "type": "Identifier", + "span": { + "start": 730, + "end": 733, + "ctxt": 0 + }, + "value": "arg", + "optional": false + }, + "right": { + "type": "Identifier", + "span": { + "start": 738, + "end": 742, + "ctxt": 0 + }, + "value": "aOrB", + "optional": false + } + }, + "consequent": { + "type": "BlockStatement", + "span": { + "start": 744, + "end": 771, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 754, + "end": 765, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 761, + "end": 764, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + }, + "alternate": { + "type": "BlockStatement", + "span": { + "start": 781, + "end": 808, + "ctxt": 0 + }, + "stmts": [ + { + "type": "ReturnStatement", + "span": { + "start": 791, + "end": 802, + "ctxt": 0 + }, + "argument": { + "type": "Identifier", + "span": { + "start": 798, + "end": 801, + "ctxt": 0 + }, + "value": "arg", + "optional": false + } + } + ] + } + } + ] + }, + "async": false, + "generator": false, + "typeParameters": null, + "returnType": null + }, + "definite": false + } + ] + } + ], + "interpreter": null +} diff --git a/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.ts b/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.ts new file mode 100644 index 00000000000..003a56a5c65 --- /dev/null +++ b/crates/swc_ecma_parser/tests/tsc/weakTypesAndLiterals01.ts @@ -0,0 +1,51 @@ +// @strict: true +// @declaration: true +// @emitDeclarationOnly: true + +type WeakTypes = + | { optional?: true; } + | { toLowerCase?(): string } + | { toUpperCase?(): string, otherOptionalProp?: number }; + +type LiteralsOrWeakTypes = + | "A" + | "B" + | WeakTypes; + +declare let aOrB: "A" | "B"; + +const f = (arg: LiteralsOrWeakTypes) => { + if (arg === "A") { + return arg; + } + else { + return arg; + } +} + +const g = (arg: WeakTypes) => { + if (arg === "A") { + return arg; + } + else { + return arg; + } +} + +const h = (arg: LiteralsOrWeakTypes) => { + if (arg === aOrB) { + return arg; + } + else { + return arg; + } +} + +const i = (arg: WeakTypes) => { + if (arg === aOrB) { + return arg; + } + else { + return arg; + } +} diff --git a/crates/swc_ecma_parser/tests/typescript.rs b/crates/swc_ecma_parser/tests/typescript.rs index bbade2a6333..844cb1e0f66 100644 --- a/crates/swc_ecma_parser/tests/typescript.rs +++ b/crates/swc_ecma_parser/tests/typescript.rs @@ -78,7 +78,10 @@ fn spec(file: PathBuf) { run_spec(&file, &output); } -#[testing::fixture("tests/tsc/**/*.ts")] +#[testing::fixture( + "tests/tsc/**/*.ts", + exclude("autoAccessor", "parserArrowFunctionExpression11") +)] fn tsc_spec(file: PathBuf) { let output = file.with_extension("json"); run_spec(&file, &output); diff --git a/crates/swc_ecma_transforms_typescript/tests/strip_correctness.rs b/crates/swc_ecma_transforms_typescript/tests/strip_correctness.rs index 19122dc9dc2..6841366b99b 100644 --- a/crates/swc_ecma_transforms_typescript/tests/strip_correctness.rs +++ b/crates/swc_ecma_transforms_typescript/tests/strip_correctness.rs @@ -131,6 +131,8 @@ fn identity(entry: PathBuf) { "tsxReactEmitNesting", "tsxTypeArgumentsJsxPreserveOutput", "unicodeEscapesInJsxtags", + "autoAccessor", + "parserArrowFunctionExpression11.ts", // decorator "issue-2417", // TODO: Script mode